Vulnerabilities in pkg:npm/@fastly/js-compute
PACKAGECVE-2024-38375 is a MODERATE (CVSS 5.3) @fastly/js-compute has a use-after-free vulnerability (CWE-416: Use After Free) affecting @fastly/js compute libraries in the npm ecosystem. The issue involves @fastly/js-compute has a use-after-free in some host call implementations. Remediation is available by upgrading affected packages to version 3.16.0.
pkg:npm/@fastly/js-compute
Vulnerability advisories affecting package pkg:npm/@fastly/js-compute. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-mp3g-vpm9-9vqv | CVE-2024-38375 | MODERATE | @fastly/js-compute has a use-after-free in some host call implementations |
| GHSA-cmr8-5w4c-44v8 | CVE-2022-39218 | HIGH | Fastly Compute@Edge JS Runtime has fixed random number seed during compilation |
CVE-2024-38375 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:H).
How to Fix CVE-2024-38375
To remediate this vulnerability, upgrade all affected @fastly/js compute 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 @fastly/js-compute@3.16.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @fastly/js-compute
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-38375, inspect your project dependencies using npm:
npm ls @fastly/js-compute
Analyze the terminal output to locate any version of @fastly/js compute in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.16.0), your application is affected.
Note: The npm ls @fastly/js-compute 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-416: Use After Free, where the product reuses or references memory after it has been freed. at some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer. In @fastly/js compute, 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-2024-38375 Affected @fastly/js compute Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@fastly/js-compute
|
npm |
≥ 3.0.0
< 3.16.0
|
3.16.0
|
References
Frequently Asked Questions
What is CVE-2024-38375?
Which @fastly/js compute versions are affected?
What version fixes CVE-2024-38375?
Is @fastly/js-compute affected?
What is the CVSS score of CVE-2024-38375?
What CWE is associated with CVE-2024-38375?
How can I check npm dependencies for CVE-2024-38375?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mp3g-vpm9-9vqv",
"modified" : "2024-06-26T21:56:15Z",
"published" : "2024-06-26T19:12:23Z",
"aliases" : [ "CVE-2024-38375" ],
"summary" : "@fastly/js-compute has a use-after-free in some host call implementations",
"details" : "### Impact\nThe implementation of the following functions were determined to include a use-after-free bug:\n\n* `FetchEvent.client.tlsCipherOpensslName`\n* `FetchEvent.client.tlsProtocol`\n* `FetchEvent.client.tlsClientCertificate`\n* `FetchEvent.client.tlsJA3MD5`\n* `FetchEvent.client.tlsClientHello`\n* `CacheEntry.prototype.userMetadata` of the `fastly:cache` subsystem\n* `Device.lookup` of the `fastly:device` subsystem\n\nThis bug could allow for an unintended data leak if the result of the preceding functions were sent anywhere else, and often results in a Compute service crash causing an HTTP 500 error to be returned. As all requests to Compute are isolated from one another, the only data at risk is data present for a single request.\n\n### Patches\nThis bug has been fixed in version 3.16.0 of the `@fastly/js-compute` package.\n\n### Workarounds\nThere are no workarounds for this bug, any use of the affected functions introduces the possibility of a data leak or crash in guest code.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@fastly/js-compute"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0"
}, {
"fixed" : "3.16.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/fastly/js-compute-runtime/security/advisories/GHSA-mp3g-vpm9-9vqv"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-38375"
}, {
"type" : "WEB",
"url" : "https://github.com/fastly/js-compute-runtime/commit/4e16641ef4e159c4a11b500ac861b8fa8d9ff5d3"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/fastly/js-compute-runtime"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-416" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-06-26T19:12:23Z",
"nvd_published_at" : "2024-06-26T19:15:13Z"
}
}