mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2026-02-06 07:22:17 +00:00
[Security] Arbitrary reading of data from backing local storage provider #210
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cheeseandcereal on GitHub.
Right now, the server does not require that a file's
.metadataneighboring file has to exist before serving it due to this logic:8a5c737140/server/handlers.go (L616-L621)This is an extreme oversight, as it leads to serious security implications.
Firstly, given the known URL of an item on the server, you can freely read it's metadata, which includes its delete token and simply delete it.
POC:
However, even worse than this, it's allowing arbitrary traversal and reading of the filesystem if the provider is local and is not using a posix-style path such as windows. Take the following directory tree:
Now start transfersh.exe like so:
Now run the following curl:
And the server will happily read and send the contents of private.txt in the response body.
This is obviously extremely dangerous and should be patched/released and possibly some sort of deprecation/security warning should be given about all previous releases.
@cheeseandcereal commented on GitHub:
Yeah, sorry @aspacca. I was looking for a security contact, but couldn't find anything in the repository. Probably worth putting something here to prevent that in the future: https://github.com/dutchcoders/transfer.sh/security/policy
@paolafrancesca commented on GitHub:
good catch @cheeseandcereal , I would have preferred a responsible disclosure anyway (https://en.wikipedia.org/wiki/Responsible_disclosure)