{"id":"CVE-2026-47078","revision":"d6cad6df458e4aa89a783a17e95f058b","records":[{"revision":"d6cad6df458e4aa89a783a17e95f058b","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-47078","aliases":[],"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\u00A027.1 before OTP\u00A027.3.4.15, OTP\u00A028.5.0.4, and OTP\u00A029.0.4, corresponding to stdlib from 6.1 before 6.2.2.4, 7.3.0.1, and 8.0.3.","state":0,"publishedAt":"2026-07-27T15:03:50.929+00:00","modifiedAt":"2026-09-24T20:48:37.203+00:00","affected":[{"ecosystem":"Vendor product","name":"otp","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"cpes\": [\n                        \"cpe:2.3:a:erlang:erlang\\\\/otp:*:*:*:*:*:*:*:*\"\n                    ],\n                    \"defaultStatus\": \"unaffected\",\n                    \"modules\": [\n                        \"zip\"\n                    ],\n                    \"packageName\": \"otp\",\n                    \"packageURL\": \"pkg:software-id/erlang.org/otp\",\n                    \"product\": \"OTP\",\n                    \"programFiles\": [\n                        \"lib/stdlib/src/zip.erl\"\n                    ],\n                    \"programRoutines\": [\n                        {\n                            \"name\": \"zip:unzip/1\"\n                        },\n                        {\n                            \"name\": \"zip:unzip/2\"\n                        },\n                        {\n                            \"name\": \"zip:extract/1\"\n                        },\n                        {\n                            \"name\": \"zip:extract/2\"\n                        },\n                        {\n                            \"name\": \"zip:check_dir_level/2\"\n                        }\n                    ],\n                    \"vendor\": \"Erlang\",\n                    \"versions\": [\n                        {\n                            \"changes\": [\n                                {\n                                    \"at\": \"27.3.4.15\",\n                                    \"status\": \"unaffected\"\n                                },\n                                {\n                                    \"at\": \"28.5.0.4\",\n                                    \"status\": \"unaffected\"\n                                },\n                                {\n                                    \"at\": \"29.0.4\",\n                                    \"status\": \"unaffected\"\n                                }\n                            ],\n                            \"lessThan\": \"*\",\n                            \"status\": \"affected\",\n                            \"version\": \"27.1\",\n                            \"versionType\": \"otp\"\n                        }\n                    ]\n                }"},{"ecosystem":"Vendor product","name":"stdlib","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"cpes\": [\n                        \"cpe:2.3:a:erlang:erlang\\\\/otp:*:*:*:*:*:*:*:*\"\n                    ],\n                    \"defaultStatus\": \"unaffected\",\n                    \"modules\": [\n                        \"zip\"\n                    ],\n                    \"packageName\": \"stdlib\",\n                    \"packageURL\": \"pkg:otp/stdlib?repository_url=https:%2F%2Fgithub.com%2Ferlang%2Fotp&vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Ferlang%2Fotp.git\",\n                    \"product\": \"OTP\",\n                    \"programFiles\": [\n                        \"src/zip.erl\"\n                    ],\n                    \"programRoutines\": [\n                        {\n                            \"name\": \"zip:unzip/1\"\n                        },\n                        {\n                            \"name\": \"zip:unzip/2\"\n                        },\n                        {\n                            \"name\": \"zip:extract/1\"\n                        },\n                        {\n                            \"name\": \"zip:extract/2\"\n                        },\n                        {\n                            \"name\": \"zip:check_dir_level/2\"\n                        }\n                    ],\n                    \"repo\": \"https://github.com/erlang/otp\",\n                    \"vendor\": \"Erlang\",\n                    \"versions\": [\n                        {\n                            \"changes\": [\n                                {\n                                    \"at\": \"6.2.2.4\",\n                                    \"status\": \"unaffected\"\n                                },\n                                {\n                                    \"at\": \"7.3.0.1\",\n                                    \"status\": \"unaffected\"\n                                },\n                                {\n                                    \"at\": \"8.0.3\",\n                                    \"status\": \"unaffected\"\n                                }\n                            ],\n                            \"lessThan\": \"*\",\n                            \"status\": \"affected\",\n                            \"version\": \"6.1\",\n                            \"versionType\": \"otp\"\n                        }\n                    ]\n                }"},{"ecosystem":"https://github.com","name":"erlang/otp","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"collectionURL\": \"https://github.com\",\n                    \"cpes\": [\n                        \"cpe:2.3:a:erlang:erlang\\\\/otp:*:*:*:*:*:*:*:*\"\n                    ],\n                    \"defaultStatus\": \"unaffected\",\n                    \"modules\": [\n                        \"zip\"\n                    ],\n                    \"packageName\": \"erlang/otp\",\n                    \"packageURL\": \"pkg:github/erlang/otp\",\n                    \"product\": \"OTP\",\n                    \"programFiles\": [\n                        \"lib/stdlib/src/zip.erl\"\n                    ],\n                    \"programRoutines\": [\n                        {\n                            \"name\": \"zip:unzip/1\"\n                        },\n                        {\n                            \"name\": \"zip:unzip/2\"\n                        },\n                        {\n                            \"name\": \"zip:extract/1\"\n                        },\n                        {\n                            \"name\": \"zip:extract/2\"\n                        },\n                        {\n                            \"name\": \"zip:check_dir_level/2\"\n                        }\n                    ],\n                    \"repo\": \"https://github.com/erlang/otp\",\n                    \"vendor\": \"Erlang\",\n                    \"versions\": [\n                        {\n                            \"lessThan\": \"8a933c9c7835b06776d31d17b79b7336627d887a\",\n                            \"status\": \"affected\",\n                            \"version\": \"8d537f51a4262d24f3395c4148323eaca9facbbd\",\n                            \"versionType\": \"git\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 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","score":4.8,"severity":"MEDIUM"}],"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"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-47078","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-47078","identifiers":["CVE-2026-47078"]},"retained":false,"historicalAffected":[]}],"coverage":[]}