Skip to content
OpenAdvisories
High · 8.2 CVE-2026-49982 EUVD-2026-36265GHSA-7c78-jf6q-g5cm

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

Published Jun 11, 2026 · Updated Jun 11, 2026 · Assigned by GitHub_M

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

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

ReleasePackageFixed inAdvisory
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)
ReleasePackageFixed inAdvisory
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

ReleasePackageFixed inAdvisory
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

EcosystemPackageAffectedFixedRecord
npm tmp >= 0.2.6, < 0.2.7 0.2.7 GHSA-7c78-jf6q-g5cm

References