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

Project import vulnerable to arbitrary file write #1927

Open
itsacoderepo opened this Issue Jan 2, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@itsacoderepo
Copy link

itsacoderepo commented Jan 2, 2019

Describe the bug
The import of a project is prone to a path traversal and thus an arbitrary file write.

To Reproduce
Steps to reproduce the behavior:

  1. Download payload.txt
  2. gzip payload.txt, payload.txt.gz is greated
  3. Go to OpenRefine, Import Projects
  4. Choose payload.txt.gz
  5. Import file
  6. cat /tmp/ohno should show the content of the file.

Current Results
The first 100 bytes are from the file payload.txt are chosen as path, not the filename itself. An error is also shown but is not related to the path traversal.

Expected behavior
Show an error, warn user, do not write file outside of the project folder.

Video
project_import_vuln.zip

Desktop (please complete the following information):
Not important

OpenRefine (please complete the following information):

  • Demo with 3.1 but should work with master

Datasets
Payload file
https://github.com/OpenRefine/OpenRefine/files/2721399/payload.txt

Additional context
Please also update dependencies. The ant library is out of date and sloppy (compared to other) handling (tar) archive header.

If you have questions, you can reach me at "niko at-sign shiftleft.io" or https://twitter.com/0x4d5a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment