lingthio / Flask-User

Customizable User Authorization & User Management: Register, Confirm, Login, Change username/password, Forgot password and more.
http://flask-user.readthedocs.io/
MIT License
1.06k stars 292 forks source link

XSS on Login Page #188

Open dbohannon opened 7 years ago

dbohannon commented 7 years ago

The default Login page provided by Flask-User at /users/sign-in is vulnerable to cross-site scripting attacks. Specifically, when navigating to a page that requires authentication, an unauthenticated user is redirected to the /users/sign-in and the originally requested URL is reflected onto the page. Arbitrary content can be written to the page by adding query params containing malicious HTML to the original URL. For example, if the /profile route is protected:

http://localhost/profile?hack=<img src=x onerror=alert('XSS_SUCCESS')></img>

Tested using Firefox and Flask-User v0.6

ghost commented 6 years ago

Is there a solution for this issue?

pacocampo commented 6 years ago

Any news for this issue? Thank you!

ghost commented 6 years ago

@dbohannon I have tested this with Flask (0.12.2) and Flask-User (0.6.20) and this type of XSS doesn't work. At least if you follow a few rules:

@dbohannon Could you please also make a test with 0.6.20 and confirm?