Impact
When the zip module is used to extract files to disk and the archive is maliciously corrupted by including absolute file paths, the zip module would extract them as absolute paths instead of stripping the leading /
, drive or device letter.
This vulnerability is associated with program files lib/stdlib/src/zip.erl
and program routines zip:unzip/1
, zip:unzip/2
, zip:extract/1
, zip:extract/2
unless the memory
option is passed.
Workarounds
You can use zip:list_dir/1
on the archive and verify that no files contain absolute paths before extracting then archive to disk.
Affected/Unaffected Versions
A version larger than or equal to one of the listed patched versions is unaffected; otherwise, a version that satisfies the expression listed under affected versions is affected, and if it does not, it is unaffected.
The documentation of the new OTP version scheme describes how versions should be compared. Note that versions used prior to OTP 17.0, when the new OTP version scheme was introduced, are never listed since it is not well defined how to compare those versions.
In the case of this vulnerability, versions prior to OTP 17.0 are likely also affected.
Credits
Thanks to Wander Nauta for finding and responsibly disclosing this vulnerability to the Erlang/OTP project.
Impact
When the zip module is used to extract files to disk and the archive is maliciously corrupted by including absolute file paths, the zip module would extract them as absolute paths instead of stripping the leading
/
, drive or device letter.This vulnerability is associated with program files
lib/stdlib/src/zip.erl
and program routineszip:unzip/1
,zip:unzip/2
,zip:extract/1
,zip:extract/2
unless thememory
option is passed.Workarounds
You can use
zip:list_dir/1
on the archive and verify that no files contain absolute paths before extracting then archive to disk.Affected/Unaffected Versions
A version larger than or equal to one of the listed patched versions is unaffected; otherwise, a version that satisfies the expression listed under affected versions is affected, and if it does not, it is unaffected.
The documentation of the new OTP version scheme describes how versions should be compared. Note that versions used prior to OTP 17.0, when the new OTP version scheme was introduced, are never listed since it is not well defined how to compare those versions.
In the case of this vulnerability, versions prior to OTP 17.0 are likely also affected.
Credits
Thanks to Wander Nauta for finding and responsibly disclosing this vulnerability to the Erlang/OTP project.