CVE-2026-49982
High · 8.2CVSS
8.2
EPSS
0.6%
Published
Jun 11, 2026
CISA due date
—
Cloudanix analysis
A Node.js helper for creating temporary files can be tricked into creating files outside the temp folder when an app passes raw user input into it, so those apps should update the helper and stop feeding untrusted request data into it.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Data Tampering
- Component
- Library
- Class
- Path Traversal
- Remediation
- Upgrade
- Effort
- Low
- Patch risk
- None
What it actually does
In raszi tmp 0.2.6, _assertPath only rejects string values containing '..'. Non-string prefix, postfix, or template values (arrays, buffers, or objects) skip that guard; after join/coercion in _generateTmpName and path.join(tmpDir, opts.dir, name), the final path can escape the configured temporary directory. The process then creates a file or directory at that location with the Node.js host privileges. Confidentiality is not directly affected; integrity impact is high (create/overwrite on any path the process can write) and availability impact is low.
Why it matters to the business
Apps that pass request bodies or query fields into tmp can have files or directories created outside the temp folder, which may overwrite data, plant files in writable locations, or disrupt operations. The issue is not in CISA KEV, is not tied to ransomware, and has no public exploit maturity; EPSS is low at 0.006 (up about 21% over 30 days), so widespread exploitation is not indicated. Residual risk remains material for internet-facing Node.js services because no authentication or user interaction is required and integrity impact is high. Unpatched 0.2.6 deployments 111 days after publication should be treated as overdue for a dependency upgrade.
How an attack unfolds
An unauthenticated attacker who can influence options passed into tmp.file, tmp.fileSync, tmp.dir, tmp.dirSync, tmp.tmpName, or tmp.tmpNameSync sends prefix, postfix, or template as a non-string type (for example a JSON array/object or a bracket-array query field) instead of a plain string. The string-only '..' check does not run. Internal name generation stringifies or joins the value so parent-directory segments appear in the name; path.join then resolves a location outside tmpdir, and the library creates the file or directory there as the application user. No named threat actors or campaigns are associated with this CVE.
How to fix it
Upgrade raszi tmp from 0.2.6 to 0.2.7 or later, which fixes the _assertPath type handling. Refresh lockfiles (package-lock.json, yarn.lock, pnpm-lock.yaml) so no transitive pin remains on 0.2.6, then rebuild and redeploy. Until upgraded, do not pass request JSON or query data into tmp options; coerce prefix, postfix, template, and dir to strings and reject separator or parent-directory segments. Run the process with least privilege and a dedicated tmpdir so a path escape cannot write sensitive locations.
How to confirm the fix worked
Run npm ls tmp (or inspect lockfiles) and confirm every resolution is 0.2.7 or newer. Search code for tmp.file, tmp.fileSync, tmp.dir, tmp.dirSync, tmp.tmpName, and tmp.tmpNameSync where options come from bodies or query strings. After upgrade, confirm created paths stay under os.tmpdir() or the configured tmpdir and that non-string option types are rejected or coerced. Dependency scanners should report tmp 0.2.6 as vulnerable and clear after the bump.
Typical attack path
- Find a Node.js app that forwards untrusted request fields into raszi tmp APIs without coercing prefix, postfix, template, or dir to safe strings.
- Send those fields as non-string types so the string-only path guard is skipped.
- Cause generated names, after join/coercion, to include parent-directory segments.
- Invoke a tmp create or name API so path.join resolves outside the intended temporary directory.
- Obtain a file or directory on a writable path under the host process identity.
How to detect it
Review HTTP access logs and application logs around tmp.file/tmp.dir usage for query strings or JSON bodies that supply prefix, postfix, or template as arrays or objects rather than strings. On hosts running Node.js with tmp 0.2.6, look for file or directory creation outside the process tmpdir (os.tmpdir or TMPDIR) at times that correlate with those requests, including names that look like tmp output but contain parent-directory segments after join. Check audit or EDR file-create events for the node process writing unexpectedly outside temp. Package and container inventories showing tmp@0.2.6 indicate exposure, not proven compromise. No named actor tooling or ransomware artifacts are documented for this CVE.
- prefix[]=
- postfix[]=
- template[]=
- "prefix":[
- "postfix":[
- "template":[
- tmp@0.2.6
What your security team should do
- Upgrade all raszi tmp 0.2.6 resolutions to 0.2.7 or later and ship rebuilt artifacts.
- Inventory services that pass request-derived prefix, postfix, template, or dir into tmp APIs and add type and path validation.
- Hunt access logs and app logs for array-typed tmp option fields and for file creates outside the process tmpdir.
- Constrain the Node.js process user and filesystem write paths so a temp-path escape cannot modify application or system locations.
- Track EPSS and public exploit chatter; treat this as a standard high-integrity dependency fix, not an active KEV emergency.
The record
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.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| npm | tmp | 0.2.6 | 0.2.7 |
Related vulnerabilities
- GHSA-7c78-jf6q-g5cm tmp: Type-confusion bypass of _assertPath allows path traversal via non-string… Same vulnerability
- CVE-2026-44705 tmp is a temporary file and directory creator for node.js. Also affects tmp
- GHSA-ph9p-34f9-6g65 tmp has Path Traversal via unsanitized prefix/postfix that enables directory escape Also affects tmp
- CVE-2025-54798 tmp allows arbitrary temporary file / directory write via symbolic link `dir` parameter Also affects tmp
- CVE-2026-113786 pypdf is a free and open-source pure-python PDF library. CWE-20
- CVE-2026-112081 A vulnerability was determined in hankcs HanLP up to 2.1.0-beta.64. CWE-20
- CVE-2026-111869 A vulnerability was identified in makeplane plane up to 1.4.2. CWE-20
- CVE-2026-100347 kin-openapi is a Go project for handling OpenAPI files. CWE-20