Skip to content
Heist/ feed
Back to feed
Medium

Security advisory

Type: advisorySources: OSVCVE: CVE-2026-39245

decompress before 4.2.2 contains an improper path containment check that enables directory traversal and arbitrary file write. The safeMakeDir function (index.js line 29) and the extraction path validation (index.js line 106) use String.indexOf() to verify the resolved path is within the output directory: realDestinationDir.indexOf(realOutputPath) !== 0. This check is flawed because it does not enforce a path separator boundary. For example, "/tmp/app_config".indexOf("/tmp/app") returns 0, incorrectly passing the check even though /tmp/app_config is outside /tmp/app. Combined with the unvalidated symlink creation in the same package, an attacker can write arbitrary files to directories adjacent to the extraction target. This is a bypass of the fix for CVE-2020-12265. The correct check requires appending a path separator: realParentPath.indexOf(realOutputPath + path.sep) !== 0.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-39245
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 20:28 UTC · Revision 1

Source evidence

CVE-2026-39245

core-osv · Original source

Published 9 Jul 2026, 00:00 UTC

decompress before 4.2.2 contains an improper path containment check that enables directory traversal and arbitrary file write. The safeMakeDir function (index.js line 29) and the extraction path validation (index.js line 106) use String.indexOf() to verify the resolved path is within the output directory: realDestinationDir.indexOf(realOutputPath) !== 0. This check is flawed because it does not enforce a path separator boundary. For example, "/tmp/app_config".indexOf("/tmp/app") returns 0, incorrectly passing the check even though /tmp/app_config is outside /tmp/app. Combined with the unvalidated symlink creation in the same package, an attacker can write arbitrary files to directories adjacent to the extraction target. This is a bypass of the fix for CVE-2020-12265. The correct check requires appending a path separator: realParentPath.indexOf(realOutputPath + path.sep) !== 0.

osv:CVE-2026-39245
Complete source record
{
  "id": "e73d3ae786113430b3655463420b3ba862489258d82d025781a0a5ffe10ccb3d",
  "url": "https://osv.dev/vulnerability/CVE-2026-39245",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2026-39245",
    "summary": "decompress before 4.2.2 contains an improper path containment check that enables directory traversal and arbitrary file write. The safeMakeDir function (index.js line 29) and the extraction path validation (index.js line 106) use String.indexOf() to verify the resolved path is within the output directory: realDestinationDir.indexOf(realOutputPath) !== 0. This check is flawed because it does not enforce a path separator boundary. For example, \"/tmp/app_config\".indexOf(\"/tmp/app\") returns 0, incorrectly passing the check even though /tmp/app_config is outside /tmp/app. Combined with the unvalidated symlink creation in the same package, an attacker can write arbitrary files to directories adjacent to the extraction target. This is a bypass of the fix for CVE-2020-12265. The correct check requires appending a path separator: realParentPath.indexOf(realOutputPath + path.sep) !== 0.",
    "evidence": "osv:CVE-2026-39245",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2026-39245",
      "aliases": [
        "CVE-2026-39245"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/kevva/decompress",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "last_affected": "84a8c1046946add1a6ae01c54dbebf312e4ffc85"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:decompress_project:decompress:*:*:*:*:*:node.js:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "last_affected": "4.2.1"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v4.2.1",
            "v4.2.0",
            "v4.1.0",
            "v4.0.0",
            "v3.0.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-39245.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:39.200555970Z",
      "provider": "osv",
      "references": [
        "https://www.npmjs.com/package/decompress",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/39xxx/CVE-2026-39245.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2020-12265",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-39245",
        "https://github.com/kevva/decompress/issues/115",
        "https://github.com/kevva/decompress"
      ],
      "provider_metadata": {
        "cna_assigner": "mitre",
        "unresolved_ranges": [
          {
            "extracted_events": [
              {
                "range": [
                  {
                    "fixed": "4.2.2"
                  }
                ],
                "source": "DESCRIPTION"
              }
            ]
          }
        ],
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/39xxx/CVE-2026-39245.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-39245",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 506684,
  "published_at": "2026-07-09T00:00:00+00:00"
}