file-type affected by infinite loop in ASF parser on malformed input with zero-size sub-header
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · Low
- Fix status
- Partial Red Hat: 9 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-835.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| sindresorhus | file-type | 13.0.0 to before 21.3.1 | 21.3.1 | Patch available | CNA |
| — | file-type (npm) | 13.0.0 to before 21.3.1 | 21.3.1 | Patch available | GHSA-5v7r-6r5c-r473 |
- file-type Vendorsindresorhus Affected 13.0.0 to before 21.3.1 Fixed in 21.3.1 Patch available CNA
- file-type (npm) Vendor— Affected 13.0.0 to before 21.3.1 Fixed in 21.3.1 Patch available GHSA-5v7r-6r5c-r473
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:sindresorhus:file-type:*:*:*:*:*:node.js:*:* | 13.0.0 to before 21.3.1 | Vulnerable | sindresorhus |
- cpe:2.3:a:sindresorhus:file-type:*:*:*:*:*:node.js:*:* Versions 13.0.0 to before 21.3.1 Vulnerable ·sindresorhus
Remediation
- Fix · CNA file-type (sindresorhus) Fixed in 21.3.1
- Fix · GHSA-5v7r-6r5c-r473 file-type (npm) Fixed in 21.3.1 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Cryostat 4 | Affected | No fix yet: Fix deferred |
| Logging Subsystem for Red Hat OpenShift | Affected | No fix yet: Fix deferred |
| Red Hat Data Grid 8 | Affected | No fix yet: Fix deferred |
| Red Hat Developer Hub 1 | Affected | No fix yet: Fix deferred |
| Red Hat Enterprise Linux AI (RHEL AI) 3 | Affected | No fix yet: Fix deferred |
| Red Hat OpenShift Dev Spaces | Affected | No fix yet: Fix deferred |
| Red Hat Satellite 6 | Affected | No fix yet: Fix deferred |
| Red Hat build of Apicurio Registry 2 | Affected | No fix yet: Fix deferred |
| Self-service automation portal 2 | Affected | No fix yet: Fix deferred |
Timeline
- 2026-10-02 Threatist record created from CVE-2026-31808
- 2026-10-03 Alias added: GHSA-5v7r-6r5c-r473
- 2026-10-27 Affected versions changed · Red Hat
References
More sindresorhus File-type vulnerabilities
- TI-2026-25139 file-type affected by ZIP Decompression Bomb DoS via [Content_Types].xml entry CVSS 3.1MEDIUM 5.3
- TI-2022-16660 An issue was discovered in the file-type package before 16.5.4 and 17.x before 17.1.3 for… CVSS 3.1MEDIUM 5.5
Sources
- CVE-2026-31808 · CVE Program
- CVE-2026-31808 · NVD
- FIRST EPSS
- GHSA-5v7r-6r5c-r473 · GitHub Advisory Database · CC BY 4.0
- CVE-2026-31808 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences