Skip to content

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

High severity GitHub Reviewed Published May 9, 2025 in coder/code-server • Updated May 9, 2025

Package

npm code-server (npm)

Affected versions

< 4.99.4

Patched versions

4.99.4

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.

References

@code-asher code-asher published to coder/code-server May 9, 2025
Published to the GitHub Advisory Database May 9, 2025
Reviewed May 9, 2025
Published by the National Vulnerability Database May 9, 2025
Last updated May 9, 2025

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L

EPSS score

Weaknesses

CVE ID

CVE-2025-47269

GHSA ID

GHSA-p483-wpfp-42cj

Source code

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.