Skip to content

v0.3.2 — report link-scheme hardening & trace-link honesty - #2

Merged
geyutu6755 merged 2 commits into
mainfrom
fix/v0.3.2-hardening
Nov 1, 2026
Merged

geyutu6755 merged 2 commits into
mainfrom
fix/v0.3.2-hardening

Conversation

@geyutu6755

Copy link
Copy Markdown
Owner

Post-release hardening on the verified v0.3.1 base.

  • SECURITY: report.html assigned result.json URLs to anchor href with no scheme check; a crafted/shared/older result.json opened as an offline report could yield a javascript:/data: link (self-XSS). All dynamic links (member/finding/plan/page) + the header target now validate http(s); unsafe URLs render as text. Reproduced (live javascript: anchors) then fixed.
  • UX: trace links state they are local/private and absent from hosted/public copies; traces remain stripped by CI/Pages.
  • Tests 132 -> 136 (real-browser URL-safety, header guard, trace-copy honesty). No tests removed or weakened.
  • Version/docs/lock -> 0.3.2; v0.3.1 Release install note corrected (npm not published).

Head: 673275f

The HTML report assigns result.json values (finding url, cluster member
url, plan url, page url, header entry) directly to anchor `href`. The
bundled scanner only ever produces http(s) URLs, but renderHtml is a
general generator over an arbitrary ScanResult, so a crafted / shared /
older / third-party result.json opened as an offline report could make a
page link `javascript:` or `data:` — self-XSS on click. Reproduced: a
rendered report exposed live `javascript:alert(member)` anchors.

- Client: safeHref() + linkOrText() emit an anchor only for http(s);
  anything else renders as non-clickable muted text. Applied to the four
  dynamic link sites (member, finding, plan "Open …", page table).
- Server: httpHref() guards the header target anchor.
- Trace links stay local/private but now say so (label + title: traces are
  not included in hosted/public copies) so users stop expecting a web
  download of stripped evidence.

Tests: real-browser audit asserts zero javascript:/data:/file: anchors
while legitimate http(s) links still render; unit tests cover the header
guard and the trace-copy honesty.
Bump 0.3.1 -> 0.3.2 (package.json, lock, runtime VERSION). Add the v0.3.2
CHANGELOG entry (report link-scheme hardening + trace-link honesty), update
the README (en + zh) Status sections and refresh the compatibility matrix
with the real verified counts (136/136) and observed v0.3.1 CI results.
@geyutu6755
geyutu6755 merged commit 43898ef into main Nov 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant