-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert Referrer-Policy header commit. (#842)
Although OWASP still recommends that reset password and confirmation links have the no-referrer header option set - this causes issues with HTTPS and Flask-WTF that requires a referrer header. Also - for the past 5 years, the browser default for Referrer-Policy is 'strict-origin-when-cross-origin' which should be enough to mitigate any possible Referrer leakage. closes #829
- Loading branch information
Showing
4 changed files
with
48 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,7 +89,6 @@ def on_instructions_sent(app, **kwargs): | |
token = registrations[0]["confirm_token"] | ||
response = clients.get("/confirm/" + token, follow_redirects=False) | ||
assert len(recorded_confirms) == 1 | ||
assert response.headers.get("Referrer-Policy", None) == "no-referrer" | ||
response = clients.get(response.location) | ||
assert get_message("EMAIL_CONFIRMED") in response.data | ||
# make sure not logged in | ||
|
@@ -361,7 +360,6 @@ def test_confirm_redirect_to_post_confirm(client, get_message): | |
|
||
response = client.get("/confirm/" + token, follow_redirects=False) | ||
assert "/post_confirm" in response.location | ||
assert response.headers.get("Referrer-Policy", None) == "no-referrer" | ||
|
||
|
||
@pytest.mark.registerable() | ||
|
@@ -393,7 +391,6 @@ def test_spa_get(app, client, get_message): | |
assert "/confirm-redirect" == split.path | ||
qparams = dict(parse_qsl(split.query)) | ||
assert qparams["email"] == "[email protected]" | ||
assert response.headers.get("Referrer-Policy", None) == "no-referrer" | ||
|
||
response = client.get("/confirm/" + token) | ||
split = urlsplit(response.headers["Location"]) | ||
|
@@ -402,7 +399,6 @@ def test_spa_get(app, client, get_message): | |
assert "/confirm-error" in response.location | ||
assert "email" not in qparams | ||
assert get_message("ALREADY_CONFIRMED") in qparams["info"].encode("utf-8") | ||
assert response.headers.get("Referrer-Policy", None) == "no-referrer" | ||
|
||
# Arguably for json we shouldn't have any - this is buried in register_user | ||
# but really shouldn't be. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters