{"id":"CVE-2026-47078","state":"PUBLISHED","title":"Relative path traversal in zip:unzip/zip:extract via check_dir_level depth-counter bypass","description":"Relative Path Traversal vulnerability in Erlang OTP (stdlib zip module) allows writing files outside the intended extraction directory via a crafted zip archive.\n\nzip: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.\n\nThis vulnerability is associated with program file lib/stdlib/src/zip.erl.\n\nThis 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.","publishedAt":"2026-07-27T15:03:50.929Z","updatedAt":"2026-09-24T20:48:37.203Z","severity":{"score":4.8,"label":"Medium","version":"4.0","vector":"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","source":"EEF"},"assigner":"EEF","products":["Erlang OTP"],"affected":[{"vendor":"Erlang","product":"OTP","packageName":"otp","packageURL":"pkg:software-id/erlang.org/otp","defaultStatus":"unaffected","versions":[{"version":"27.1","status":"affected","lessThan":"*","changes":[{"at":"27.3.4.15","status":"unaffected"},{"at":"28.5.0.4","status":"unaffected"},{"at":"29.0.4","status":"unaffected"}],"versionType":"otp"}],"cpes":["cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*"],"modules":["zip"],"programFiles":["lib/stdlib/src/zip.erl"],"programRoutines":[{"name":"zip:unzip/1"},{"name":"zip:unzip/2"},{"name":"zip:extract/1"},{"name":"zip:extract/2"},{"name":"zip:check_dir_level/2"}]},{"vendor":"Erlang","product":"OTP","packageName":"stdlib","packageURL":"pkg:otp/stdlib?repository_url=https:%2F%2Fgithub.com%2Ferlang%2Fotp&vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Ferlang%2Fotp.git","defaultStatus":"unaffected","versions":[{"version":"6.1","status":"affected","lessThan":"*","changes":[{"at":"6.2.2.4","status":"unaffected"},{"at":"7.3.0.1","status":"unaffected"},{"at":"8.0.3","status":"unaffected"}],"versionType":"otp"}],"cpes":["cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*"],"modules":["zip"],"programFiles":["src/zip.erl"],"programRoutines":[{"name":"zip:unzip/1"},{"name":"zip:unzip/2"},{"name":"zip:extract/1"},{"name":"zip:extract/2"},{"name":"zip:check_dir_level/2"}],"repo":"https://github.com/erlang/otp"},{"vendor":"Erlang","product":"OTP","packageName":"erlang/otp","packageURL":"pkg:github/erlang/otp","defaultStatus":"unaffected","versions":[{"version":"8d537f51a4262d24f3395c4148323eaca9facbbd","status":"affected","lessThan":"8a933c9c7835b06776d31d17b79b7336627d887a","versionType":"git"}],"collectionURL":"https://github.com","cpes":["cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*"],"modules":["zip"],"programFiles":["lib/stdlib/src/zip.erl"],"programRoutines":[{"name":"zip:unzip/1"},{"name":"zip:unzip/2"},{"name":"zip:extract/1"},{"name":"zip:extract/2"},{"name":"zip:check_dir_level/2"}],"repo":"https://github.com/erlang/otp"}],"references":["https://github.com/erlang/otp/security/advisories/GHSA-rf72-wp7h-jg3x","https://cna.erlef.org/cves/CVE-2026-47078.html","https://osv.dev/vulnerability/EEF-CVE-2026-47078","https://www.erlang.org/doc/system/versions.html#order-of-versions","https://github.com/erlang/otp/commit/8d537f51a4262d24f3395c4148323eaca9facbbd","https://github.com/erlang/otp/commit/8a933c9c7835b06776d31d17b79b7336627d887a"],"weaknesses":["CWE-23"],"ingestedAt":"2026-10-29T20:12:07.131Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/47xxx/CVE-2026-47078.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-47078","state":"PUBLISHED","datePublished":"2026-07-27T15:03:50.929Z","dateUpdated":"2026-09-24T20:48:37.203Z","assignerShortName":"EEF","assignerOrgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","dateReserved":"2026-05-18T17:28:10.319Z"},"containers":{"cna":{"title":"Relative path traversal in zip:unzip/zip:extract via check_dir_level depth-counter bypass","descriptions":[{"lang":"en","value":"Relative Path Traversal vulnerability in Erlang OTP (stdlib zip module) allows writing files outside the intended extraction directory via a crafted zip archive.\n\nzip: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.\n\nThis vulnerability is associated with program file lib/stdlib/src/zip.erl.\n\nThis 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."}],"affected":[{"vendor":"Erlang","product":"OTP","packageName":"otp","packageURL":"pkg:software-id/erlang.org/otp","defaultStatus":"unaffected","versions":[{"version":"27.1","status":"affected","lessThan":"*","changes":[{"at":"27.3.4.15","status":"unaffected"},{"at":"28.5.0.4","status":"unaffected"},{"at":"29.0.4","status":"unaffected"}],"versionType":"otp"}],"cpes":["cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*"],"modules":["zip"],"programFiles":["lib/stdlib/src/zip.erl"],"programRoutines":[{"name":"zip:unzip/1"},{"name":"zip:unzip/2"},{"name":"zip:extract/1"},{"name":"zip:extract/2"},{"name":"zip:check_dir_level/2"}]},{"vendor":"Erlang","product":"OTP","packageName":"stdlib","packageURL":"pkg:otp/stdlib?repository_url=https:%2F%2Fgithub.com%2Ferlang%2Fotp&vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Ferlang%2Fotp.git","defaultStatus":"unaffected","versions":[{"version":"6.1","status":"affected","lessThan":"*","changes":[{"at":"6.2.2.4","status":"unaffected"},{"at":"7.3.0.1","status":"unaffected"},{"at":"8.0.3","status":"unaffected"}],"versionType":"otp"}],"cpes":["cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*"],"modules":["zip"],"programFiles":["src/zip.erl"],"programRoutines":[{"name":"zip:unzip/1"},{"name":"zip:unzip/2"},{"name":"zip:extract/1"},{"name":"zip:extract/2"},{"name":"zip:check_dir_level/2"}],"repo":"https://github.com/erlang/otp"},{"vendor":"Erlang","product":"OTP","packageName":"erlang/otp","packageURL":"pkg:github/erlang/otp","defaultStatus":"unaffected","versions":[{"version":"8d537f51a4262d24f3395c4148323eaca9facbbd","status":"affected","lessThan":"8a933c9c7835b06776d31d17b79b7336627d887a","versionType":"git"}],"collectionURL":"https://github.com","cpes":["cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*"],"modules":["zip"],"programFiles":["lib/stdlib/src/zip.erl"],"programRoutines":[{"name":"zip:unzip/1"},{"name":"zip:unzip/2"},{"name":"zip:extract/1"},{"name":"zip:extract/2"},{"name":"zip:check_dir_level/2"}],"repo":"https://github.com/erlang/otp"}],"references":[{"url":"https://github.com/erlang/otp/security/advisories/GHSA-rf72-wp7h-jg3x","tags":["vendor-advisory","related"]},{"url":"https://cna.erlef.org/cves/CVE-2026-47078.html","name":"EEF CNA record for CVE-2026-47078","tags":["related"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-47078","name":"OSV record EEF-CVE-2026-47078","tags":["related"]},{"url":"https://www.erlang.org/doc/system/versions.html#order-of-versions","name":"Erlang/OTP version ordering","tags":["x_version-scheme"]},{"url":"https://github.com/erlang/otp/commit/8d537f51a4262d24f3395c4148323eaca9facbbd","name":"Introducing commit 8d537f5 in erlang/otp","tags":["related"]},{"url":"https://github.com/erlang/otp/commit/8a933c9c7835b06776d31d17b79b7336627d887a","name":"Fix commit 8a933c9 in erlang/otp","tags":["patch"]}],"metrics":[{"cvssV4_0":{"Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","Safety":"NOT_DEFINED","attackComplexity":"LOW","attackRequirements":"NONE","attackVector":"LOCAL","baseScore":4.8,"baseSeverity":"MEDIUM","privilegesRequired":"NONE","providerUrgency":"NOT_DEFINED","subAvailabilityImpact":"LOW","subConfidentialityImpact":"NONE","subIntegrityImpact":"LOW","userInteraction":"PASSIVE","valueDensity":"NOT_DEFINED","vectorString":"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","version":"4.0","vulnAvailabilityImpact":"LOW","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"LOW","vulnerabilityResponseEffort":"NOT_DEFINED"},"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-23","description":"CWE-23 Relative Path Traversal","lang":"en","type":"CWE"}]}],"providerMetadata":{"shortName":"EEF","orgId":"6b3ad84c-e1a6-4bf7-a703-f496b71e49db","dateUpdated":"2026-09-24T20:48:37.203Z"},"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*","versionEndExcluding":"27.3.4.15","versionStartIncluding":"27.1","vulnerable":true},{"criteria":"cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*","versionEndExcluding":"28.5.0.4","versionStartIncluding":"28.0","vulnerable":true},{"criteria":"cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*","versionEndExcluding":"29.0.4","versionStartIncluding":"29.0","vulnerable":true}],"negate":false,"operator":"OR"}],"operator":"AND"}],"credits":[{"lang":"en","type":"finder","value":"Jonatan Männchen / EEF"},{"lang":"en","type":"finder","value":"Zhang Delong"},{"lang":"en","type":"remediation developer","value":"John Högberg"}],"datePublic":"2026-07-27T15:03:50.000Z","impacts":[{"capecId":"CAPEC-139","descriptions":[{"lang":"en","value":"CAPEC-139 Relative Path Traversal"}]}],"source":{"discovery":"EXTERNAL"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-07-27T18:38:46.508080Z","id":"CVE-2026-47078","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-07-27T18:38:54.420Z"}}]}}}