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

Published Mar 10, 2026
·
Updated

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

crnkovic@lokvica.com

Other sources

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.

MITRE

Affected Software

4 affected componentsFixes available
npm/file-type<21.3.1
npm/file-type>=13.0.0<21.3.1
21.3.1
sindresorhus File-type Node.js>=13.0.0<21.3.1
IBM watsonx.data<=2.2- 2.3.1

Event History

Mar 10, 2026
CVE Published
via MITRE·09:01 PM
Data Sourced
via MITRE·09:01 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:16 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:16 PM
RemedyAffected Software
Advisory Published
via GitHub·11:57 PM
Data Sourced
via GitHub·11:57 PM
DescriptionSeverityWeaknessAffected Software
May 9, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-31808?

CVE-2026-31808 has a severity rating of medium due to its potential to cause denial of service.

2

How do I fix CVE-2026-31808?

To fix CVE-2026-31808, upgrade the file-type package to version 21.3.1 or later.

3

What systems are affected by CVE-2026-31808?

CVE-2026-31808 affects versions of the file-type package prior to 21.3.1.

4

What type of vulnerability is CVE-2026-31808?

CVE-2026-31808 is a denial of service vulnerability caused by an infinite loop in the ASF parser.

5

What can happen if CVE-2026-31808 is exploited?

If exploited, CVE-2026-31808 can lead to an infinite loop that results in denial of service for applications using the affected file-type parser.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203