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

Protect against shell-injection attacks #20

Merged
merged 1 commit into from
Aug 4, 2020

Conversation

kousu
Copy link
Contributor

@kousu kousu commented Jul 11, 2020

By using -print0, filenames to purge are delimited by nuls instead of newlines, which can't be found in filenames on unix. Previously, someone who uploaded a file could inject an extra set of files to try to erase. For example, by uploading a file to:

"/path/to/dir/file1.png%09/var/log/messages%09/etc/passwd%09/home/user/something.png"

I can't take credit for this. This is from @horazont in horazont/xmpp-http-upload#11 (comment)

By using `-print0`, filenames to purge are delimited by nuls instead of newlines, which can't be found in filenames on unix. Previously, someone who uploaded a file could inject an *extra set* of files to try to erase. For example, by uploading a file to:

"/path/to/dir/file1.png%09/var/log/messages%09/etc/passwd%09/home/user/something.png"

I can't take credit for this. This is from @horazont in horazont/xmpp-http-upload#11 (comment)
@ThomasLeister
Copy link
Owner

Hi @kousu , thanks for your contribution! :-)

@ThomasLeister ThomasLeister merged commit 90c525b into ThomasLeister:develop Aug 4, 2020
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

Successfully merging this pull request may close these issues.

2 participants