code-server's session cookie can be extracted by having user visit specially crafted proxy URL

Description

Summary

A maliciously crafted URL using the proxy subpath can result in the attacker gaining access to the session token.

Details

Failure to properly validate the port for a proxy request can result in proxying to an arbitrary domain. The malicious URL https://<code-server>/proxy/[email protected]/path would be proxied to [email protected]/path where the attacker could exfiltrate a user's session token.

Impact

Any user who runs code-server with the built-in proxy enabled and clicks on maliciously crafted links that go to their code-server instances with reference to /proxy.

Normally this is used to proxy local ports, however the URL can reference the attacker's domain instead, and the connection is then proxied to that domain, which will include sending cookies.

With access to the session cookie, the attacker can then log into code-server and have full access to the machine hosting code-server as the user running code-server.

Patches

Patched versions are from v4.99.4 onward.

Basic information

Type
reviewed
Severity
high
Advisory on GitHub
Open advisory ↗
Repository advisory
Open repository advisory ↗
Source code
Browse source ↗
Published (advisory)
2025-05-09 19:34:35 UTC
Updated
2025-05-09 21:39:17 UTC
GitHub reviewed
2025-05-09 19:34:35 UTC
NVD published
2025-05-09 21:15:51 UTC

EPSS Score

Score Percentile
0.33% 56.10%

CVSS Scores

Base score Version Severity Vector
8.3 3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:R)
A real person has to do something—click, install, enable—otherwise it doesn’t land.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:L)
Might cause slowdowns, glitches, or partial disruption—not a full brick.

Identifiers

CWEs

CWE id Name
CWE-441 Unintended Proxy or Intermediary ('Confused Deputy')

Affected packages (1)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
npm code-server < 4.99.4 4.99.4

References

cvelogic Threat Intelligence