{
  "affected": [
    {
      "ranges": [
        {
          "database_specific": {
            "extracted_events": [
              {
                "introduced": "3.0.0"
              },
              {
                "fixed": "3.3.17"
              },
              {
                "introduced": "5.0.0"
              },
              {
                "fixed": "5.1.6"
              }
            ],
            "source": "AFFECTED_FIELD"
          },
          "events": [
            {
              "introduced": "7b45b890ce9cba85c8dc08fdb7ad401b966ed067"
            },
            {
              "fixed": "73d67168136b36fd3b644159b0cff149da4905d9"
            },
            {
              "introduced": "cf151a7476c313ff68c53701c949c287043b9b82"
            },
            {
              "fixed": "c6532dba6f3954b683bd77c71b352c1ee0ed9961"
            }
          ],
          "repo": "https://github.com/ai/nanoid",
          "type": "GIT"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "VulnCheck",
    "cwe_ids": [
      "CWE-835"
    ],
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/67xxx/CVE-2026-67213.json"
  },
  "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.",
  "id": "CVE-2026-67213",
  "modified": "2026-08-12T03:51:24.013427144Z",
  "published": "2026-07-29T13:32:01.534Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/67xxx/CVE-2026-67213.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/ai/nanoid/releases/tag/5.1.6"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-67213"
    },
    {
      "type": "ADVISORY",
      "url": "https://www.vulncheck.com/advisories/nanoid-before-infinite-loop-via-zero-size-in-customalphabet-and-customrandom"
    },
    {
      "type": "FIX",
      "url": "https://github.com/ai/nanoid/commit/cb3626d0f3342fdf179cd425fd9c4fbb92c7d0e7"
    }
  ],
  "schema_version": "1.9.0",
  "severity": [
    {
      "score": "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",
      "type": "CVSS_V4"
    }
  ],
  "summary": "nanoid before 5.1.6 Infinite Loop via Zero Size in customAlphabet and customRandom"
}