Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Use a wildcard for redirect domains #2029

Merged
merged 1 commit into from
Apr 13, 2021
Merged

Use a wildcard for redirect domains #2029

merged 1 commit into from
Apr 13, 2021

Conversation

sethvargo
Copy link
Member

There's a limit of 50 path_matchers on a url map. Fortunately it supports wildcards :). This properly allows any subdomain to redirect to the https version. It doesn't 100% prevent host-header injection, but it does prevent an attacker from redirecting to an arbitrary host; it's only possible to redirect to another host on the same domain (which we control and does not serve user content).

This also changes redirects from 301 -> 302. In testing, my browser cached the redirect, which was somewhat annoying. Given that we may change these, 302 feels more appropriate.

Release Note

Use a wildcard for redirect domains. This fixes an issue for installations with more than 50 realms exceeding the limit on the URL map.

There's a limit of 50 path_matchers on a url map. Fortunately it supports wildcards :). This properly allows any subdomain to redirect to the https version. It doesn't 100% prevent host-header injection, but it does prevent an attacker from redirecting to an arbitrary host; it's only possible to redirect to another host on the same domain (which we control and does not serve user content).

This also changes redirects from 301 -> 302. In testing, my browser cached the redirect, which was somewhat annoying. Given that we may change these, 302 feels more appropriate.
@sethvargo sethvargo requested a review from a team as a code owner April 13, 2021 21:12
@google-cla google-cla bot added the cla: yes Auto: added by CLA bot when all committers have signed a CLA. label Apr 13, 2021
@sethvargo sethvargo enabled auto-merge (squash) April 13, 2021 21:16
@sethvargo sethvargo merged commit 25c03b1 into main Apr 13, 2021
@sethvargo sethvargo deleted the sethvargo/lb branch April 13, 2021 22:25
sethvargo added a commit that referenced this pull request Apr 13, 2021
There's a limit of 50 path_matchers on a url map. Fortunately it supports wildcards :). This properly allows any subdomain to redirect to the https version. It doesn't 100% prevent host-header injection, but it does prevent an attacker from redirecting to an arbitrary host; it's only possible to redirect to another host on the same domain (which we control and does not serve user content).

This also changes redirects from 301 -> 302. In testing, my browser cached the redirect, which was somewhat annoying. Given that we may change these, 302 feels more appropriate.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Auto: added by CLA bot when all committers have signed a CLA. kind/infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants