{"answers":{"affected":"2 open source packages ship an affected version, including file-type. It affects 1 product.","exploited":"There is no known exploitation of CVE-2026-31808 in the wild and no public exploit code.","fix":"Upgrade file-type to 21.3.1 or later.","what":"CVE-2026-31808 is a medium-severity denial of service vulnerability in sindresorhus file-type, published on 10 Mar 2026. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2026-31808 and fix it if it is affected.\n\nWhat it is: CVE-2026-31808 is a medium-severity denial of service vulnerability in sindresorhus file-type, published on 10 Mar 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2026-31808 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- file-type (npm): affected from 13.0.0; fixed in 21.3.1\n- file-type (npm): affected from 13.0.0; fixed in 21.3.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-31808/ (Markdown: https://insights.sbomify.com/CVE-2026-31808/index.md)","id":"CVE-2026-31808","markdown":"https://insights.sbomify.com/CVE-2026-31808/index.md","name":"CVE-2026-31808","record":{"aliases":["CLSA-2026-1781744121","CLSA-2026-1791199964","GHSA-5v7r-6r5c-r473","MINI-48vg-6499-v62v","MINI-5p46-x4hr-j3g4","MINI-8pwr-phwr-rfgv","MINI-9799-cv2f-qq3v","MINI-9p47-q9v8-prh4","MINI-c963-hr2w-hmcm","MINI-gmc5-968c-j3q5","MINI-r4q3-fhj5-fxxf","MINI-rrrr-gvc8-f2c7","MINI-wmfc-hjhg-w668","ROOT-APP-NPM-CVE-2026-31808"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"Node.js file type library","requires_auth":"none","summary":"An attacker can cause a denial of service by providing a malformed ASF file that triggers an infinite loop in the file-type library.","user_interaction":"not_required","vuln_class":"denial_of_service"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"file-type","vendor":"sindresorhus"}],"cvss":{"score":5.3,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","version":"3.1"},"cwes":[{"id":"CWE-835","name":"Loop with Unreachable Exit Condition"}],"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.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"file-type affected by infinite loop in ASF parser on malformed input with zero-size sub-header","id":"CVE-2026-31808","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"denial_of_service","year":"2026"},"n_packages":2,"n_references":2,"next":{"headline":"SiYuan has a SVG Sanitizer Bypass via Whitespace in `javascript:` URI — Unauthenticated XSS","id":"CVE-2026-31809"},"packages":[{"ecosystem":"npm","fixed":["21.3.1"],"introduced":["13.0.0"],"last_affected":[],"package":"file-type","purl":null,"source":"GHSA-5v7r-6r5c-r473"},{"ecosystem":"npm","fixed":["21.3.1"],"introduced":["13.0.0"],"last_affected":[],"package":"file-type","purl":"pkg:npm/file-type","source":"GHSA-5v7r-6r5c-r473"}],"prev":{"headline":"SiYuan has a SVG Sanitizer Bypass via `\u003canimate\u003e` Element — Unauthenticated XSS","id":"CVE-2026-31807"},"products":["file-type"],"published":"2026-03-10","related":[{"cvss_score":5.5,"headline":"file-type vulnerable to Infinite Loop via malformed MKV file","id":"CVE-2022-36313","kev_date_added":null,"published":"2022-07-21"},{"cvss_score":5.3,"headline":"file-type affected by ZIP Decompression Bomb DoS via [Content_Types].xml entry","id":"CVE-2026-32630","kev_date_added":null,"published":"2026-03-13"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2026-03-11","vendors":["sindresorhus"]},"summary":"An attacker can cause a denial of service by providing a malformed ASF file that triggers an infinite loop in the file-type library.","url":"https://insights.sbomify.com/CVE-2026-31808/"}