Skip to content

ci: restore the npm audit gate around the unpatchable image-size advisories - #29

Merged
hayarobi merged 1 commit into
mainfrom
fix/audit-gate-image-size
Aug 27, 2026
Merged

ci: restore the npm audit gate around the unpatchable image-size advisories#29
hayarobi merged 1 commit into
mainfrom
fix/audit-gate-image-size

Conversation

@ultrafellen

Copy link
Copy Markdown
Member

The Security audit (high/critical) step has failed on every PR since the advisory database picked up three new entries on Aug 6–7. None of them relate to the PRs they blocked — the commit that passed on Aug 4 (408d3ff) fails today as 4df9bfd with a byte-identical package-lock.json.

Two are ours to fix

Raised via overrides:

package before after advisory
nanoid 3.3.16 3.3.18 CVE-2026-67213
js-yaml 4.3.0 4.3.1 GHSA-5p4m-2wfm-xmqj
js-yaml (under gray-matter) 3.15.0 3.15.1 same

Picked up the two moderates while here — dompurify 3.4.12 → 3.4.13, mermaid 11.16.0 → 11.16.1. Mermaid renders client-side, so the diagrams in noosphere/ and x402/ were checked against a local npm run serve, not just a passing build.

One is not

image-size has no patched release — 2.0.2 is the latest and was published 2025-04-02 — and Docusaurus treats replacing it as a breaking change targeted at v4 (facebook/docusaurus#12231, PR #12235 still draft). It will not clear on the 3.x line, so waiting is not a plan. It arrives through @docusaurus/mdx-loader, which is why one unfixable package accounts for 18 of the high findings.

Rather than drop the gate, the step now runs audit-ci with those two advisories allowlisted by ID in audit-ci.jsonc, each with the reasoning recorded beside it. Anything not listed there still fails — verified: exit 1 with the allowlist emptied, exit 0 with it applied.

The residual risk is bounded: the parser runs at build time only, never in the deployed static site, and it measures images committed to this repo.

Also: timeout-minutes: 15

Neither workflow had a timeout, so both defaulted to 360 minutes. That is the actual cost of an infinite-loop DoS advisory — a hung build holds a runner for six hours, and a hung deploy blocks the non-cancelling pages concurrency group for just as long. Current build takes ~30s. This is not specific to image-size; it bounds every future advisory of this shape.

Notes for review

  • audit-ci adds 24 dev-only packages. npm ci in CI installs them; they are not in the site bundle.
  • package-lock.json diff is exactly 5 version changes + the audit-ci tree, 0 removals.
  • Not included: making build a required status check. It currently is not, which is why the red X never actually blocked a merge. If we want the gate to bite, that is a ruleset change on main and a separate decision — happy to do it if you want.

…sories

The Security audit step has failed on every PR since the advisory database
picked up three new entries on Aug 6-7 — none related to the PRs they blocked.
The commit that passed on Aug 4 fails today with an identical package-lock.json.

Two of the three are ours to fix, via overrides:

- nanoid 3.3.16 -> 3.3.18 (CVE-2026-67213)
- js-yaml 4.3.0 -> 4.3.1, and 3.15.0 -> 3.15.1 under gray-matter
  (GHSA-5p4m-2wfm-xmqj)

Picked up the two moderates while here: dompurify 3.4.12 -> 3.4.13 and
mermaid 11.16.0 -> 11.16.1. Mermaid renders client-side, so the diagrams in
noosphere/ and x402/ were re-checked against a local serve, not just the build.

The third is not fixable here. image-size has no patched release — 2.0.2 is
the latest and was published 2025-04-02 — and Docusaurus treats replacing it
as a breaking change targeted at v4 (facebook/docusaurus#12231), so it will
not clear on the 3.x line. It arrives through @docusaurus/mdx-loader, which is
why a single unfixable package accounts for 18 of the high findings.

Rather than drop the gate, the step now runs audit-ci with those two advisories
allowlisted by ID in audit-ci.jsonc, each with the reasoning recorded beside it.
Anything not listed there still fails — verified exit 1 with the allowlist
emptied.

Both workflows also gain timeout-minutes: 15. An unbounded job is the real cost
of an infinite-loop DoS advisory: without it a hung build holds a runner for six
hours, and a hung deploy blocks the non-cancelling pages group for as long.

@hayarobi hayarobi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hayarobi
hayarobi merged commit cc4e0aa into main Aug 27, 2026
1 check 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.

2 participants