Repository navigation
Fix npm audit findings and add audit gate - #2725
Merged
Merged
Conversation
- Clears both npm audit highs: the advisory and its hugo-extended chain entry (hugo-extended pins adm-zip ^0.5.17; its own bump is open upstream as jakejarvis/hugo-extended#256, making this override interim) - Adds a supply-chain assertion that goes red once hugo-extended's declared range moves past the vulnerable one, so the stale override gets dropped in that bump PR - Carries the lock entry by hand (matching a fresh resolve's output) because npm trusts an in-sync lock and applies overrides only while re-resolving
- Complements the offline structural audit: npm audit must report nothing outside a reviewed-advisory allowlist, and allowlisted advisories no longer reported go red too (a stale exception is a silent hole) - Accepts GHSA-q3xp-j858-q9xf, which matches the registry name markdownlint-rule-link-pattern only: this repo installs the package commit-pinned from its author's GitHub tag, so the flagged registry code is never fetched
Windows CI fails when spawnSync tries to invoke npm.cmd directly, since batch files require shell execution. Use 'npm' on all platforms with shell: true on Windows; Windows PATH resolves npm to npm.cmd. Add error checking for spawnSync failures.
Extract audit validation into a testable helper function and add five fixture tests that fail-close on schema evolution and exception staleness: - Add auditReportVersion === 2 check to fail-closed on npm audit v3 format change - Validate string via entries resolve to keys in vulnerabilities (no dangling chains) - Exclude null from via type check (fail-closed rather than throwing mid-loop) - Fixture: valid report with accepted advisory parses correctly - Fixture: unreviewed advisory is rejected (proof of acceptance check) - Fixture: missing accepted advisory fails (proof of stale-exception detection) - Fixture: format version change is rejected (proof of version pinning) - Fixture: dangling string via is rejected (proof of chain validation) With the allowlist empty (once npm scopes GHSA-q3xp-j858-q9xf), the version check and string-chain validation become the only proof that advisory objects were parsed. Red-first verified: latent holes confirmed to fail on old parser. Fixes concerns from adversarial review re: false-clean after allowlist drain.
- Replace truthy check (allVulns[via]) with Object.hasOwn to close prototype-key bypass (constructor, __proto__, toString, etc.) - Add F6: mixed-advisory fixture (allowlisted + unreviewed GHSA in same report) to catch early-exit shortcuts and order-dependent regressions - Add F7: valid transitive chain (string via → allowlisted advisory) to verify success path for npm v2 chained reports Red-first verified: old truthy check falsely passes on prototype keys; new fixtures would fail on early-exit regression. All 8 audit-gate fixtures now pass on current parser.
chalin
added a commit
to chalin/docsy
that referenced
this pull request
Aug 18, 2026
Sweep of the messages inherited with docsy#2725, per the repo's assert-message guidance: expected-condition phrasing (no 'still', 'unexpected', 'must'), and values that assert.equal already prints on failure dropped from messages. The parser fixture regexes that match these messages are updated in step; the full suite is the proof.
chalin
added a commit
to chalin/docsy
that referenced
this pull request
Aug 21, 2026
- Drops retirement history (the GHSA match, docsy#2725 lineage) from the audit-test comments: the commit/PR record owns it; the gate mechanism is stated in the file header and the code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.