Repository navigation
Description
Summary
pnpm audit --prod currently reports 65 vulnerabilities — 1 critical, 24 high (2026-08-06 run; the readiness report counted 64/23). The lockfile sits at the exact floor of the declared semver ranges: react-router declared ^7.1.2 resolves to exactly 7.1.2 (7 HIGH advisories — XSS via ScrollRestoration, XSS via open redirects, DoS — patched >=7.18.0, in range), and dompurify declared ^3.2.3 resolves to 3.2.3 (15 advisories per the readiness audit, patched >=3.4.11, in range), plus undici/postcss transitives. A plain in-range pnpm update fixes all of these with zero code change. The one exception — swiper (the critical, needs the v12 major) — is explicitly excluded: a sibling ticket owns that bump.
Same subsystem, second finding: the DOMPurify allowlist on CMS event descriptions is silently a no-op. In src/components/organisms/EventDetails/EventDetails.tsx:92-110, USE_PROFILES: { html: true } (line 93) overwrites the configured ALLOWED_TAGS (12 tags) / ALLOWED_ATTR: ['href'] — the effective allowlist is the full HTML profile (~117 tags / 113 attributes, including style, class, img src, form/input). Not script execution (the profile is safe), but CMS-authored prose can overlay the host page (style="position:fixed;inset:0" — a clickjacking surface), fire image beacons, or render forms inside a trusted page.
Proposed changes
- Run an in-range
pnpm updateso the lockfile picks up patchedreact-router(>=7.18.0),dompurify(>=3.4.11), and theundici/postcsstransitive fixes. Nopackage.jsonrange changes needed; do NOT touchswiper(sibling ticket owns the major). - Drop
USE_PROFILES: { html: true }from theDOMPurify.sanitizecall (EventDetails.tsx:92-110) so the explicit 12-tag /href-only allowlist actually applies. KeepADD_ATTR: ['target']and the existingafterSanitizeAttributesrel-hardening hook (EventDetails.tsx:19-23, forcesrel="noopener noreferrer"ontargetlinks). - Re-verify the sanitize config against the updated dompurify version's semantics — the current advisory set includes "DOMPurify ADD_ATTR predicate skips URI validation"; confirm
ADD_ATTR: ['target']remains safe under the new version (targetis not a URI attribute) and that config-precedence behaviour hasn't shifted between 3.2.x and the resolved 3.4.x. - Defense-in-depth context: one react-router advisory (backslash open redirect in
Link/useNavigate, patched 7.18) is the upstream form of the exact bug this repo hand-patched insafePath(src/lib/shape/path.ts:56-57, commit 368e1f7). The update complements — does not replace — that guard; the existingsafePathtests (src/lib/shape/path.test.ts) must stay green.
Acceptance criteria
-
pnpm audit --prodreports zero high or critical advisories with paths throughreact-routerordompurify -
swiperremains at11.2.1in this ticket's diff (the major bump is owned by the sibling carousel ticket) -
USE_PROFILESis removed and a co-located unit test (node lane,renderToStaticMarkup-free — assert on the sanitizer output string, per.claude/rules/tests.md) proves the allowlist: strips a<div style="position:fixed">(both the tag and thestyleattr),<img src>,<form>/<input>; keeps all 12 allowed tags andhref; and an<a target="_blank" href>comes out withtargetpreserved plusrel="noopener noreferrer"(the hook). Extract the sanitize call to a testable module-scoped seam in the same folder if needed. - Existing
safePathtests stay green -
pnpm lint && pnpm typecheck && pnpm test:run && pnpm buildpass - Write an implementation report to
.claude/reports/<issue-number>-<short-slug>.md— in the MAIN checkout at /Users/devindra/Documents/Projects/SahajAtlasWeb even when implementing from a worktree (the folder is gitignored) — covering what changed, what was deliberately NOT changed, and which readiness-report findings are resolved.
Files affected
pnpm-lock.yaml(shared — see note)src/components/organisms/EventDetails/EventDetails.tsxsrc/components/organisms/EventDetails/EventDetails.test.tsx(new, co-located sanitizer test)
Parallel implementation: this ticket OWNS the files listed above; sibling release-hardening tickets run concurrently — avoid edits outside owned files except strictly additive ones. The pnpm lockfile is shared with two sibling tickets; conflicts there are expected and resolved by re-running pnpm install.
References
.claude/reports/RELEASE_READINESS.md§3.6 (dependency posture) + §3.2 (XSS posture) — ship-blocker 3 (repo-local, gitignored)- Verified 2026-08-06:
package.jsonranges vspnpm-lock.yamlresolutions ([email protected],[email protected]);pnpm audit --prodtotals above - Commit 368e1f7 — the hand-patched backslash/whitespace guard in
safePath
Metadata
Metadata
Assignees
Labels
Type
Fields
Hold Until
Activity
chore(audit): baseline four advisories published since the gate landed
chore(deps): book the four advisories published today (#128)
chore(deps): book four newly-published advisories in the audit baseline
chore(deps): update vulnerable deps and fix dompurify config (#137)
merge: bring in main (#133, #134, #136, #137)
fix(deps): update fast-uri to 3.1.7, clearing four high advisories (#190