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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| raszi | node-tmp | 0.2.6 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | node-tmp | No fix yet | — |
| Ubuntu 26.04 LTS | node-tmp | No fix yet | — |
| Ubuntu 25.10 | node-tmp | No fix yet | — |
| Ubuntu 24.04 LTS | node-tmp | No fix yet | — |
| Ubuntu 22.04 LTS | node-tmp | No fix yet | — |
Show 3 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 20.04 LTS | node-tmp | No fix yet | — |
| Ubuntu 18.04 LTS | node-tmp | No fix yet | — |
| Ubuntu 16.04 LTS | node-tmp | No fix yet | — |
Wolfi
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Wolfi rolling | lerna | 9.0.7-r9 | — |
| Wolfi rolling | opensearch-dashboards-3-dashboards-reporting | 3.7.0-r0 | — |
| Wolfi rolling | prism | 5.15.11-r3 | — |
| Wolfi rolling | pulumi-language-nodejs | 3.246.0-r1 | — |
| Wolfi rolling | saf | 1.6.0-r1 | — |
| Wolfi rolling | vitess-24 | 24.0.1-r4 | — |
| Wolfi rolling | vitess-24-compat | 24.0.3-r7 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| npm | tmp | >= 0.2.6, < 0.2.7 | 0.2.7 | GHSA-7c78-jf6q-g5cm |