CVE-2026-31808 json
file-type affected by infinite loop in ASF parser on malformed input with zero-size sub-header
published 2026-03-10 8 mo ago modified 2026-09-10 1 mo ago also EUVD-2026-10894 , GHSA-5v7r-6r5c-r473
- cvss
- 5.3
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.4%
- EPSS 0.4% chance of exploitation in 30 days, percentile 30%
- public exploits
- 0
- none known
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.
Patch / fix
- npm file-type 21.3.1
- file-type_project file-type 21.3.1
- sindresorhus file-type 21.3.1
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2026-31808 updated cvss 5.3
file-type: file-type: Denial of Service due to infinite loop in ASF file parsing
-
Red Hat Cryostat 4 io.cryostat-cryostat Red Hat Logging Subsystem for Red Hat OpenShift openshift-logging/kibana6-rhel8, openshift-logging/elasticsearch6-rhel9, openshift-logging/logging-curator5-rhel9, openshift-logging/elasticsearch-proxy-rhel9, openshift-logging/elasticsearch-rhel9-operator, openshift-logging/elasticsearch-operator-bundle Red Hat build of Apicurio Registry 2 io.apicurio-apicurio-registry Red Hat Data Grid 8 org.infinispan-infinispan-console Red Hat Developer Hub 1 rhdh/rhdh-hub-rhel9 Red Hat Enterprise Linux AI (RHEL AI) 3 rhelai3/bootc-cuda-rhel9, rhelai3/disk-image-cuda-rhel9affected: workaround, no fix available “Fix deferred”
+3 more productsfewer
Red Hat OpenShift Dev Spaces devspaces/code-rhel9, devspaces/code-sshd-rhel9 Red Hat Satellite 6 satellite/iop-host-inventory-frontend-rhel9 Red Hat Self-service automation portal 2 ansible-automation-platform/automation-portal
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- yes
- Technical impact
- partial
- Assessed
- 7 mo ago
Exploit prediction
0.37% chance of exploitation in the next 30 days, higher than 30% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 5.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| GitHub | 3.1 | 5.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| npm | file-type | >=13.0.0, <21.3.1 |
21.3.1 |
Affected products
- sindresorhus file-type
Classification
- Weakness
-
- CWE-835 Loop with Unreachable Exit Condition
References
-
github.com
/sindresorhus/file-type/commit/319abf871b50ba2fa221b4a7050059f1ae096f4f
web, patch
-
github.com
/sindresorhus/file-type/security/advisories/GHSA-5v7r-6r5c-r473
web, mitigation, patch, vendor-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2026-31808
advisory
-
github.com
/sindresorhus/file-type
package
Sources
- CVE List CVE-2026-31808
- GitHub Advisory GHSA-5v7r-6r5c-r473
- NVD CVE-2026-31808
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.
CPEs and fixed versions use Anchore's correction of NVD's data: Added CPE configurations because not yet analyzed by NVD.