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

fix: Make sure user input is not treated as safe in the oauth view #1978

Merged
merged 2 commits into from
Feb 1, 2023
Merged

fix: Make sure user input is not treated as safe in the oauth view #1978

merged 2 commits into from
Feb 1, 2023

Conversation

gschuurman
Copy link
Contributor

Description

Fix a security issue issue with the next parameter in the OAUTH Login field.

The user can edit the next field from within the URL, this can cause reflected XSS.
for example /login/?next="-alert(document.location)-" will alert the document location.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Is CRUD MVC related.
  • Is Auth, RBAC security related.
  • Changes the security db schema.
  • Introduces new feature
  • Removes existing feature

@codecov
Copy link

codecov bot commented Jan 9, 2023

Codecov Report

Merging #1978 (bc2a87d) into master (1e1c354) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1978   +/-   ##
=======================================
  Coverage   78.13%   78.13%           
=======================================
  Files          71       71           
  Lines        8612     8612           
=======================================
  Hits         6729     6729           
  Misses       1883     1883           
Flag Coverage Δ
python 78.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@gschuurman
Copy link
Contributor Author

@dpgaspar Can you review this change? It solves a upstream Issue in apache airflow which allows XSS via the next paramter

@dpgaspar dpgaspar merged commit 3d17741 into dpgaspar:master Feb 1, 2023
AVMusorin added a commit to AVMusorin/Flask-AppBuilder that referenced this pull request Jun 5, 2023
Since next parameter shouldn't be used with `safe` Jinja filter
(see dpgaspar#1978),
to avoid double escaping we can use Jinja's `urlencode`.
Also, it might be clearer to work with this parameter in the related
libraries, no need to double unquote the url.
AVMusorin added a commit to AVMusorin/Flask-AppBuilder that referenced this pull request Jun 5, 2023
Since next parameter shouldn't be used with `safe` Jinja filter
(see dpgaspar#1978),
to avoid double escaping we can use Jinja's `urlencode`.
Also, it might be clearer to work with this parameter in the related
libraries, no need to double unquote the url.
dpgaspar added a commit that referenced this pull request Jun 20, 2023
Since next parameter shouldn't be used with `safe` Jinja filter
(see #1978),
to avoid double escaping we can use Jinja's `urlencode`.
Also, it might be clearer to work with this parameter in the related
libraries, no need to double unquote the url.

Co-authored-by: Daniel Vaz Gaspar <[email protected]>
@raboof
Copy link

raboof commented Oct 18, 2023

Was an advisory ever published for this issue? I don't think I see it at https://github.com/dpgaspar/Flask-AppBuilder/security

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.

4 participants