# CVE-2026-67214: nanoid Infinite Loop via Negative Size in non-secure module

> An attacker can cause a denial of service by passing a negative size to nanoid's non-secure module, triggering an infinite loop.

- **Severity:** High 8.2 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 29 Jul 2026
- **Updated:** 29 Oct 2026
- **Also known as:** CLEANSTART-2026-DG52201, CLEANSTART-2026-EO79562, CLEANSTART-2026-WC95670, CLSA-2026-1790622758, CLSA-2026-1790622992, CLSA-2026-1790673732, CLSA-2026-1791626479, CLSA-2026-1792232027, DEBIAN-CVE-2026-67214, ECHO-a5ce-1e92-8d02, GHSA-28wg-ghj8-5hjv, MINI-3jmg-cr7m-h63f, MINI-4xgr-fqp8-f345, MINI-5966-f9h6-838p, MINI-7q77-93j3-w8q2, MINI-7x3w-fg39-mq6q, MINI-c347-f6w8-gwqc, MINI-c424-8524-795h, MINI-c58j-8mx3-c5pm, MINI-h7hq-x4vq-pcq6, MINI-hm2q-mf97-xj6r, MINI-jf77-w6hq-582g, MINI-jf8g-pvhh-mc6w, MINI-jfvc-m564-c2x5, MINI-mpq4-w9qj-37h2, MINI-mvmh-6623-7f7m, MINI-qp7p-fcgv-qqgv, MINI-r4g9-7p82-6vmh, MINI-r98q-rc65-gh93, MINI-rj72-gw83-x6xh, MINI-w4jj-q2p3-ggx8, MINI-x32j-j6jq-4m4c, RHSA-2026:48320, ROOT-APP-NPM-CVE-2026-67214, UBUNTU-CVE-2026-67214

## What is CVE-2026-67214?

CVE-2026-67214 is a high-severity denial of service vulnerability in nanoid_project nanoid, published on 29 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

nanoid (Nano ID) before 3.3.16 and 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.

Weakness: CWE-835 (Loop with Unreachable Exit Condition)

## Which versions are affected by CVE-2026-67214?

4 open source packages ship an affected version, including nanoid. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `nanoid` | npm | All versions | 3.3.16 |
| `nanoid` | npm | All versions | 3.3.16 |
| `nanoid` | npm | From 4.0.0 | 5.1.16 |
| `nanoid` | npm | From 4.0.0 | 5.1.16 |
| `jaeger` | Red Hat:hummingbird:1 | All versions | 0:2.20.0-0.7.hum1 |

Products: Nanoid Project Nanoid.

## How do I fix CVE-2026-67214?

Upgrade nanoid to a fixed version for your release line: 3.3.16 or 5.1.16.

## Is CVE-2026-67214 being exploited?

There is no known exploitation of CVE-2026-67214 in the wild and no public exploit code.

## Other vulnerabilities in nanoid_project nanoid

- [CVE-2026-67213](https://insights.sbomify.com/CVE-2026-67213/): nanoid before 5.1.6 Infinite Loop via Zero Size in customAlphabet and customRandom (high 8.2)
- [CVE-2021-23566](https://insights.sbomify.com/CVE-2021-23566/): Information Exposure (medium 4.0)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-67214 and fix it if it is affected.

What it is: CVE-2026-67214 is a high-severity denial of service vulnerability in nanoid_project nanoid, published on 29 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-67214 in the wild and no public exploit code.

Affected packages and fixed versions:
- nanoid (npm): affected all versions; fixed in 3.3.16
- nanoid (npm): affected all versions; fixed in 3.3.16
- nanoid (npm): affected from 4.0.0; fixed in 5.1.16
- nanoid (npm): affected from 4.0.0; fixed in 5.1.16

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-67214/ (Markdown: https://insights.sbomify.com/CVE-2026-67214/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-67214
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-67214
- OSV: https://osv.dev/vulnerability/CVE-2026-67214

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-67214/
Summaries are generated and may contain mistakes; the official description above is the record.
