CVE-2026-31808
published medium CVSS 3.1 · 5.3file-type affected by infinite loop in ASF parser on malformed input with zero-size sub-header
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| sindresorhus | — | file-type>= 13.0.0, < 21.3.1 | Affected | Not stated | GitHub_M |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 5.3 / 10
- Severity
- medium
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| sindresorhus | file-type | >= 13.0.0, < 21.3.1 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-835 CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')
References
2Provider assertions
2GitHub_M · cna
file-type affected by infinite loop in ASF parser on malformed input with zero-size sub-header
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- f036bc364b606d4247e8cabc8012905a58ad8c15c94060cfcc4cc964c34eede2
- Ingested
- 23 Sep 2026, 09:09:43 UTC
- Source record
- Official CVE record