You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The adm-zip.js:extractAllTo and adm-zip.js:extractEntryTo methods do not sanitize zip entry filenames allowing files to be extracted outside of the targetPath argument directory.
These functions use path.resolve to combine the targetPath argument with the zip entry entryName without checking or sanitizing the result. If a zip file contains a filename with an absolute path, e.g. /tmp/outfile, or a relative path with parent directory specifiers, e.g. ../outfile, these entries will be extracted outside the specified targetPath directory.
Both extractAllTo and extractEntryTo should check that the result of path.resolve is under the targetPath directory and discard or sanitise any paths that do not pass this check.
The text was updated successfully, but these errors were encountered:
The
adm-zip.js:extractAllTo
andadm-zip.js:extractEntryTo
methods do not sanitize zip entry filenames allowing files to be extracted outside of thetargetPath
argument directory.These functions use
path.resolve
to combine thetargetPath
argument with the zip entryentryName
without checking or sanitizing the result. If a zip file contains a filename with an absolute path, e.g./tmp/outfile
, or a relative path with parent directory specifiers, e.g.../outfile
, these entries will be extracted outside the specifiedtargetPath
directory.Both
extractAllTo
andextractEntryTo
should check that the result ofpath.resolve
is under thetargetPath
directory and discard or sanitise any paths that do not pass this check.The text was updated successfully, but these errors were encountered: