CVE-2026-31808: sindresorhus file-type Infinite Loop
Vulnerability summary
CVE-2026-31808 is a medium (CVSS 5.3) Infinite Loop vulnerability in sindresorhus file-type. EPSS estimates a 0.43% chance of exploitation in the next 30 days, higher than 36.6% of scored vulnerabilities.
Advisory lineage
Upstream 0 · Downstream 0 · Related 1Timeline
- 10-03-2026PublishedVulnerability first disclosed.
- 11-03-2026Last modifiedVulnerability information updated.
Description
file-type detects the file type of a file, stream, or data. Prior to 21.3.1, 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. Fixed in version 21.3.1.
CVSS metrics
4 scores · 4 sources · 1 version- OSV · NpmEcosystem advisory · calculated5.3MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- OSV · ChainguardEcosystem advisory · calculated5.3MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- NVDNIST5.3MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
EPSS trend
Probability
0.43%
Chance of exploitation in the next 30 days
Percentile
37%
Versus all other CVEs
30-day change
+0.11 pp
From 0.33% on 21-09-2026
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root causeAffected systems
Chainguard3 products
- foxx-cliAll versions (No fix recorded)
- librechat< 0.8.4-r3
- redisinsight< 3.2.0-r2
Npm1 product
- file-type≥ 13.0.0, < 21.3.1
Sindresorhus1 product
- file-type≥ 13.0.0, < 21.3.1
3 vendors · 5 products
References
5 links- github.com/sindresorhus/file-type/security/advisories/GHSA-5v7r-6r5c-r473X Refsource CONFIRMWEBAdvisoryMitigationPatchVendor Advisory
- github.com/sindresorhus/file-type/commit/319abf871b50ba2fa221b4a7050059f1ae096f4fX Refsource MISCWEBFIXPatch