Vulnerabilities in pkg:npm/cors-anywhere

PACKAGE
Advisory Identifier: GHSA-r3jv-xfgx-gj24
Advisory Summary

CVE-2020-36851 is a CRITICAL cors-anywhere vulnerable to server-side request vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Cors anywhere libraries in the npm ecosystem. The issue involves cors-anywhere vulnerable to server-side request forgery. Remediation is available in the latest vendor maintenance releases.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/cors-anywhere

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-r3jv-xfgx-gj24 CVE-2020-36851 CRITICAL cors-anywhere vulnerable to server-side request forgery

CVE-2020-36851 at a Glance

CVE Identifier CVE-2020-36851
GHSA Identifier GHSA-r3jv-xfgx-gj24
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Cors anywhere
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2020-36851

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

cors-anywhere fixed: Latest secure release
npm install cors-anywhere@Latest secure release
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 cors-anywhere

How to Check if You Are Affected

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

npm ls cors-anywhere

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

Note: The npm ls cors-anywhere 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-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Cors anywhere, 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

Rob -- W / cors-anywhere instances configured as an open proxy allow unauthenticated external users to induce the server to make HTTP requests to arbitrary targets (SSRF). Because the proxy forwards requests and headers, an attacker can reach internal-only endpoints and link-local metadata services, retrieve instance role credentials or other sensitive metadata, and interact with internal APIs and services that are not intended to be internet-facing. The vulnerability is exploitable by sending crafted requests to the proxy with the target resource encoded in the URL; many cors-anywhere deployments forward arbitrary methods and headers (including PUT), which can permit exploitation of IMDSv2 workflows as well as access to internal management APIs. Successful exploitation can result in theft of cloud credentials, unauthorized access to internal services, remote code execution or privilege escalation (depending on reachable backends), data exfiltration, and full compromise of cloud resources. Mitigation includes: restricting the proxy to trusted origins or authentication, whitelisting allowed target hosts, preventing access to link-local and internal IP ranges, removing support for unsafe HTTP methods/headers, enabling cloud provider mitigations, and deploying network-level protections.

CVE-2020-36851 Affected Cors anywhere Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
cors-anywhere
npm
≤ 0.4.4

References

Frequently Asked Questions

What is CVE-2020-36851?
CVE-2020-36851 is a security vulnerability in Cors anywhere involving cors-anywhere vulnerable to server-side request forgery under CWE-918: Server-Side Request Forgery (SSRF).
Which Cors anywhere versions are affected?
Affected versions include releases prior to current release patches across affected packages: cors-anywhere.
What version fixes CVE-2020-36851?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is cors-anywhere affected?
Yes, cors-anywhere is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with CVE-2020-36851?
CVE-2020-36851 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check npm dependencies for CVE-2020-36851?
Run the dependency tree command: 'npm ls cors-anywhere'. 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-r3jv-xfgx-gj24",
  "modified" : "2025-09-26T16:34:55Z",
  "published" : "2025-09-25T15:30:24Z",
  "aliases" : [ "CVE-2020-36851" ],
  "summary" : "cors-anywhere vulnerable to server-side request forgery",
  "details" : "Rob -- W / cors-anywhere instances configured as an open proxy allow unauthenticated external users to induce the server to make HTTP requests to arbitrary targets (SSRF). Because the proxy forwards requests and headers, an attacker can reach internal-only endpoints and link-local metadata services, retrieve instance role credentials or other sensitive metadata, and interact with internal APIs and services that are not intended to be internet-facing. The vulnerability is exploitable by sending crafted requests to the proxy with the target resource encoded in the URL; many cors-anywhere deployments forward arbitrary methods and headers (including PUT), which can permit exploitation of IMDSv2 workflows as well as access to internal management APIs. Successful exploitation can result in theft of cloud credentials, unauthorized access to internal services, remote code execution or privilege escalation (depending on reachable backends), data exfiltration, and full compromise of cloud resources. Mitigation includes: restricting the proxy to trusted origins or authentication, whitelisting allowed target hosts, preventing access to link-local and internal IP ranges, removing support for unsafe HTTP methods/headers, enabling cloud provider mitigations, and deploying network-level protections.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:H/SI:H/SA:H/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "cors-anywhere"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.4.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/SocketDev/security-research/security/advisories/GHSA-9wmg-93pw-fc3g"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-36851"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Rob--W/cors-anywhere/issues/152"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Rob--W/cors-anywhere/issues/521"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Rob--W/cors-anywhere/issues/78"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Rob--W/cors-anywhere"
  }, {
    "type" : "WEB",
    "url" : "https://www.certik.com/resources/blog/cors-anywhere-dangers-of-misconfigured-third-party-software"
  }, {
    "type" : "WEB",
    "url" : "https://www.vulncheck.com/advisories/rob-w-cors-anywhere-misconfigured-cors-proxy-allows-ssrf"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-09-25T16:47:59Z",
    "nvd_published_at" : "2025-09-25T15:16:01Z"
  }
}