Skip to content
Heist/ feed
Back to feed
Medium

Relative path traversal in zip:unzip/zip:extract via check_dir_level depth-counter bypass

Type: advisorySources: OSV

Relative Path Traversal vulnerability in Erlang OTP (stdlib zip module) allows writing files outside the intended extraction directory via a crafted zip archive. zip:unzip/1,2 and zip:extract/1,2 validate entry paths using zip:check_dir_level/2, which tracks directory depth as a running integer counter: .. decrements it, normal path components increment it. The caller rejects only paths where the final counter value is less than zero. A path such as ../x/y causes the counter to go negative mid-traversal then recover to zero, passing validation while resolving to a location outside the extraction directory when joined with the current working directory via add_cwd. This vulnerability is associated with program file lib/stdlib/src/zip.erl. This issue affects OTP from OTP 27.1 before OTP 27.3.4.15, OTP 28.5.0.4, and OTP 29.0.4, corresponding to stdlib from 6.1 before 6.2.2.4, 7.3.0.1, and 8.0.3.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-47078
Confirmed fixed CVEs
Not specified
Updated in this feed
6 Nov 2026, 01:25 UTC · Revision 1

Source evidence

Relative path traversal in zip:unzip/zip:extract via check_dir_level depth-counter bypass

core-osv · Original source

Published 27 Jul 2026, 15:03 UTC

Relative Path Traversal vulnerability in Erlang OTP (stdlib zip module) allows writing files outside the intended extraction directory via a crafted zip archive. zip:unzip/1,2 and zip:extract/1,2 validate entry paths using zip:check_dir_level/2, which tracks directory depth as a running integer counter: .. decrements it, normal path components increment it. The caller rejects only paths where the final counter value is less than zero. A path such as ../x/y causes the counter to go negative mid-traversal then recover to zero, passing validation while resolving to a location outside the extraction directory when joined with the current working directory via add_cwd. This vulnerability is associated with program file lib/stdlib/src/zip.erl. This issue affects OTP from OTP 27.1 before OTP 27.3.4.15, OTP 28.5.0.4, and OTP 29.0.4, corresponding to stdlib from 6.1 before 6.2.2.4, 7.3.0.1, and 8.0.3.

osv:CVE-2026-47078
Complete source record
{
  "id": "239a47834f1b0320f7d6c04fd449a1dd03e8e75ef8eb07bbe1f6fefe37bcbaa7",
  "url": "https://osv.dev/vulnerability/CVE-2026-47078",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Relative path traversal in zip:unzip/zip:extract via check_dir_level depth-counter bypass",
    "summary": "Relative Path Traversal vulnerability in Erlang OTP (stdlib zip module) allows writing files outside the intended extraction directory via a crafted zip archive. zip:unzip/1,2 and zip:extract/1,2 validate entry paths using zip:check_dir_level/2, which tracks directory depth as a running integer counter: .. decrements it, normal path components increment it. The caller rejects only paths where the final counter value is less than zero. A path such as ../x/y causes the counter to go negative mid-traversal then recover to zero, passing validation while resolving to a location outside the extraction directory when joined with the current working directory via add_cwd. This vulnerability is associated with program file lib/stdlib/src/zip.erl. This issue affects OTP from OTP 27.1 before OTP 27.3.4.15, OTP 28.5.0.4, and OTP 29.0.4, corresponding to stdlib from 6.1 before 6.2.2.4, 7.3.0.1, and 8.0.3.",
    "evidence": "osv:CVE-2026-47078",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2026-47078",
      "aliases": [
        "CVE-2026-47078",
        "EEF-CVE-2026-47078",
        "GHSA-rf72-wp7h-jg3x"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:L/SC:N/SI:L/SA:L"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/erlang/otp",
              "type": "GIT",
              "events": [
                {
                  "introduced": "8d537f51a4262d24f3395c4148323eaca9facbbd"
                },
                {
                  "fixed": "8a933c9c7835b06776d31d17b79b7336627d887a"
                },
                {
                  "introduced": "9ae2ef54fc6dacb5bfbe2dc6fc6f2522d57ce1fb"
                },
                {
                  "fixed": "8def54e66dfdd41c535272794d49cc633f596d22"
                },
                {
                  "fixed": "8d537f51a4262d24f3395c4148323eaca9facbbd"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "8d537f51a4262d24f3395c4148323eaca9facbbd"
                      },
                      {
                        "fixed": "8a933c9c7835b06776d31d17b79b7336627d887a"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "range": [
                      {
                        "introduced": "27.1"
                      },
                      {
                        "fixed": "27.3.4.15"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "ChangesAt"
                  },
                  {
                    "range": [
                      {
                        "fixed": "8d537f51a4262d24f3395c4148323eaca9facbbd"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "8a933c9c7835b06776d31d17b79b7336627d887a"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "patch-base-27",
            "OTP-27.3.4",
            "OTP-27.3.4.9",
            "OTP-27.3.4.10",
            "OTP-27.3.4.14",
            "OTP-27.3.4.13",
            "OTP-27.3.4.12",
            "OTP-27.3.4.11",
            "OTP-27.3.4.8",
            "OTP-27.3.4.6",
            "OTP-27.3.4.7",
            "OTP-27.3",
            "OTP-27.3.4.5",
            "OTP-27.3.4.4",
            "OTP-27.3.4.3",
            "OTP-27.3.3",
            "OTP-27.3.4.2",
            "OTP-27.3.4.1",
            "OTP-27.3.2",
            "OTP-27.2",
            "OTP-27.3.1",
            "OTP-27.1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-47078.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:45.608766657Z",
      "provider": "osv",
      "references": [
        "https://cna.erlef.org/cves/CVE-2026-47078.html",
        "https://github.com",
        "https://osv.dev/vulnerability/EEF-CVE-2026-47078",
        "https://www.erlang.org/doc/system/versions.html#order-of-versions",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/47xxx/CVE-2026-47078.json",
        "https://github.com/erlang/otp/security/advisories/GHSA-rf72-wp7h-jg3x",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-47078",
        "https://github.com/erlang/otp/commit/8a933c9c7835b06776d31d17b79b7336627d887a",
        "https://github.com/erlang/otp/commit/8d537f51a4262d24f3395c4148323eaca9facbbd",
        "https://github.com/erlang/otp"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-23"
        ],
        "cna_assigner": "EEF",
        "unresolved_ranges": [
          {
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "6.1"
                  },
                  {
                    "fixed": "6.2.2.4"
                  }
                ],
                "source": "AFFECTED_FIELD",
                "strategy": "ChangesAt"
              }
            ]
          }
        ],
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/47xxx/CVE-2026-47078.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-47078",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 513837,
  "published_at": "2026-07-27T15:03:50.929+00:00"
}