chore(deps): update dependency nanoid to v5.1.16 [security] - #133
Conversation
41fe2e8 to
42dd066
Compare
42dd066 to
23970a4
Compare
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
This PR contains the following updates:
5.1.11→5.1.16Predictable results in nanoid generation when given non-integer values
CVE-2024-55565 / GHSA-mwcw-c2x4-8c55
More information
Details
When nanoid is called with a fractional value, there were a number of undesirable effects:
Version 3.3.8 and 5.0.9 are fixed.
Severity
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
nanoid: custom generators can loop indefinitely when size is zero
CVE-2026-67213 / GHSA-2v37-7h3g-55p8
More information
Details
nanoid (Nano ID) before 5.1.6 contains an infinite loop in the customAlphabet and customRandom functions. When these functions are configured with a size of 0, the internal generation loop never satisfies its exit condition and spins indefinitely, hanging the calling thread. An application that passes an unvalidated, attacker-controlled size of 0 to these functions is exposed to a denial-of-service condition.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
nanoid: non-secure generators can loop indefinitely with negative size
CVE-2026-67214 / GHSA-28wg-ghj8-5hjv
More information
Details
nanoid (Nano ID) before 5.1.16 contains an infinite loop in the customAlphabet and nanoid functions of its non-secure module (nanoid/non-secure). When these functions are given a negative size, the loop counter is decremented from a negative value and never reaches its termination condition, spinning indefinitely and hanging the calling thread. An application that passes an unvalidated, attacker-controlled negative size to these functions is exposed to a denial-of-service condition.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
nanoid: Integer Overflow or Wraparound
CVE-2026-73086 / GHSA-xwg4-73v4-xw9w
More information
Details
Summary
An integer overflow in
nanoid(size)permanently corrupts the process-wide CSPRNG pool, causing all subsequent ID generation to return the deterministic string"uuuuuuuuuuuuuuuuuuuuu". Any application that passes user-influenced values to thesizeparameter loses all randomness guarantees for session tokens, CSRF tokens, and unique identifiers until process restart.Details
nanoid()atindex.js:101coerces thesizeparameter withsize |= 0, which converts it to a signed 32-bit integer. Whensize >= 2^31(e.g.,2147483648), this wraps to-2147483648.The negative value is passed to
fillPool()(index.js:15):Neither branch triggers, so the pool is never refreshed.
poolOffsetbecomes ~-2.1 billion.Subsequent
nanoid()calls execute:pool[negative_index]returnsundefined.undefined & 63evaluates to0.urlAlphabet[0]is'u'. Every ID becomes"uuuuuuuuuuuuuuuuuuuuu".The corruption is persistent — it affects all subsequent calls in the process until ~100 million calls eventually wrap
poolOffsetback to positive, or the process restarts.PoC
Run with:
node --experimental-vm-modules poc.mjsAttack scenario: Any API endpoint that accepts a user-controlled length/size parameter (URL shortener slug length, configurable token size, etc.) and passes it to
nanoid(userInput).Impact
Complete loss of ID unpredictability and uniqueness, process-wide, from a single request.
nanoidin the same processsizeparameter without validationSeverity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
ai/nanoid (nanoid)
v5.1.16Compare Source
v5.1.15Compare Source
v5.1.14Compare Source
v5.1.13Compare Source
v5.1.12Compare Source
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.
Compatibility and validation
The Draw server uses the secure Nano ID ESM export with a fixed six-character suffix. Upstream 5.1.11→5.1.16 fixes random-pool error recovery and a non-secure negative-size loop; the existing session-ID contract remains compatible. The manifest now requires at least 5.1.16 as well as the lockfile upgrade.
Added offline session-ID/storage tests and Node 20/22/24 server/test/UI-build CI, preserving Bats and Shellcheck and including Draw in the required aggregate. Validation also exposed an existing UI
npm cifailure on Node 20/npm 10: extraneous Android watcher entries causedEBADPLATFORM. This reproduces on unchanged main. Normal lockfile regeneration prunes 19 entries already marked extraneous; every retained package record, version, integrity and platform constraint is unchanged.Validation passed on Node 20.20.2, 22.23.2 and 24.21.0: reproducible server/UI installs, TypeScript/Vite builds, both session tests, and actual Draw CLI start/serve/save/list/delete smoke with a local fixture, disabled tunnel, and mocked browser. All 39 Bats tests and CI-equivalent Shellcheck also pass. Existing unrelated transitive audit findings remain in engine.io, socket.io-adapter, socket.io-parser and ws; no audit/security gate was removed.