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:
George K
2026-07-28 13:20:59 -07:00
committed by GitHub
co-authored by Bobby Ho
parent 09a69e624a
commit 8cc7f2bb0e
4 changed files with 63 additions and 2 deletions
+1 -1
View File
@@ -24212,7 +24212,7 @@ WHERE
(
(
$2 :: bool = true AND
url SIMILAR TO '[^:]*://' || $1 :: text || '([:/]?%)*'
url SIMILAR TO '[^:]*://' || $1 :: text || '([:/]%)*'
) OR
(
$3 :: bool = true AND