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 (again) possible open redirect vulnerability. #897

Merged
merged 1 commit into from
Dec 28, 2023
Merged

Conversation

jwag956
Copy link
Member

@jwag956 jwag956 commented Dec 28, 2023

Improve the regex (thanks Brandon Elliot) to catch more crafted relative paths that browsers convert to absolute.

Add the "absolute" option to SECURITY_REDIRECT_VALIDATE_MODE which restores Werkzeug prior behavior of converting all Location header values into absolute paths rather than relative (autocorrect_location_header=True).

This is the backport to 5.3

Improve the regex (thanks Brandon Elliot) to catch more crafted relative paths that browsers convert to absolute.

Add the "absolute" option to SECURITY_REDIRECT_VALIDATE_MODE which restores Werkzeug prior behavior of converting all Location header values into absolute paths rather than relative (autocorrect_location_header=True).

This is the backport to 5.3
Copy link

codecov bot commented Dec 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2555df3) 98.15% compared to head (d56a307) 98.16%.

Additional details and impacted files
@@           Coverage Diff           @@
##            5.3.x     #897   +/-   ##
=======================================
  Coverage   98.15%   98.16%           
=======================================
  Files          34       34           
  Lines        4456     4469   +13     
=======================================
+ Hits         4374     4387   +13     
  Misses         82       82           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jwag956 jwag956 merged commit 8b5abc4 into 5.3.x Dec 28, 2023
16 checks passed
@jwag956 jwag956 deleted the backport893for53x branch December 28, 2023 17:02
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.

None yet

1 participant