Skip to content

fix(deps): pin nanoid past GHSA-28wg-ghj8-5hjv under y-indexeddb - #26

Merged
writingdeveloper merged 1 commit into
mainfrom
fix/nanoid-advisory
Aug 13, 2026
Merged

fix(deps): pin nanoid past GHSA-28wg-ghj8-5hjv under y-indexeddb#26
writingdeveloper merged 1 commit into
mainfrom
fix/nanoid-advisory

Conversation

@writingdeveloper

Copy link
Copy Markdown
Owner

Unblocks CI. Nothing to do with any feature branch — npm audit --audit-level=high is a gate, so a newly published advisory fails every open PR at once. Second time in a week.

The chain

nanoid 4.0.0–5.1.15: a non-secure generator can loop indefinitely on a negative size (GHSA-28wg-ghj8-5hjv). It reaches this repo once, transitively:

@keystatic/core → @toeverything/y-indexeddb → nanoid@5.1.6

Fixed in 5.1.16.

Why the override is scoped

A bare "nanoid": "^5.1.16" would also capture the other copy in the tree — @tailwindcss/postcss → postcss → nanoid@3.3.17 — which is not in the affected range and expects ^3. That would force a major bump on a package with no part in this, to fix a bug it does not have.

After the change:

@toeverything/y-indexeddb@0.10.0-canary.9 overridden
  nanoid@5.1.16 overridden          ← patched
@tailwindcss/postcss@4.1.18
  postcss@8.5.25 overridden
    nanoid@3.3.17                    ← untouched, as intended

Verification

npm audit --audit-level=high0 vulnerabilities. Type-check, lint, 161 tests, production build all pass on a clean .next.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LaydoxAZ4eaqqPNKrmWLbt

npm audit --audit-level=high is a CI gate, so a newly published high-severity
advisory fails every open PR regardless of what the PR changes. This is the
second time in a week; the branch that trips it is never the branch that
caused it.

nanoid 4.0.0–5.1.15 lets a non-secure generator loop forever on a negative
size. It reaches us once, transitively:
@keystatic/core → @toeverything/y-indexeddb → nanoid@5.1.6. Fixed in 5.1.16.

The override is scoped to that path rather than global on purpose. A bare
"nanoid": "^5.1.16" also captures the copy under postcss, which is pinned to
^3 and is not in the affected range — forcing a major on it to fix a package
it has nothing to do with. After this, npm ls shows y-indexeddb on 5.1.16 and
postcss still on 3.3.17, which is the whole point.

npm audit clean, type-check, lint, 161 tests, production build.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LaydoxAZ4eaqqPNKrmWLbt
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
portfolio Ready Ready Preview Aug 13, 2026 1:58am

Request Review

@writingdeveloper
writingdeveloper merged commit 4d2c6ee into main Aug 13, 2026
3 checks passed
@writingdeveloper
writingdeveloper deleted the fix/nanoid-advisory branch August 13, 2026 01:59
writingdeveloper added a commit that referenced this pull request Aug 19, 2026
A newly published high-severity advisory covers nanoid < 3.3.18, which
is a different one from the y-indexeddb advisory pinned in #26 and
arrives by a different path — postcss, not Keystatic.

No override this time. postcss already asks for ^3.3.16, so the patch
was always in range and only the lockfile was holding 3.3.17. The
three-line lockfile bump is the whole fix, and adding an override here
would have left a permanent pin behind for a problem npm can resolve on
its own.

npm audit reports 0 vulnerabilities; the audit-level=high CI gate exits
0 again.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LaydoxAZ4eaqqPNKrmWLbt
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