TROYANOSYVIRUS
Back to CVEs

CVE-2026-31808

MEDIUM
5.3

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.

CVE Details

CVSS v3.1 Score5.3
SeverityMEDIUM
CVSS VectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Attack VectorNETWORK
ComplexityLOW
Privileges RequiredNONE
User InteractionNONE
Published3/10/2026
Last Modified3/18/2026
Sourcenvd
Honeypot Sightings0

Affected Products

sindresorhus:file-type

Weaknesses (CWE)

CWE-835

IOC Correlations

No correlations recorded

This product uses data from the NVD API but is not endorsed or certified by the NVD.