Skip to content

fix: Patch CVEs and add supply-chain defences#260

Merged
egorpavlikhin merged 3 commits into
mainfrom
egorp/supply-chain-hardening
May 19, 2026
Merged

fix: Patch CVEs and add supply-chain defences#260
egorpavlikhin merged 3 commits into
mainfrom
egorp/supply-chain-hardening

Conversation

@egorpavlikhin
Copy link
Copy Markdown
Contributor

Summary

Routine npm supply-chain hardening pass.

CVE fixes (lockfile-only, 9 advisories resolved via npm audit fix)

Package Severity Path
ajv moderate direct + transitive
brace-expansion moderate direct + nested
diff (jsdiff) low transitive
flatted high transitive (3.2.4 -> 3.4.2, above vulnerable <=3.4.1)
js-yaml moderate direct + nested
minimatch high nested under glob/typedoc
picomatch high transitive
ws moderate transitive
yaml moderate transitive

No package.json changes — all in-range patch/minor bumps. npm audit count: 13 -> 4.

Defensive controls

  • npm audit signatures step in test.yml — catches tarball-swap / unsigned packages. Verified locally: all 553 packages have valid registry signatures, 4 have attestations.
  • .npmrc with min-release-age=3 days — blocks installing versions published <3 days ago. Requires npm >= 11.10 (CI runs Node 24, which ships with a sufficiently new npm; silently ignored on older local npm).
  • .github/dependabot.yml with cooldown (3-day default, 7-day for semver-major) for both npm and github-actions.
  • --provenance on npm publish — consumers can now verify our published tarballs against the GitHub Actions OIDC chain (id-token already configured).

Exposure triage (Phase 1)

Searched the lockfile and full tree for recent major supply-chain incidents:

  • Shai-Hulud (@ctrl/tinycolor, ngx-bootstrap, ~180 packages): not present
  • TanStack Mini Shai-Hulud (@tanstack/, @uipath/, @mistralai/, @squawk/): not present
  • chalk/debug Sept 2025: chalk@4.1.2, debug@4.3.4, ansi-styles@4.3.0/5.2.0, strip-ansi@6.0.1, supports-color@7.2.0/8.1.1 — all below the compromised versions (5.6.1 / 4.4.2 / 6.2.2 / 7.1.1 / 10.2.1)

IOC string sweep (shai-hulud, webhook.site, getsession.org, router_init.js, trufflehog, npmjs.help, registry-npm.org, gh-token-monitor, processor.js): no hits anywhere in the tree, including node_modules/.

Conclusion: not exposed. No credential rotation required.

Deferred

4 low-severity advisories remain in the @tootallnate/once -> http-proxy-agent -> jsdom -> jest-environment-jsdom chain. Fixing requires a major bump of jest-environment-jsdom (v29 -> v30). All four are test-only devDeps, the chain isn't reachable from production code, and dist/**/* (the published artifact) doesn't include any of it. Better to defer to a separate PR than risk test-runtime breakage in a security fix.

Test plan

  • npm audit — 13 -> 4 low (deferred jsdom chain)
  • npm audit signatures — 553 packages verified, 4 attestations
  • npm run build — passes
  • npm run lint — 46 errors / 43 warnings, all pre-existing on main (confirmed by git stash && npm run lint && git stash pop)
  • npm test — 15 failures locally, all "The host is not specified" because integration tests require OCTOPUS_TEST_URL from the CI service container. Should pass in CI.

🤖 Generated with Claude Code

egorpavlikhin and others added 2 commits May 19, 2026 16:45
Patches 9 in-range CVEs via `npm audit fix` (no `--force`):
ajv, brace-expansion, diff (jsdiff), flatted, js-yaml, minimatch,
picomatch, ws, yaml. No package.json changes required; lockfile only.

Defensive controls added:
- `npm audit signatures` step in CI to detect tarball-swap attacks
- `.npmrc` `min-release-age=3 days` to reject just-published versions
  (npm >= 11.10; CI runs Node 24 which has this; silently ignored on
  older local npm)
- `.github/dependabot.yml` with `cooldown` block for npm + actions
- `--provenance` on `npm publish` (OIDC already configured)

Triage of recent major incidents (Shai-Hulud, TanStack Mini Shai-Hulud,
chalk/debug Sept 2025): lockfile clean, no IOC strings present in tree.

Remaining 4 low-severity advisories in the @tootallnate/once ->
http-proxy-agent -> jsdom -> jest-environment-jsdom chain are deferred:
test-only devDeps, fix requires a major jest-environment-jsdom bump
(v29 -> v30), and code is not shipped in `dist/**/*`.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Comment thread .github/dependabot.yml
@@ -0,0 +1,16 @@
version: 2
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure if this is needed as I can't see repo settings and if dependabot is already enabled.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i don't believe it is, so let's run with it

npm's min-release-age config expects a plain integer (number of days),
not a duration string. CI on npm 11.x rejected "3 days" with
"Invalid time value".

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@APErebus APErebus left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread .github/dependabot.yml
@@ -0,0 +1,16 @@
version: 2
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i don't believe it is, so let's run with it

@egorpavlikhin egorpavlikhin merged commit f42d768 into main May 19, 2026
4 checks passed
@egorpavlikhin egorpavlikhin deleted the egorp/supply-chain-hardening branch May 19, 2026 08:31
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