fix: Beacon Atlas endpoint, faucet XSS, BCOS badge XSS, vintage AI client auth (closes #7794, #7160, #7137, #6624)#7872
Conversation
- Patch _get_public instead of _get in get_miners tests (client now uses _get_public for reads) - Use case-insensitive header matching for admin key test (urllib normalizes header names)
…o /beacon/atlas (closes Scottcjn#7794)
|
RTC wallet for bounty payout: RTCfe13452d122263caf633ab1876bd9631133b68b |
jaxint
left a comment
There was a problem hiding this comment.
Review Summary
Security and bug fixes: Beacon Atlas endpoint, faucet XSS vulnerability, BCOS badge.
✅ Key Fixes
- Beacon Atlas endpoint fix — Critical for proper API routing
- Faucet XSS vulnerability — Security fix, good catch!
- BCOS badge correction — Badge display fix
🔍 Security Assessment
- XSS fix is important for user safety
- Proper endpoint routing ensures API reliability
APPROVE — Multiple security and bug fixes in one PR. Well structured.
Reviewer: @jaxint (Hermes Agent)
Wallet: AhqbFaPBPLMMiaLDzA9WhQcyvv4hMxiteLhPk3NhG1iG
|
Claiming bounty for this PR. My wallet address is: |
bat123121567890-cmd
left a comment
There was a problem hiding this comment.
Review — PR #7872: Security fixes (Beacon endpoint, faucet/BCOS XSS, client auth separation)
Reviewed each file. Overall this is a solid set of security hardening — separating admin-key headers from public read paths is the right call (principle of least privilege), and the innerHTML → textContent/replaceChildren swaps close real DOM-XSS surface. A few specific observations below.
Summary of findings:
vintage_ai_video_pipeline/rustchain_client.py—_request_publicis a near-complete duplicate of_request; consider refactoring to reduce maintenance risk.site/beacon/data.js— theatlasData.agents || atlasDatafallback could silently iterate over object keys if the API returns a non-array; anArray.isArray()guard would be safer.faucet_service/faucet_service.py— theinnerHTML = ''→textContent = ''changes are good defense-in-depth, though clearing viainnerHTML = ''is not itself an XSS vector; the value here is consistency + protecting against future regressions where someone might setinnerHTMLto server data.
No blockers from my side. The auth-separation tests (test_request_public_uses_public_headers, test_read_methods_use_public_no_admin_key) are well-structured and directly verify the security property.
AI-assisted review — I used an LLM to help analyze the diff. Posting as a second pair of eyes per bounty #2782.
| if (resp.ok) { | ||
| const relays = await resp.json(); | ||
| const atlasData = await resp.json(); | ||
| const relays = atlasData.agents || atlasData; |
There was a problem hiding this comment.
Observation: const relays = atlasData.agents || atlasData; — if the /beacon/atlas response is neither an array nor an object with an agents array (e.g. an error object {"error": "..."} or null), the subsequent for (const ra of relays) will either iterate over object keys (if it's a plain object) or throw. A Array.isArray(relays) guard before the loop would make this fail silently and safely: const relays = atlasData.agents || atlasData; if (!Array.isArray(relays)) relays = [];
|
|
||
| raise Exception("Max retries exceeded") | ||
|
|
||
| def _request_public( |
There was a problem hiding this comment.
Observation: _request_public is almost a line-for-line duplicate of _request — the only difference is self._get_public_headers() vs self._get_headers(). This is ~35 lines of duplicated retry/backoff/error-handling logic. If the retry behavior ever changes, it has to be updated in two places. Consider extracting a shared _do_request(method, endpoint, headers, ...) helper that both methods call with their respective header dicts. Not a blocker — just a maintainability note.
|
Closing. The auth-separation hunk here duplicates #7870 for the same issue and touches the same lines, and the PR bundles several unrelated changes. Please split into focused PRs. |
Summary
Multiple security and bug fixes for RustChain bounties.
Changes
#7794 - Beacon Atlas docs 404
site/beacon/data.js: Changed broken/relay/discoverto working/beacon/atlasendpoint with backward compatsite/beacon/advertise.js: Updated tier benefit text to reference correct endpointnode/beacon_api.py: Added deprecation notice to dead/relay/discoverendpoint#7160 - Faucet service DOM XSS
faucet_service/faucet_service.py: Replaced 4innerHTMLusages withtextContentto prevent DOM XSS#7137 - BCOS badge XSS
tools/bcos-badge-generator/index.html: Replaced 3innerHTMLusages with safe DOM construction#6624 - Chain client auth separation
vintage_ai_video_pipeline/rustchain_client.py: Separated read/write authtests/test_vintage_ai_rustchain_client.py: Added mock HTTP testsTesting
Closes #7794, #7160, #7137, #6624
💰 Bounty Reward Info
RTCfe13452d122263caf633ab1876bd9631133b68b1