CVE-2024-29042: Translate Cache Poisoning Vulnerability Vulnerability
MODERATECVE-2024-29042 is a MODERATE (CVSS 5.3) cache poisoning vulnerability vulnerability (CWE-20: Improper Input Validation) affecting Translate libraries in the npm ecosystem. The issue involves cache poisoning vulnerability. Remediation is available by upgrading affected packages to version 3.0.0.
CVE-2024-29042 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:L/PR:N/UI:N/S:U/C:N/I:L/A:N).
How to Fix CVE-2024-29042
To remediate this vulnerability, upgrade all affected Translate 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 translate@3.0.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls translate
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-29042, inspect your project dependencies using npm:
npm ls translate
Analyze the terminal output to locate any version of Translate in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.0.0), your application is affected.
Note: The npm ls translate 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Translate, 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-29042 Affected Translate Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
translate
|
npm |
< 3.0.0
|
3.0.0
|
References
Frequently Asked Questions
What is CVE-2024-29042?
Which Translate versions are affected?
What version fixes CVE-2024-29042?
Is translate affected?
What is the CVSS score of CVE-2024-29042?
What CWE is associated with CVE-2024-29042?
How can I check npm dependencies for CVE-2024-29042?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-882j-4vj5-7vmj",
"modified" : "2024-03-22T20:02:15Z",
"published" : "2024-03-22T16:57:21Z",
"aliases" : [ "CVE-2024-29042" ],
"summary" : "Cache Poisoning Vulnerability",
"details" : "### Summary\nAn attacker controlling the second variable of the `translate` function is able to perform a cache poisoning attack. They can change the outcome of translation requests made by subsequent users.\n\n### Details\nThe `opt.id` parameter allows the overwriting of the cache key. If an attacker sets the `id` variable to the cache key that would be generated by another user, they can choose the response that user gets served.\n\n### PoC\nTake the following simple server allowing users to supply text and the language to translate to.\n```javascript\nimport translate from \"translate\";\nimport express from 'express';\n\nconst app = express();\napp.use(express.json());\n\napp.post('/translate', async (req, res) => {\n const { text, language } = req.body;\n const result = await translate(text, language);\n return res.json(result);\n});\n\nconst port = 3000;\napp.listen(port, () => {\n console.log(`Server is running on port ${port}`);\n});\n```\n\nWe can send the following request to poison the cache:\n```\n{\"text\":\"I hate you\", \"language\":{\"to\":\"nl\",\"id\":\"undefined:en:nl:google:I love you\"}}\n```\n\n\nNow, any user that attempts to translate \"I love you\" to Dutch, will get \"I hate you\" in Dutch as the response.\n\n\n\n### Impact\nAn attacker can control the results other users may get\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "translate"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.0.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/franciscop/translate/security/advisories/GHSA-882j-4vj5-7vmj"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-29042"
}, {
"type" : "WEB",
"url" : "https://github.com/franciscop/translate/commit/7a2bf8b9f05f7c45c09683973ef4d8e995804aa4"
}, {
"type" : "WEB",
"url" : "https://github.com/franciscop/translate/commit/cc1ba03078102f83e0503a96f1a081489bb865d3"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/franciscop/translate"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-03-22T16:57:21Z",
"nvd_published_at" : "2024-03-22T17:15:07Z"
}
}