Vulnerabilities in pkg:npm/workerd
PACKAGECVE-2023-2512 is a MODERATE (CVSS 6.5) buffer under-read vulnerability (CWE-190: Integer Overflow or Wraparound) affecting Workerd libraries in the npm ecosystem. The issue involves buffer under-read in workerd. Remediation is available by upgrading affected packages to version 1.20230419.0.
pkg:npm/workerd
Vulnerability advisories affecting package pkg:npm/workerd. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-8vx6-69vg-c46f | CVE-2023-2512 | MODERATE | Buffer under-read in workerd |
CVE-2023-2512 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:H).
How to Fix CVE-2023-2512
To remediate this vulnerability, upgrade all affected Workerd 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 workerd@1.20230419.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls workerd
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2023-2512, inspect your project dependencies using npm:
npm ls workerd
Analyze the terminal output to locate any version of Workerd in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.20230419.0), your application is affected.
Note: The npm ls workerd 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-190: Integer Overflow or Wraparound, where the product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. this occurs when an integer value is incremented to a value that is too large to store in the associated representation. when this occurs, the value may become a very small or negative number. In Workerd, 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-2512 Affected Workerd Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
workerd
|
npm |
< 1.20230419.0
|
1.20230419.0
|
References
Frequently Asked Questions
What is CVE-2023-2512?
Which Workerd versions are affected?
What version fixes CVE-2023-2512?
Is workerd affected?
What is the CVSS score of CVE-2023-2512?
What CWE is associated with CVE-2023-2512?
How can I check npm dependencies for CVE-2023-2512?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8vx6-69vg-c46f",
"modified" : "2023-05-12T20:16:38Z",
"published" : "2023-05-12T20:16:38Z",
"aliases" : [ "CVE-2023-2512" ],
"summary" : "Buffer under-read in workerd",
"details" : "### Impact\nPrior to version v1.20230419.0, the FormData API implementation was subject to an integer overflow. If a FormData instance contained more than 2^31 elements, the `forEach()` method could end up reading from the wrong location in memory while iterating over elements. This would most likely lead to a segmentation fault, but could theoretically allow arbitrary undefined behavior.\n\nIn order for the bug to be exploitable, the process would need to be able to allocate 160GB of RAM. Due to this, the bug was never exploitable on the Cloudflare Workers platform, but could theoretically be exploitable on deployments of workerd running on machines with a huge amount of memory. Moreover, in order to be remotely exploited, an attacker would have to upload a single form-encoded HTTP request of at least tens of gigabytes in size. The application code would then have to use `request.formData()` to parse the request and `formData.forEach()` to iterate over this data. Due to these limitations, the exploitation likelihood was considered Low.\n\n### Patches\nA fix that addresses this vulnerability has been released in version v1.20230419.0 and users are encouraged to update to the latest version available.\n\n### References\nRelease - https://github.com/cloudflare/workerd/releases/tag/v1.20230419.0",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "workerd"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.20230419.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/cloudflare/workerd/security/advisories/GHSA-8vx6-69vg-c46f"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-2512"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/cloudflare/workerd"
}, {
"type" : "WEB",
"url" : "https://github.com/cloudflare/workerd/releases/tag/v1.20230419.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-125", "CWE-127", "CWE-190" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-05-12T20:16:38Z",
"nvd_published_at" : "2023-05-12T11:15:13Z"
}
}