Skip to content

Fix all npm audit vulnerabilities and use zero-CVE postgres image - #19

Open
Vanguadm wants to merge 1 commit into
AtomicJar:mainfrom
Vanguadm:fix/npm-audit-zero-vulns
Open

Fix all npm audit vulnerabilities and use zero-CVE postgres image#19
Vanguadm wants to merge 1 commit into
AtomicJar:mainfrom
Vanguadm:fix/npm-audit-zero-vulns

Conversation

@Vanguadm

Copy link
Copy Markdown

Summary

npm audit reported 40 vulnerabilities (2 critical, 24 high, 14 moderate). This PR takes it to 0, and moves the test image to one that scans at zero CVEs.

  • jest ^25.0.0 -> ^30.4.2 — the old jest tree supplied the critical form-data/request chain (via jsdom), node-notifier command injection, and the sane/braces/qs/tough-cookie advisories
  • @testcontainers/postgresql ^10.3.2 -> ^12.0.4 — aligns with testcontainers ^12.0.4, removing the nested testcontainers 10.x that carried vulnerable undici 6.x, dockerode 4.x, and uuid
  • overrides.minimatch: ^10.2.5 — the brace-expansion DoS (GHSA-mh99-v99m-4gvg) is only patched in brace-expansion@5.0.8, and no in-range fix exists anywhere: even latest jest 30 and testcontainers 12 pull glob@10 -> minimatch@9 -> vulnerable brace-expansion. The override forces every consumer onto minimatch 10.2.5, which resolves brace-expansion 5.0.8
  • engines.node >=16.0.0 -> >=18.14.0 — jest 30's floor
  • Test image: postgres:14-alpine -> cgr.dev/chainguard/postgres:latest — every official postgres:*-alpine tag currently scans with 1 critical + 16 high CVEs in the shared base layers; the Chainguard image scans at 0 and honors the same POSTGRES_* env vars and /docker-entrypoint-initdb.d/ contract the test relies on

Verification

  • npm audit: 0 vulnerabilities (was 40)
  • npm ls minimatch brace-expansion glob undici dockerode: all consumers resolve minimatch 10.2.5 / brace-expansion 5.0.8; undici 8.9.0; dockerode 5.0.1; single deduped testcontainers 12.0.4
  • npx jest --listTests confirms the jest 30 toolchain loads and discovers the suite; the full suite runs in CI against Testcontainers Cloud

🤖 Generated with Claude Code

- Upgrade jest to ^30.4.2 (reverts accidental downgrade to ^25 that
  pulled in the critical form-data/request chain, node-notifier, and
  the old sane/braces/qs/tough-cookie tree)
- Align @testcontainers/postgresql with testcontainers at ^12.0.4,
  dropping the nested testcontainers 10.x carrying vulnerable
  undici 6.x, dockerode 4.x, and uuid
- Add overrides.minimatch ^10.2.5 so every glob/minimatch consumer
  resolves brace-expansion 5.0.8 - the only patched version for
  GHSA-mh99-v99m-4gvg, which has no in-range fix even in latest
  jest 30 and testcontainers 12
- Bump engines.node to >=18.14.0 (jest 30 floor)
- Switch the postgres test image to cgr.dev/chainguard/postgres:latest;
  all official postgres alpine tags carry 1 critical/16 high CVEs in
  shared base layers, Chainguard scans at zero

npm audit: 40 vulnerabilities (2 critical, 24 high, 14 moderate) -> 0
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