tmp: Type-confusion bypass of _assertPath in [email protected] allows path traversal via non-string prefix/postfix/template
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- None · High · Low
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| raszi | node-tmp | 0.2.6 | — | No fix listed | CNA |
| — | tmp (npm) | 0.2.6 to before 0.2.7 | 0.2.7 | Patch available | GHSA-7c78-jf6q-g5cm |
- node-tmp Vendorraszi Affected 0.2.6 Fixed in — No fix listed CNA
- tmp (npm) Vendor— Affected 0.2.6 to before 0.2.7 Fixed in 0.2.7 Patch available GHSA-7c78-jf6q-g5cm
Remediation
- Fix · GHSA-7c78-jf6q-g5cm tmp (npm) Fixed in 0.2.7 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-49982
- 2026-10-03 Alias added: GHSA-7c78-jf6q-g5cm
References
More raszi Tmp vulnerabilities
- TI-2026-32592 tmp: Path Traversal via unsanitized prefix/postfix enables directory escape CVSS 4.0HIGH 7.7
- TI-2025-34552 tmp does not restrict arbitrary temporary file / directory write via symbolic link `dir` parameter CVSS 3.1MEDIUM 5.3
Sources
- CVE-2026-49982 · CVE Program
- CVE-2026-49982 · NVD
- FIRST EPSS
- GHSA-7c78-jf6q-g5cm · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences