Skip to content

fix: audit hardening pass — XSS, crash, drift alert, a11y, CI (v3.0.1)#24

Merged
New1Direction merged 2 commits into
redesign/bright-inspectorfrom
fix/audit-3.0.1
Jun 15, 2026
Merged

fix: audit hardening pass — XSS, crash, drift alert, a11y, CI (v3.0.1)#24
New1Direction merged 2 commits into
redesign/bright-inspectorfrom
fix/audit-3.0.1

Conversation

@New1Direction

Copy link
Copy Markdown
Owner

Summary

A correctness, security, and tooling pass from a full code audit of RepoLens — no feature changes. Ships as v3.0.1 and reconciles the long-standing version drift (manifest 3.0.0 vs package.json 1.7.0 → both 3.0.1).

Fixed

  • Batch scanner XSSbatch.js rendered provider error messages and pasted URLs straight into innerHTML; both are now HTML-escaped (the file imported no escaper at all).
  • Compare-modal crashlibrary.js threw ReferenceError: FIT_ORDER is not defined on the Fit-delta cell because the constant was scoped to the wrong function. Hoisted to one module constant; the duplicate locals were removed.
  • Drift alert was dead — the daily stale-repos check read savedAt, but the store writes saved_at, so it always counted zero. Field names now match.
  • Reduced-motion leaks — the Batch & Stack loaders pulsed forever; both now honour prefers-reduced-motion.
  • WCAG AA contrast — darkened --text-faint on the five light themes (paper, cream, apple, latte, solarized) + the website.

Changed / hardened

  • Explicit content_security_policy in the manifest (matches the MV3 default, now auditable).
  • background.js: .catch on the RERUN path (no more stuck spinner); immutable combinator seed; removed two production console.log.
  • format.js: esc() now escapes single quotes (matches the canonical safe-html escaper).
  • CI: npm installnpm ci (lockfile regenerated + in sync), lint promoted to a blocking gate (was advisory), advisory npm audit step added; ESLint now lints .mjs so the dev driver stops flooding no-undef.

Docs

  • CHANGELOG [3.0.1] — Audit hardening + README "What's new" block + version badge.
  • Full audit report committed at docs/audits/audit-2026-06-15-deep-review.html.

Test plan

  • npm test733/733 passing
  • npm run lint0 errors (was 15)
  • Independent code-review pass — approved, no critical/high regressions
  • Load the unpacked extension: run a Batch scan and confirm error rows render escaped; open the Compare modal on repos with a fit-delta (no crash); trigger the drift alarm and confirm the stale count is non-zero
  • With prefers-reduced-motion: reduce, confirm the Batch/Stack loaders don't pulse
  • Eyeball the five light themes for the darker faint-label text

Deferred (own PRs)

Splitting the three monoliths, extracting the provider engine/message router for testability, library-grid virtualization, Playwright E2E, the vitest major bump, and three proposed features — all detailed in the audit report.

A correctness/security/tooling pass from a full code audit. No feature changes.

- batch.js: HTML-escape provider errors + pasted URLs (stored-input XSS)
- library.js: hoist FIT_ORDER to one module const — fixes a ReferenceError in
  the compare modal's Fit-delta cell; drop the duplicate per-function locals
- background.js: read saved_at (not savedAt) so the daily drift alert fires;
  add the missing .catch on the RERUN path; make the combinator seed immutable;
  drop two production console.log
- format.js: esc() now escapes single quotes (matches the safe-html escaper)
- batch.html, stack-tab.html: honour prefers-reduced-motion (loaders pulsed on)
- themes.css, website/app/global.css: darken faint text on light themes to AA
- manifest.json: explicit content_security_policy; version -> 3.0.1
- eslint.config.js: lint .mjs so the dev driver stops flooding no-undef
- ci.yml: npm ci (synced lockfile) + blocking lint + advisory npm audit
- package.json / package-lock.json: version -> 3.0.1; regenerate the stale lockfile

733/733 tests pass; eslint 0 errors.
- CHANGELOG: add [3.0.1] — Audit hardening (Fixed / Changed / Notes)
- README: v3.0.1 "What's new" block + version badge 3.0.0 -> 3.0.1
- docs/audits: add the 2026-06-15 deep-review report
@New1Direction New1Direction merged commit d07e520 into redesign/bright-inspector Jun 15, 2026
1 check passed
@New1Direction New1Direction deleted the fix/audit-3.0.1 branch June 15, 2026 21:14
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