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

File Upload Vulnerability #17

Open
timosupremo opened this issue Nov 7, 2012 · 2 comments
Open

File Upload Vulnerability #17

timosupremo opened this issue Nov 7, 2012 · 2 comments

Comments

@timosupremo
Copy link

Your script is vulnerable to an arbitrary file upload attack. A malicious user can get around the MIME type check simply by spoofing the MIME type in the POST data. This is further compounded as you do not check the file extension properly. Thus, an attacker can upload a .php script (or really, anything) to the web server so long as the MIME type meets the validation requirements.

@timosupremo
Copy link
Author

Two things...

  1. @szajbus, great plugin overall! I appreciate its simplicity compared to other ones out there as I only needed something lightweight. When I get the free time, I'd love to make a pull request and try to fix the vulnerability and enhance the security of the plugin. My intent at this time was to simply disclose the vulnerability so that people are aware of it.

  2. @robertofrega, perhaps you should think before you talk in the future. There's enough information in my reply to understand the nature of the vulnerability. If I had the time to point out the lines of code that caused it, well, at that point I'd fix it myself. Also, it's an actual vulnerability in the code -- not some frilly feature request because I'm too lazy to implement it myself. Anyone actively using this plugin can have their web server compromised because of this issue. If you don't understand the seriousness of this, please point me to the URL of your web server and I'll have it pwned in 5 minutes. Finally, if you don't know what a MIME type or file extension is, or you don't have an understanding as to how to securely implement a file upload system, then it would behoove you to not make unintelligible comments lest your intention is to prove yourself a fool.

@szajbus
Copy link
Owner

szajbus commented Nov 8, 2012

@timosupremo Thanks for pointing it out. I'd really appreciate your help with fixing this issue as I am not actively engaged in the project myself, actually only merging in changes from pull requests. (I switched to Ruby world full-time long time ago).

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

No branches or pull requests

2 participants