Skip to content

docs(adr): record the dompurify fix, and make triage check our own pins - #2406

Merged
kompiro merged 2 commits into
mainfrom
docs/adr-security-20260808
Aug 9, 2026
Merged

kompiro merged 2 commits into
mainfrom
docs/adr-security-20260808

Conversation

@kompiro

@kompiro kompiro commented Aug 8, 2026 •

Copy link
Copy Markdown
Owner

Purpose

Refs #2404

Summary

Records ADR-2404 (the decision behind #2405, resolving Dependabot alert #67 / GHSA-55q2-fjhq-7xh7), and turns the lesson from it into an operational rule.

Two days running, an existing override's floor turned out to be the vulnerable version itself:

Date Package Override at the time Advisory vulnerable range ADR
2026-08-07 js-yaml js-yaml@4: ^4.3.0 >= 4.0.0, < 4.3.1 ADR-2390
2026-08-08 dompurify dompurify: ^3.4.12 <= 3.4.12 ADR-2404

That is structural, not coincidence. Pinning a floor at "the patched version at the time" turns the override into a lock onto a version some later advisory covers, and reading only the lock's resolved versions makes it look handled. So this PR adds a .claude/rules/dependabot.md section that makes triage diff the advisory's vulnerable range against our own override and declaration ranges.

Not an ADR-only PR — it touches .claude/rules/, so it is outside the ADR-2331 auto-merge exception and wants a normal review.

Changes

  • docs/adr/2404-dependabot-security-2026-08-08.md — new ADR
  • .claude/rules/dependabot.md — new section "Security alert 時は advisory の脆弱範囲を override / 宣言レンジと突き合わせる", with the procedure and the two worked examples
  • docs/adr/effective.md, graph.md, graph/build.md — regenerated by pnpm adr:regenerate

What the main merge changed here

Main landed #2411 / ADR-2401 (pnpm 11, security floors relocated to pnpm-workspace.yaml) while this was open, and with it a rules section stating that older security ADRs point at a location pnpm 11 no longer reads.

The section this PR adds pointed at exactly that dead location — and git merged the two without a conflict, so nothing would have flagged it. Both are retargeted in the merge commit:

  • the rule's reachable state and its grep now name pnpm-workspace.yaml, and a step 4 was added to verify the vulnerable version is gone from the lock
  • ADR-2404's assumptions now grep pnpm-workspace.yaml; the previous grep: package.json :: "dompurify" would fail outright now that the pnpm field is gone
  • ADR-2404 gains a note that the fix changed location mid-flight, since leaving it in package.json would have made pnpm 11 ignore it silently

The generated ADR artifacts conflicted separately, because adr-tools 0.0.11 (#2407) dropped the ADR counts from their headers. Resolved by taking main's files and re-running pnpm adr:regenerate, not by hand-editing generated output.

Verification

  • pnpm adr:validate — 315 ADRs, 0 errors
  • pnpm adr:check-assumptions — both ADR-2404 assumptions ✓, 0 failing
  • Diff against main is the 5 files listed above and nothing else

Scope filter (new-feature PRs only)

  • N/A — not a new-feature PR

Dependency & license impact

  • N/A — no production dependency added or bumped across a major version

Manual Verification Checklist

N/A — covered by adr:validate and adr:check-assumptions.

TPL impact

Disposition: N/A — ADR plus an operational rule; no product-code behavior involved.

Related Docs

kompiro and others added 2 commits August 8, 2026 14:19
ADR-2404 covers Dependabot alert #67 (GHSA-55q2-fjhq-7xh7). Two things
worth recording: why both the override and the packages/app declaration
moved rather than just the override, and the exposure assessment showing
our own call sites are not in the vulnerable IN_PLACE-plus-hook shape.

Two days running, an existing override's floor turned out to be the
vulnerable version itself (js-yaml in ADR-2390, dompurify here). That is
structural: pinning a floor at "the patched version at the time" turns the
override into a lock onto a version a later advisory covers, and reading
only the lock makes it look handled. Adds a rules section that makes triage
diff the advisory's vulnerable range against our own override and workspace
declaration ranges, with the commands to do it.

Refs #2404

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Two independent collisions with main.

The generated ADR artifacts (effective.md, graph.md, graph/build.md)
conflicted because adr-tools 0.0.11 dropped the ADR counts from their headers
(#2407) while this branch had regenerated them with the counts still in. Took
main's files and re-ran `pnpm adr:regenerate` rather than hand-resolving
generated output.

The real one was silent: main relocated the security floors to
pnpm-workspace.yaml (#2411 / ADR-2401) and added a rules section saying so,
explicitly warning that older security ADRs point at the dead location. The
section this branch adds pointed at exactly that dead location, and git merged
the two without a conflict. Retargeted the reachable state and the grep to
pnpm-workspace.yaml, and added the lock check as step 4.

ADR-2404 gets the same treatment: assumptions now grep pnpm-workspace.yaml
(the old `grep: package.json :: "dompurify"` would fail now that the pnpm
field is gone), and a note records that the fix moved location mid-flight,
since leaving it in package.json would have made pnpm 11 ignore it silently.

adr:validate 315/0 errors; check-assumptions both ADR-2404 entries pass.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@kompiro
kompiro merged commit ba971a8 into main Aug 9, 2026
6 checks passed
@kompiro
kompiro deleted the docs/adr-security-20260808 branch August 9, 2026 00:26
kompiro added a commit that referenced this pull request Aug 9, 2026
…#2416)

0.0.11 removed the ADR counts from effective.md and graph.md but left
renderTopicMarkdown() writing "N ADRs in this topic" into all 15 committed
docs/adr/graph/*.md pages, so those kept drifting between parallel branches.
PR #2406 hit it: graph/build.md conflicted with 71 / 70 / 72.

adr-tools 0.0.12 (kompiro/adr-tools#30) drops that fourth count and replaces
the two named-file assertions with a sweep over every generated file, so a
future output is covered without anyone remembering to list it.

The lock diff is large but nothing moved version. Comparing name@version
across the lock with peer suffixes stripped, the only resolution changes are
adr-tools 0.0.11 -> 0.0.12 and the drop of @babel/helper-validator-identifier
and @types/estree, which nothing needs any more. The remaining ~550 lines are
pnpm re-keying peer suffixes; a fresh install on main is a no-op, so this is
the graph change re-keying, not pre-existing drift.

Refs #2407

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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