{"id":"CVE-2026-53486","aliases":["CVE-2026-53486","GHSA-mp2f-45pm-3cg9"],"related":[],"kind":"vulnerability","state":"published","title":"decompress: Archive extraction can create files and links outside the target directory","summary":"The decompress package for Node.js extracts archives. Prior to 10.2.1 and 11.1.3, archive extraction can create files and links outside the target directory. When extracting an archive to a directory, a crafted archive can read or write files outside that directory because hardlink and symlink entries are created without checking where targets point, path containment used a string prefix comparison, and file modes failed to remove setuid, setgid, or sticky bits. This issue is fixed in @xhmikosr/decompress versions 10.2.1 and 11.1.3.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"The decompress package for Node.js extracts archives. Prior to 10.2.1 and 11.1.3, archive extraction can create files and links outside the target directory. When extracting an archive to a directory, a crafted archive can read or write files outside that directory because hardlink and symlink entries are created without checking where targets point, path containment used a string prefix comparison, and file modes failed to remove setuid, setgid, or sticky bits. This issue is fixed in @xhmikosr/decompress versions 10.2.1 and 11.1.3.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nWhen extracting an archive to a directory, a crafted archive can read or write files outside that directory. The flaw is in the code that writes the parsed entries, so it affects every format decompress handles: tar, tar.gz, tar.bz2, and zip by default, plus any others added through the plugins option.\n\nA link (hardlink) or symlink entry is created without checking where its target points. A hardlink can be aimed at any file the running process can read; that file then appears inside the output directory and its contents are exposed. A symlink can point outside the output directory and redirect a later write.\n\nThe path containment check used a string prefix comparison (`realPath.indexOf(outputPath) !== 0`). Output `/srv/out` does not contain `/srv/out-old`, but the prefix comparison treats it as inside, so an entry can escape into a sibling directory whose name starts with the output directory name.\n\nFile modes were applied as `mode & ~umask`, which does not remove the setuid, setgid, or sticky bits. A crafted entry can create a setuid or setgid file. This matters when extraction runs as root, for example in CI, containers, or install scripts.\n\nAny code that extracts archives from an untrusted or attacker-influenced source is affected. Archives are commonly downloaded before extraction, so this is reachable over the network in many setups.\n\n### Patches\n\nFixed in `@xhmikosr/decompress` 10.2.1 and 11.1.3. Link targets are now resolved and checked against the output directory, containment uses `path.relative`, and setuid, setgid, and sticky bits are removed.\n\nThe upstream `decompress` package is unmaintained, and all versions through its last release (4.2.1) have the same flaws. There is no upstream fix. Migrate to `@xhmikosr/decompress` 11.1.3 or later.\n\n### Workarounds\n\nExtract only archives you trust. Run extraction as a non-root user so the mode issue cannot create a privileged file. After extracting, reject any symlink or hardlink that points outside the target and any file with unexpected mode bits.\n\n### Resources\n\n* Related prior issue in the upstream project this package forks: CVE-2020-12265 / GHSA-qgfr-5hqp-vrw9\n* Fix commits and releases:\n  * https://github.com/XhmikosR/decompress/releases/tag/v10.2.1\n  * https://github.com/XhmikosR/decompress/releases/tag/v11.1.3\n  * https://github.com/XhmikosR/decompress/commit/aca5aac\n  * https://github.com/XhmikosR/decompress/commit/281cefa\n  * https://github.com/XhmikosR/decompress/commit/60b5299","format":"markdown","source":"ghsa"},{"lang":"es","text":"El paquete decompress para Node.js extrae archivos. Antes de 10.2.1 y 11.1.3, la extracción de archivos puede crear archivos y enlaces fuera del directorio de destino. Al extraer un archivo a un directorio, un archivo manipulado puede leer o escribir archivos fuera de ese directorio porque las entradas de enlaces duros y enlaces simbólicos se crean sin verificar a dónde apuntan los destinos, la contención de rutas utilizaba una comparación de prefijo de cadena, y los modos de archivo no lograron eliminar los bits setuid, setgid o sticky. Este problema está solucionado en las versiones 10.2.1 y 11.1.3 de @xhmikosr/decompress.","source":"nvd"}],"published":"2026-07-06T20:27:38.000Z","modified":"2026-10-24T21:10:00.130Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","score":9.1,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","score":9.1,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","score":9.1,"rating":"CRITICAL"}],"cwes":["CWE-22","CWE-59","CWE-732"],"affected":[{"ranges":[{"version":"< 10.2.1","status":"affected"},{"version":">= 11.0.0, < 11.1.3","status":"affected"}],"vendor":"XhmikosR","product":"decompress","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"10.2.1"}],"ecosystem":"npm","package":"@xhmikosr/decompress","purl":"pkg:npm/%40xhmikosr/decompress","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"11.0.0","status":"affected","fixed":"11.1.3"}],"ecosystem":"npm","package":"@xhmikosr/decompress","purl":"pkg:npm/%40xhmikosr/decompress","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"4.2.1"}],"ecosystem":"npm","package":"decompress","purl":"pkg:npm/decompress","source":"ghsa"}],"references":[{"url":"https://github.com/XhmikosR/decompress/security/advisories/GHSA-mp2f-45pm-3cg9","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/XhmikosR/decompress/commit/281cefa00cd4275c10479bc5f1abba6b14dee8bd","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/XhmikosR/decompress/commit/60b5299402e72b0b53ca2e55222e9a1ccb44afae","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/XhmikosR/decompress/commit/9fcda4b0a66ca22dc8d337f9b0e7c30293c5fb89","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/XhmikosR/decompress/commit/aca5aac415dc04a6fae5200e51368cff436a09dd","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/XhmikosR/decompress/releases/tag/v10.2.1","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/XhmikosR/decompress/releases/tag/v11.1.3","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/XhmikosR/decompress/commit/281cefa","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/XhmikosR/decompress/commit/60b5299","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/XhmikosR/decompress/commit/aca5aac","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/XhmikosR/decompress","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2026-07-15T13:24:13.932Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-53486","url":"https://www.cve.org/CVERecord?id=CVE-2026-53486","licence":"CVE Terms of Use","modified":"2026-07-15T13:26:56.864Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-mp2f-45pm-3cg9","url":"https://github.com/advisories/GHSA-mp2f-45pm-3cg9","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:12.302Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-53486","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-53486","licence":"Public domain","modified":"2026-10-24T21:10:00.130Z"}],"updatedAt":"2026-11-25T22:59:28.232Z","epss":{"score":0.00645,"percentile":0.52233,"date":"2026-12-01T12:00:22.000Z"}}