Skip to content

chore(deps): resolve npm audit findings without next 9.x downgrade (closes #22)#38

Open
FUKI618 wants to merge 1 commit into
JCodesMore:masterfrom
FUKI618:chore/audit-fix-for-upstream
Open

chore(deps): resolve npm audit findings without next 9.x downgrade (closes #22)#38
FUKI618 wants to merge 1 commit into
JCodesMore:masterfrom
FUKI618:chore/audit-fix-for-upstream

Conversation

@FUKI618
Copy link
Copy Markdown

@FUKI618 FUKI618 commented Apr 28, 2026

Hi! Thanks for the great template 🙌. This PR addresses the issue reported in #22 where npm audit fix on the current main tries to "fix" the remaining moderate-severity postcss finding by downgrading next to 9.3.3 — which is a major-major regression (next 9 and next 16 have entirely different APIs and break the scaffold).

What this PR does

Two surgical changes to package.json, no code/doc changes:

  1. next 16.2.1 → 16.2.4 — non-breaking patch bump within the same major. Resolves the path-to-regexp HIGH-severity ReDoS finding (this is what npm audit fix recommends as the non-breaking step).

  2. New overrides entry pinning postcss to ^8.5.10 — forces the transitive postcss (used by next's CSS pipeline) to a non-vulnerable version without touching next's major. This is the documented npm workaround when a transitive dep has a fix available but the parent hasn't published a release pulling it in yet.

"overrides": {
  "postcss": "^8.5.10"
}

Verification

After this change, on a clean install (rm -rf node_modules package-lock.json && npm install):

$ npm ls next
└── next@16.2.4

$ npm audit
found 0 vulnerabilities

$ npm run check       # lint + typecheck + build
✓ all clean

Why I'm sending this

I'm running a downstream fork of this template (FUKI618/ai-website-design-study-template) and hit the same issue. Once we landed this fix in our fork it solved the problem cleanly without disturbing anything else, so I figured upstream users would benefit too. Happy to adjust the patch if you'd prefer a different shape.

Closes #22.

— FUKI618

…rade

Fixes the underlying issue reported in JCodesMore#22 — npm audit fix on the
current main was attempting to "fix" the postcss XSS by downgrading
next to 9.3.3, which is a major-major regression (next 9 ↔ next 16
have completely different APIs and break the entire scaffold).

This commit takes the surgical path:

- next: 16.2.1 → 16.2.4 (in-major patch bump). Resolves the
  path-to-regexp HIGH ReDoS via the dependency chain — npm audit fix
  recommends this as a non-breaking step.

- Add an npm overrides entry pinning postcss to ^8.5.10. This forces
  the transitive postcss (used by next's CSS pipeline) to a
  non-vulnerable version without touching next's major. The override
  is the documented workaround when a transitive dep has a fix
  available but the parent hasn't published a release pulling it in
  yet (https://docs.npmjs.com/cli/v10/configuring-npm/package-json#overrides).

After this change:

  $ npm ls next
  └── next@16.2.4

  $ npm audit
  found 0 vulnerabilities

  $ npm run check
  ✓ lint + typecheck + build all clean

No code or documentation changes — purely a dependency hygiene fix.

Closes JCodesMore#22.
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.

Bug: 'claude --chrome' skill fails to load after npm audit fix

1 participant