fix: redirect only to the request's own origin while REDIRECT_DOMAINS is empty #3
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Keel-Linux/anubis!3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/redir-same-host"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes pass-challenge's open redirect without needing
REDIRECT_DOMAINS(review of Keel-Linux/keel-web#3).Root cause: with
REDIRECT_DOMAINSempty,PassChallengecompares the host ofredirwith itself, becauser.URLisredirparsed again. A solved challenge can therefore be sent to any host. SettingREDIRECT_DOMAINScloses this only for the names listed in it. Keel Web cannot list every name ahead of time: a new DNS name, a site from decision 0042, or a cloud public IP behind NAT would each hitredirect_domain_not_allowed.Change (1.27.0-0+keel3,
debian/patches/redir-same-host.patch, DEP-3): a newredirectAllowedfunction decides:redirREDIRECT_DOMAINSsetREDIRECT_DOMAINSemptyX-Forwarded-Proto, or http, plusHost, with default ports filled in)Tests:
TestRedirectAllowed, 18 cases. It covers the same host by name, by a name not in/etc/hosts, by IPv4 and by an IPv6 literal. It refuses another host,//evil,https://a@evil,https://host@evil, another port and another scheme.pass-challengebehind nginx with a made-up challenge. The redir check runs first, so the error page shows which way it went. Allowed: same host by an unlisted name, a relative redir, an IPv6 literal. Refused: another host,//evil, userinfo, another IPv6 address.Test plan
build / trixieandautopkgtest / trixiegreenREDIRECT_DOMAINSempty