explorer: 2D hardware museum + miner history endpoints#148
explorer: 2D hardware museum + miner history endpoints#148Scottcjn merged 3 commits intoScottcjn:mainfrom
Conversation
95f784a to
e1504d1
Compare
|
Security-focused review (PR #148)
Overall: great feature; biggest security question is whether |
David-code-tang
left a comment
There was a problem hiding this comment.
Security review notes (museum/explorer UI):
- DOM XSS sinks via innerHTML with untrusted miner metadata:
- web/museum/museum.js: legend.innerHTML uses where n is derived from device_family/device_arch from /api/miners. If an attacker can attest with a crafted string containing HTML, this becomes stored XSS.
- web/museum/museum3d.js: kv.innerHTML renders miner + other fields directly into HTML.
- The el() helper supports {html: ...} which is easy to misuse later.
Suggested fix: avoid innerHTML for any field that can be influenced by miners; use textContent/text nodes (or at minimum a small escapeHtml() and apply it before constructing HTML).
- UTF-8 BOMs in new web assets
Diff shows a BOM at start of several new files (e.g. museum.js / museum3d.*). Recommend removing; we’ve seen this cause garbled UI strings and tooling issues elsewhere.
Nice work overall on keeping most rendering via DOM nodes + textContent; tightening the few remaining innerHTMLs should make this safer.
Scottcjn
left a comment
There was a problem hiding this comment.
Changes Requested — Fun concept, needs testing
A 2D hardware museum for the block explorer is creative and fits our vintage computing ethos. However:
- Test evidence needed: Include a screenshot of the museum rendering with actual miner data
- API endpoints: The miner history endpoints need to work with our existing database schema. Verify field names match
miner_attest_recenttable columns - Performance: Loading all historical miner data could be slow — add pagination or limit to recent epochs
- Static assets: Where do the 2D sprites/assets come from? Include them in the PR or document the source
Address these and we'll review again.
Implements rustchain-bounties#29 Phase 1 (2D museum + explorer fixes).
Miner ID: liu971227-sys