Skip to content

fix: resolve npm audit and composer audit vulnerabilities - #274

Open
davidperezgar wants to merge 1 commit into
trunkfrom
claude/npm-composer-audit-shsfi2
Open

fix: resolve npm audit and composer audit vulnerabilities#274
davidperezgar wants to merge 1 commit into
trunkfrom
claude/npm-composer-audit-shsfi2

Conversation

@davidperezgar

@davidperezgar davidperezgar commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Bump @wordpress/scripts 19.2.434.1.0 in devDependencies, which eliminates the bulk of the npm vulnerabilities (axios, postcss, nth-check, braces, cross-spawn, tar-fs, ws, js-yaml, and more).
  • Add targeted overrides for the vulnerable sub-dependencies still pulled in transitively by @wordpress/scripts@34.1.0 that don't resolve to a patched version on their own: lighthouse, serialize-javascript, uuid (via sockjs), markdownlint-cli, adm-zip.
  • npm audit now reports 0 vulnerabilities (down from 58: 3 low, 32 moderate, 23 high).
  • Bump squizlabs/php_codesniffer 3.13.53.13.6 in composer.lock to fix a high-severity OS command injection (CVE-2026-67434). No composer.json change was needed since the existing ^3 constraint already covers the fix.
  • composer audit now reports 0 vulnerabilities (down from 1 high).

Test plan

  • npm audit → 0 vulnerabilities
  • composer audit --locked → 0 vulnerabilities
  • npm run build:jfb builds successfully with the bumped @wordpress/scripts
  • CI / reviewer to confirm phpcs/phpstan/PHPUnit still run cleanly with squizlabs/php_codesniffer@3.13.6 (this sandbox could not fully composer install due to GitHub API rate limiting on outbound network, but the lockfile-only update was verified via composer audit --locked)

Generated by Claude Code

Open WordPress Playground Preview

- Bump @wordpress/scripts 19.2.4 -> 34.1.0, eliminating the bulk of
  transitive npm vulnerabilities (axios, postcss, nth-check, braces,
  cross-spawn, tar-fs, ws, js-yaml, etc.)
- Add overrides for remaining vulnerable sub-dependencies pulled in by
  @wordpress/scripts that don't get bumped automatically: lighthouse,
  serialize-javascript, uuid (via sockjs), markdownlint-cli, adm-zip
- npm audit now reports 0 vulnerabilities (down from 58)
- Bump squizlabs/php_codesniffer 3.13.5 -> 3.13.6 to fix a high
  severity OS command injection (CVE-2026-67434); no composer.json
  change needed since it already allows ^3
- composer audit now reports 0 vulnerabilities

Verified `npm run build:jfb` still builds successfully after the
dependency bump.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae429180d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread package.json
},
"overrides": {
"@wordpress/scripts": {
"lighthouse": "^13.4.1",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve Node 20 compatibility in the Lighthouse override

When dependencies are installed on Node 20 with engine-strict enabled, this override makes npm ci fail: the resolved Lighthouse 13.4.1 declares Node >=22.19 (package-lock.json), while its direct consumer @wordpress/e2e-test-utils-playwright declares Node >=18.12 and requests Lighthouse ^12.2.2. Either retain a compatible Lighthouse release or explicitly raise the project's Node requirement to >=22.19 so supported installation environments are not silently narrowed.

Useful? React with 👍 / 👎.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Beyond the reported lockfile/overrides sync issue, I checked whether the npm overrides nesting for uuid-via-sockjs actually reaches the vulnerable transitive copy pulled in by lighthouse/other deps (a finder had flagged this as possibly ineffective) — the override is scoped correctly under @wordpress/scripts > sockjs > uuid and would apply to that resolution path, so that concern doesn't hold up on its own; it's moot anyway since the lockfile needs to be regenerated regardless.

Extended reasoning...

One short paragraph: verified the overrides nesting itself is structurally correct (scoped under @wordpress/scripts.sockjs.uuid), so the earlier concern about it not reaching the vulnerable copy is not a real issue on its own — the blocking problem is the confirmed lockfile drift already flagged inline.

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