Skip to content
New issue

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

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

Already on GitHub? # to your account

There is a vulnerability in unarr, which will lead to path traversal vulnerability #21

Closed
Th1nkkk opened this issue Aug 8, 2021 · 2 comments

Comments

@Th1nkkk
Copy link

Th1nkkk commented Aug 8, 2021

There is a vulnerability in unarr, which will lead to path traversal vulnerability
Go unarr does not check the contents of the archive.

Exploit process

  1. An attacker can construct a malicious tar package (or any compressed archive file).
    As shown in the figure below, obviously, this will not succeed under the tar command, because the tar command fixes the vulnerability.
    image

  2. The victim uses go unarr to unzip the archive
    As shown in the figure below, path traversal occurs during go unarr decompression, and we upload the file to the.. / directory
    image

  3. By triggering the path traversal vulnerability, an attacker can store any file in any privileged place (which means that rce can be caused under root privileges)

@mastercoms
Copy link
Contributor

Could you provide instructions on producing a exploit sample (or provide such sample)?

@gen2brain
Copy link
Owner

This should be fixed in 239ec40. The Name() is sanitized, i.e. test/../../../../../../../../../../../tmp/test.txt > tmp/test.txt.

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

No branches or pull requests

3 participants