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

Cross-Site Scripting Vulnerability #1662

Closed
tch1bo opened this issue Jan 18, 2019 · 0 comments
Closed

Cross-Site Scripting Vulnerability #1662

tch1bo opened this issue Jan 18, 2019 · 0 comments

Comments

@tch1bo
Copy link

tch1bo commented Jan 18, 2019

Hello,

I noticed a Cross-Site Scripting (XSS) Vulnerability in line

return "/static/downloads/" + filenameDownload + ".zip"

It can be triggered by executing a request with title set to <img src=x onerror=evil_code> and downloadToken set to e.g. 1.

The malicious payload <img src=x onerror=evil_code> will then be injected in the returned HTML-page and sent to user. This will cause evil_code to get executed in user's browser.

This is a serious security issue and i would advise you to fix it ASAP. A possible fix is fairly easy, change the faulty line to:

return "/static/downloads/" + flask.escape(filenameDownload) + ".zip"

This will fix the XSS problem and will not harm in legit usecases.

Please note that i am not a regular contributor to your project. I found the bug while testing DeepCode’s AI Code Review. The tool can help you automate the process of finding such (and many other types of) bugs. You can sign-up your repo (free for Open Source) to receive notifications whenever new bugs are detected. You can give it a try here.

Any feedback is more than welcome at chibo@deepcode.ai.

Cheers, Victor.

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