GHSA-5v7r-6r5c-r473 · Severity: medium · Ecosystem: npm — file-type affected by infinite loop in ASF parser on malformed input with zero-size sub-header
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.
Conclusion & alert: CVE-2026-31808 is rated Low Risk (29.9/100): CVSS Medium severity, with low exploitation likelihood (EPSS 0.33%). Mandatory action: Monitor for updates and reassess as exploit intelligence or EPSS changes.
Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.
EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).
| # | Date | Old EPSS score | New EPSS score | Delta (New - Old) |
|---|---|---|---|---|
| 1 | 2026-06-15 | 0.03% | 0.33% | +0.30% |
| 2 | 2026-03-21 | 0.06% | 0.03% | -0.03% |
| 3 | 2026-03-16 | — | 0.06% | — |
Full EPSS history (4 records total)
CVSS metrics for this CVE.
| Base score | Version | Severity | Vector | Exploitability | Impact | Score source |
|---|---|---|---|---|---|---|
| 5.3 | 3.1 | MEDIUM |
|
3.9 | 1.4 | [email protected] |
GHSA-5v7r-6r5c-r473 · Severity: medium · Ecosystem: npm — file-type affected by infinite loop in ASF parser on malformed input with zero-size sub-header
| vendor | priority | summary | link |
|---|---|---|---|
redhat
|
medium | — | https://access.redhat.com/security/cve/CVE-2026-31808 |
| Vendor | Product | Version | Raw CPE |
|---|---|---|---|
| sindresorhus | file-type | >= 13.0.0, < 21.3.1 | cpe:2.3:a:sindresorhus:file-type:*:*:*:*:*:node.js:*:* |
| URL | Tags |
|---|---|
| https://github.com/sindresorhus/file-type/commit/319abf871b50ba2fa221b4a7050059f1ae096f4f | Patch |
| https://github.com/sindresorhus/file-type/security/advisories/GHSA-5v7r-6r5c-r473 | Mitigation Patch Vendor Advisory |