Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adm-zip extractAllTo and extractEntryTo path traversal #176

Closed
ajxchapman opened this issue Feb 11, 2017 · 2 comments
Closed

Adm-zip extractAllTo and extractEntryTo path traversal #176

ajxchapman opened this issue Feb 11, 2017 · 2 comments

Comments

@ajxchapman
Copy link

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.

@ecneladis
Copy link

ecneladis commented Feb 11, 2017

Already reported more than two years ago: #117

@manjeet13
Copy link

How come this hasn't been fixed yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants