# CVE-2026-31808: file-type affected by infinite loop in ASF parser on malformed input with zero-size sub-header

- Severity: Medium 5.3 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.37%, higher than 32% of CVEs (2026-12-01)
- Published: 2026-03-10T21:01:55.466Z
- Modified: 2026-09-10T03:50:37.674Z
- Also known as: GHSA-5v7r-6r5c-r473
- Weaknesses: CWE-835
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: 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.

(As written by CVE List.)

## Affected

- sindresorhus file-type: >= 13.0.0, < 21.3.1; from 13.0.0 before 21.3.1
- file-type (npm): from 13.0.0 before 21.3.1

## Every score

- GitHub_M: CVSS:3.1 5.3 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- GitHub: CVSS:3.1 5.3 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`

## References

- <https://github.com/sindresorhus/file-type/security/advisories/GHSA-5v7r-6r5c-r473> (mitigation, patch, vendor-advisory, web)
- <https://github.com/sindresorhus/file-type/commit/319abf871b50ba2fa221b4a7050059f1ae096f4f> (patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-31808> (advisory)
- <https://github.com/sindresorhus/file-type> (package)

## Sources

- CVE List: [CVE-2026-31808](https://www.cve.org/CVERecord?id=CVE-2026-31808), CVE Terms of Use, modified 2026-03-11
- GitHub Advisory Database: [GHSA-5v7r-6r5c-r473](https://github.com/advisories/GHSA-5v7r-6r5c-r473), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-31808](https://nvd.nist.gov/vuln/detail/CVE-2026-31808), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2026-31808 · Whole record: https://cve.day/CVE-2026-31808.json · Rebuilt by cve.day 2026-11-25T22:59:15.668Z
