CVE-2026-49982
Description
tmp is a temporary file and directory creator for node.js. In version 0.2.6, the _assertPath guard added to tmp rejects only string values that contain the substring ... It is bypassed when prefix, postfix, or template is supplied as a non-string value (Array, Buffer, or any object) whose includes('..') returns falsy but whose stringification still contains ../. The value flows through Array.prototype.join/String coercion inside _generateTmpName and path.join(tmpDir, opts.dir, name), producing a final path that escapes tmpdir and creates a file or directory at an attacker-controlled location with the host process's privileges. This affects any application that forwards untrusted request data (a common pattern is JSON body fields or qs-parsed bracket-array query strings such as ?prefix[]=...) into tmp.file, tmp.fileSync, tmp.dir, tmp.dirSync, tmp.tmpName, or tmp.tmpNameSync without explicit type coercion. This vulnerability is fixed in 0.2.7.
Weakness
- CWE-20: Improper Input Validation
- CWE-22: Improper Limitation of a Pathname to a Restricted Directory
CISA SSVC decision points
| Exploitation | poc |
|---|---|
| Automatable | yes |
| Technical impact | partial |
| Scored | 2026-06-11 |
Timeline
- 2026-06-11Published by the CNA15:45 UTC
- 2026-06-11CISA SSVC decision recordedsame day
- 2026-06-15GitHub advisory published (GHSA-7c78-jf6q-g5cm)4 days after publication
Exploit and advisory records
GitHub advisory GHSA-7c78-jf6q-g5cm, affected packages:
| Package | Vulnerable versions | Fixed in |
|---|---|---|
| npm tmp | from 0.2.6 before 0.2.7 | 0.2.7 |
Affected products
Products listed as vulnerable. Upgrade to the version under "Fixed in", or a later one.
| Product | Vulnerable versions | Fixed in |
|---|---|---|
| raszi tmp | 0.2.6no fix listed | not listed |
References
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cve_lookup/CVE-2026-49982'curl 'https://api.contrastcyber.com/cve_risk_score/CVE-2026-49982'curl 'https://api.contrastcyber.com/cve_exploit/CVE-2026-49982'curl 'https://api.contrastcyber.com/cve_products/CVE-2026-49982'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- OWASP Top 10 categories by the OWASP Foundation (CC BY 3.0).
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).