mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(coderd): reject workspace proxy hostname prefixes (#27544)
A workspace proxy hostname prefix could be accepted as a valid proxy access URL. An authenticated user could then be redirected to an attacker-controlled domain with an application-connect API key in the URL. Require proxy access URL matches to have a hostname boundary after the candidate hostname, allowing only the end of the URL, a port, or a path. Add regression coverage for proxy access URL and wildcard hostname prefixes. Refs: https://linear.app/codercom/issue/PLAT-384 --------- Co-authored-by: Bobby Ho <bobbidinho@gmail.com>
This commit is contained in:
@@ -120,7 +120,7 @@ WHERE
|
||||
(
|
||||
(
|
||||
@allow_access_url :: bool = true AND
|
||||
url SIMILAR TO '[^:]*://' || @hostname :: text || '([:/]?%)*'
|
||||
url SIMILAR TO '[^:]*://' || @hostname :: text || '([:/]%)*'
|
||||
) OR
|
||||
(
|
||||
@allow_wildcard_hostname :: bool = true AND
|
||||
|
||||
Reference in New Issue
Block a user