Tóm tắt nhanh
- CVE-2026-31808 là lỗ hổng mức TRUNG BÌNH (CVSS 5.3) ảnh hưởng file-type (sindresorhus), file-type.
- Xác suất bị khai thác trong 30 ngày tới (EPSS): 0.37%, cao hơn 30.9% các lỗ hổng khác.
- Cách xử lý: cập nhật lên 21.3.1 hoặc mới hơn.
| Gói / sản phẩm | Phiên bản bị ảnh hưởng | Phiên bản đã vá |
|---|
| file-type | ≥ 13.0.0, < 21.3.1
| 21.3.1
|
| file-type npm | ≥ 13.0.0, < 21.3.1
| 21.3.1
|
Mô tả
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]
Mô tả của NVD
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.
Bạn đang dùng một trong các sản phẩm này? Quét site để biết có đang lộ phiên bản có lỗ hổng không.
Quét site miễn phí