🛡️ CVE-2026-31808 — file-type

🟡 CVSS 5.3 — Medium ✅ No Known Exploit CWE-835 OSV
5.3
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

file-type affected by infinite loop in ASF parser on malformed input with zero-size sub-header

Impact

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.

Patches

Fixed in version 21.3.1. Users should upgrade to >= 21.3.1.

Workarounds

Validate or limit the size of input buffers before passing them to file-type, or run file type detection in a worker thread with a timeout.

References

  • Fix commit: 319abf871b50ba2fa221b4a7050059f1ae096f4f

Reporter

[email protected]

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality none, integrity none, availability low.

Weakness class

CVE-2026-31808 is classified as CWE-835: Infinite Loop. A loop condition can never become false for some inputs, hanging the process.

Affected software

CVE-2026-31808 is recorded against 1 package.

  • file-type

Timeline and source

Published on 10 March 2026 and last revised on 17 June 2026. No public exploit is currently recorded for this entry. A vendor advisory or fix has been published. Record sourced from OSV.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Web)
github.com (Package)

CVE-2026-31808 on other distributions

Each distribution ships its own build and its own fixed version. Pick the one you run:

Details

Severity MEDIUM
CVSS Score 5.3
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
CWE CWE-835
Public Exploit ✅ No
Source OSV
Published 2026-03-10
Updated 2026-08-12
Modified 2026-06-17

Affected Packages

Software From version Fixed in
file-type

Vulnerability Monitoring

Track new vulnerabilities in file-type

CVE-2026-31808 is rated CVSS 5.3 Medium. BotEraser monitors your WordPress installation and notifies you when software you use appears in our vulnerability database.

Set Up Free Alerts →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.