CVE-2023-7080: Wrangler Remote Code Execution Vulnerability
CRITICALCVE-2023-7080 is a CRITICAL (CVSS 9.3) remote code execution vulnerability (CWE-269: Improper Privilege Management) affecting Wrangler libraries in the npm ecosystem. The issue involves arbitrary remote code execution within `wrangler dev` workers sandbox. Remediation is available by upgrading affected packages to version 3.19.0, 2.20.2.
CVE-2023-7080 at a Glance
Security Impact
CVSS: 9.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N).
How to Fix CVE-2023-7080
To remediate this vulnerability, upgrade all affected Wrangler dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install wrangler@3.19.0
npm install wrangler@2.20.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls wrangler
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2023-7080, inspect your project dependencies using npm:
npm ls wrangler
Analyze the terminal output to locate any version of Wrangler in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.19.0), your application is affected.
Note: The npm ls wrangler 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-269: Improper Privilege Management, where the product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor. In Wrangler, 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
CVE-2023-7080 Affected Wrangler Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
wrangler
|
npm |
≥ 3.0.0
< 3.19.0
|
3.19.0
|
|
wrangler
|
npm |
≥ 2.0.0
< 2.20.2
|
2.20.2
|
References
Frequently Asked Questions
What is CVE-2023-7080?
Which Wrangler versions are affected?
What version fixes CVE-2023-7080?
Is wrangler affected?
What is the CVSS score of CVE-2023-7080?
What CWE is associated with CVE-2023-7080?
How can I check npm dependencies for CVE-2023-7080?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-f8mp-x433-5wpf",
"modified" : "2024-01-03T21:26:50Z",
"published" : "2024-01-03T21:26:50Z",
"aliases" : [ "CVE-2023-7080" ],
"summary" : "Arbitrary remote code execution within `wrangler dev` Workers sandbox",
"details" : "### Impact\nThe V8 inspector intentionally allows arbitrary code execution within the Workers sandbox for debugging. `wrangler dev` would previously start an inspector server listening on all network interfaces. This would allow an attacker on the local network to connect to the inspector and run arbitrary code. Additionally, the inspector server did not validate `Origin`/`Host` headers, granting an attacker that can trick any user on the local network into opening a malicious website the ability to run code. If `wrangler dev --remote` was being used, an attacker could access production resources if they were bound to the worker.\n\n### Patches\nThis issue was fixed in `wrangler@3.19.0` and `wrangler@2.20.2`. Whilst `wrangler dev`'s inspector server listens on local interfaces by default as of `wrangler@3.16.0`, an [SSRF vulnerability in `miniflare`](https://github.com/cloudflare/workers-sdk/security/advisories/GHSA-fwvg-2739-22v7) allowed access from the local network until `wrangler@3.18.0`. `wrangler@3.19.0` and `wrangler@2.20.2` introduced validation for the `Origin`/`Host` headers.\n\n### Workarounds\nUnfortunately, Wrangler doesn't provide any configuration for which host that inspector server should listen on. Please upgrade to at least `wrangler@3.16.0`, and configure Wrangler to listen on local interfaces instead with `wrangler dev --ip 127.0.0.1` to prevent SSRF. This removes the local network as an attack vector, but does not prevent an attack from visiting a malicious website.\n\n### References\n- https://github.com/cloudflare/workers-sdk/issues/4430\n- https://github.com/cloudflare/workers-sdk/pull/4437\n- https://github.com/cloudflare/workers-sdk/pull/4535\n- https://github.com/cloudflare/workers-sdk/pull/4550\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "wrangler"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0"
}, {
"fixed" : "3.19.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "wrangler"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.20.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/cloudflare/workers-sdk/security/advisories/GHSA-f8mp-x433-5wpf"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-7080"
}, {
"type" : "WEB",
"url" : "https://github.com/cloudflare/workers-sdk/issues/4430"
}, {
"type" : "WEB",
"url" : "https://github.com/cloudflare/workers-sdk/pull/4437"
}, {
"type" : "WEB",
"url" : "https://github.com/cloudflare/workers-sdk/pull/4535"
}, {
"type" : "WEB",
"url" : "https://github.com/cloudflare/workers-sdk/pull/4550"
}, {
"type" : "WEB",
"url" : "https://github.com/cloudflare/workers-sdk/commit/05b1bbd2f5b8e60268e30c276067c3a3ae1239cf"
}, {
"type" : "WEB",
"url" : "https://github.com/cloudflare/workers-sdk/commit/29df8e17545bf3926b6d61678b596be809d40c6d"
}, {
"type" : "WEB",
"url" : "https://github.com/cloudflare/workers-sdk/commit/49a469601adaa9eb9e1f2d6de197c1979d5c6c1b"
}, {
"type" : "WEB",
"url" : "https://github.com/cloudflare/workers-sdk/commit/63708a94fb7a055bf15fa963f2d598b47b11d3c0"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/cloudflare/workers-sdk"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-269" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2024-01-03T21:26:50Z",
"nvd_published_at" : "2023-12-29T12:15:47Z"
}
}