The vulnerability, CVE-2026-73086, is an integer overflow or wraparound issue in the nanoid library. The core problem lies in how the size parameter, provided by the user to the nanoid(size) function, is handled. When a specific large integer (2147483648) is passed, JavaScript's internal number coercion to a 32-bit signed integer causes this value to wrap around and become negative (-2147483648). This negatively coerced value is then passed to the internal fillPool function, which is responsible for replenishing the cryptographically secure pseudorandom number generator (CSPRNG) pool. In the vulnerable versions, the fillPool function only checked for bytes < 0 and clamped it to 0, but it did not have an upper bound check. This allowed the effectively negative bytes value to corrupt the poolOffset and the pool itself, leading to subsequent calls to nanoid producing deterministic, non-random strings ('uuuuuuuuuuuuuuuuuuuuu').
The analysis of the provided commit information confirms this. Commit 7087969281cab8ba8ae3babf1894e819068b3bb4 for index.js and its test file, along with backport commits 821dfed7b5db7f88e92f56c60eef32c8135077c3 for index.js and b0036ed60dc9facd7f1191a50dfb3076500202ac for index.cjs, all show the same fix: adding || bytes > 1024 to the if condition within the fillPool function. This new check prevents both negative values (from overflow) and excessively large positive values from being processed, thus mitigating the integer overflow and potential resource exhaustion.
Therefore, the nanoid function is identified as vulnerable because it's the public API that accepts the user-controlled input (size) which triggers the integer overflow. The fillPool function is identified as vulnerable because it contains the flawed logic (lack of proper bounds checking for bytes) that directly leads to the corruption of the CSPRNG pool. Both functions, in both index.js (ES module) and index.cjs (CommonJS module) files, are critical to the exploitation chain and would appear in a runtime profiler.