-
Notifications
You must be signed in to change notification settings - Fork 754
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
Crafted tar archive can be used to remove arbitrary files #661
Comments
|
I'm a bit puzzled what the "attack" vector as I don't see how removing a file is any more problematic as being able to overwrite it with arbitrary content. To me, this is at beast a Quality of Implementation issue and I don't really consider it a bug in first place based on Garbage In, Garbage Out. |
|
It's a security issue as tar is normally not able to remove files. They can overwrite files but not remove them. Also, “garbage in, garbage out” is not a design principle for security critical software. If the input is invalid, an error should be raised, erasing random files is not behaviour that should occur in this case. |
|
I agree that it would be nice to reject a hardlink that points to itself and it should be straightforward to add a check for that. A patch would be welcome. |
|
You can continue to claim its a security issue, but hand-waving doesn't make it true. So, what scenario can be name where extracting a malformed tarball which removes a file is worse than whatever content that tarball can create. It is hardly a random files that gets removes and the content of the file would have been junked already. |
|
@jsonn perhaps a lock file could be deleted, or a key. That would cause DoS if you're operating an otherwise poorly secured box. I would agree that random un-tar-like behaviour is a pretty critical flaw. I wouldn't feel comfortable using libarchive with flaws like this. I'll take a look at patching it. |
|
@xorgy Any progress with this one? |
Nope, I suggest using a mature tar implementation that has an answer for this. |
|
Maybe look here: b3073af |
That looks like a fix! Closing this one. |
This bug has been reported by me on FreeBSD as bug #207396. It is reproduced below.
As Github does not allow me to attach the test case, please look at the FreeBSD bug report for the test case.
The text was updated successfully, but these errors were encountered: