Skip to content

fix(deps): bump nanoid past the indefinite-loop advisory - #3466

Merged
kwakayama merged 2 commits into
mainfrom
fix/storybook-nanoid-advisory
Aug 8, 2026
Merged

fix(deps): bump nanoid past the indefinite-loop advisory#3466
kwakayama merged 2 commits into
mainfrom
fix/storybook-nanoid-advisory

Conversation

@kojiwakayama

Copy link
Copy Markdown
Contributor

Security Audit is failing on main. Not caused by any of today's changes — it fails on push.

The Deno dependency scan is clean (✅ No vulnerabilities found, 77 deps). The failure is the second half of the task, npm --prefix storybook audit:

nanoid  <3.3.17   Severity: high
nanoid: custom generators can loop indefinitely when size is zero
GHSA-2v37-7h3g-55p8

Change

nanoid is transitive, so this is npm update nanoid --package-lock-only rather than a manifest change. 3.3.16 → 3.3.18.

npm also drops the hoisted top-level @emnapi/core and @emnapi/runtime entries. I checked this rather than assuming it was collateral from audit fix: npm update nanoid alone produces the identical removal, so the committed lockfile was carrying stale hoists.

Their only dependents — @tailwindcss/oxide-wasm32-wasi and @napi-rs/wasm-runtime — are optional: true, dev: true platform packages for wasm32-wasi, and the reachable copies live nested under @oxc-parser and @oxc-resolver. npm ls @emnapi/core exits 0 and resolves cleanly.

Verification

deno task audit — the exact task CI runs — exits 0, with both scanners reporting no vulnerabilities.

Security Audit fails on main. The Deno dependency scan is clean; the failure is
`npm --prefix storybook audit`, which reports nanoid 3.3.16 against
GHSA-2v37-7h3g-55p8 (high): custom generators can loop indefinitely when size
is zero.

nanoid is transitive, so this is `npm update nanoid --package-lock-only`
rather than a manifest change. 3.3.16 to 3.3.18.

npm also drops the hoisted top-level @emnapi/core and @emnapi/runtime entries.
That is correct rather than collateral: `npm update nanoid` alone produces the
same removal, so the committed lockfile was carrying stale hoists. Their only
dependents -- @tailwindcss/oxide-wasm32-wasi and @napi-rs/wasm-runtime -- are
optional dev platform packages for wasm32-wasi, and the copies that are
actually reachable live nested under @oxc-parser and @oxc-resolver. `npm ls
@emnapi/core` resolves cleanly.

Verified: `deno task audit`, the exact task CI runs, exits 0 and reports no
vulnerabilities from either scanner.
@kojiwakayama
kojiwakayama requested a review from kwakayama as a code owner August 8, 2026 07:50
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • storybook/package-lock.json is excluded by !**/package-lock.json

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3b445570-7ce6-4639-acfb-74f4c391ab53

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@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: 7e1295724f

ℹ️ 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 storybook/package-lock.json
The previous commit used `npm update nanoid --package-lock-only`, which
recomputed the whole tree and dropped the hoisted top-level @emnapi/core and
@emnapi/runtime records. `npm ci` -- what the npm-install-smoke job actually
runs -- then fails with EUSAGE, reporting both as missing from the lock file,
before any smoke check executes.

I had checked that removal with `npm ls @emnapi/core`, which exits 0 because it
only resolves what is reachable. `npm ci` additionally requires the lockfile to
satisfy every declared dependency, including peers of optional platform
packages, so it was the wrong instrument for the question.

nanoid is transitive under postcss, whose range is ^3.3.16, so 3.3.18 satisfies
it without any structural change. This edits that single entry's version,
resolved URL and integrity, leaving the tree exactly as main has it.

Verified against main as a control on the same toolchain: `npm --prefix
storybook ci --ignore-scripts` exits 0 on main, exited 1 with the regenerated
lockfile, and exits 0 again here, installing nanoid 3.3.18. `deno task audit`
reports no vulnerabilities from either scanner.
@kwakayama
kwakayama enabled auto-merge August 8, 2026 08:50
@kwakayama
kwakayama added this pull request to the merge queue Aug 8, 2026
Merged via the queue into main with commit c2b3958 Aug 8, 2026
33 checks passed
@kwakayama
kwakayama deleted the fix/storybook-nanoid-advisory branch August 8, 2026 09:05
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