Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. file-type
  4. ›
  5. CVE-2026-31808

CVE-2026-31808: file-type affected by infinite loop in ASF parser on malformed input with zero-size sub-header

March 10, 2026

A denial of service vulnerability exists in the ASF (WMV/WMA) file type detection parser. When parsing a crafted input where an ASF sub-header has a size field of zero, the parser enters an infinite loop. The payload value becomes negative (-24), causing tokenizer.ignore(payload) to move the read position backwards, so the same sub-header is read repeatedly forever.

Any application that uses file-type to detect the type of untrusted/attacker-controlled input is affected. An attacker can stall the Node.js event loop with a 55-byte payload.

References

  • github.com/advisories/GHSA-5v7r-6r5c-r473
  • github.com/sindresorhus/file-type
  • github.com/sindresorhus/file-type/commit/319abf871b50ba2fa221b4a7050059f1ae096f4f
  • github.com/sindresorhus/file-type/security/advisories/GHSA-5v7r-6r5c-r473
  • nvd.nist.gov/vuln/detail/CVE-2026-31808

Code Behaviors & Features

Detect and mitigate CVE-2026-31808 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions starting from 13.0.0 before 21.3.1

Fixed versions

  • 21.3.1

Solution

Upgrade to version 21.3.1 or above.

Impact 5.3 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Learn more about CVSS

Weakness

  • CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')

Source file

npm/file-type/CVE-2026-31808.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:16:21 +0000.