<Vulnerability name="CVE-2026-47078">
    <DocumentDistribution xml:lang="en">Copyright © 2012 Red Hat, Inc. All rights reserved.</DocumentDistribution>
    <ThreatSeverity>Moderate</ThreatSeverity>
    <PublicDate>2026-07-27T15:03:50</PublicDate>
    <Bugzilla id="2507547" url="https://bugzilla.redhat.com/show_bug.cgi?id=2507547" xml:lang="en:us">
otp: Erlang OTP: Arbitrary file write via relative path traversal in zip module
    </Bugzilla>
    <CVSS3 status="draft">
        <CVSS3BaseScore>4.4</CVSS3BaseScore>
        <CVSS3ScoringVector>CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L</CVSS3ScoringVector>
    </CVSS3>
    <CWE>CWE-22</CWE>
    <Details xml:lang="en:us" source="Mitre">
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 29.0.4, OTP 28.5.0.4 and OTP 27.3.4.15, corresponding to stdlib from 6.1 before 8.0.3, 7.3.0.1 and 6.2.2.4.
    </Details>
    <Details xml:lang="en:us" source="Red Hat">
A flaw was found in the Erlang OTP stdlib zip module. The zip:unzip and zip:extract functions, which handle archive extraction, are vulnerable to a relative path traversal attack. A remote attacker could craft a malicious zip archive containing specially formed entry names. When processed, this could allow the attacker to write arbitrary files outside the intended extraction directory, potentially leading to remote code execution or data corruption.
    </Details>
    <PackageState cpe="cpe:/a:redhat:hummingbird:1">
        <ProductName>Red Hat Hardened Images</ProductName>
        <FixState>Not affected</FixState>
        <PackageName>erlang27</PackageName>
    </PackageState>
    <PackageState cpe="cpe:/a:redhat:openstack:16.2">
        <ProductName>Red Hat OpenStack Platform 16.2</ProductName>
        <FixState>Not affected</FixState>
        <PackageName>erlang</PackageName>
    </PackageState>
    <PackageState cpe="cpe:/a:redhat:openstack:17.1">
        <ProductName>Red Hat OpenStack Platform 17.1</ProductName>
        <FixState>Not affected</FixState>
        <PackageName>erlang</PackageName>
    </PackageState>
    <PackageState cpe="cpe:/a:redhat:openstack:18.0">
        <ProductName>Red Hat OpenStack Platform 18.0</ProductName>
        <FixState>Not affected</FixState>
        <PackageName>erlang</PackageName>
    </PackageState>
    <References xml:lang="en:us">
https://www.cve.org/CVERecord?id=CVE-2026-47078
https://nvd.nist.gov/vuln/detail/CVE-2026-47078
https://cna.erlef.org/cves/CVE-2026-47078.html
https://github.com/erlang/otp/commit/8a933c9c7835b06776d31d17b79b7336627d887a
https://github.com/erlang/otp/security/advisories/GHSA-rf72-wp7h-jg3x
https://osv.dev/vulnerability/EEF-CVE-2026-47078
https://www.erlang.org/doc/system/versions.html#order-of-versions
    </References>
</Vulnerability>