{"id":"CVE-2024-29042","aliases":["CVE-2024-29042","GHSA-882j-4vj5-7vmj"],"related":[],"kind":"vulnerability","state":"published","title":"Translate Cache Poisoning Vulnerability","summary":"Translate is a package that allows users to convert text to different languages on Node.js and the browser. Prior to version 3.0.0, an 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. The `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. Version 3.0.0 fixes this issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Translate is a package that allows users to convert text to different languages on Node.js and the browser. Prior to version 3.0.0, an 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. The `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. Version 3.0.0 fixes this issue.","source":"cvelist"},{"lang":"en","text":"### 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![Poisoning the cache](https://user-images.githubusercontent.com/44903767/285421743-ccfa3d9d-24cf-47b7-b805-0e4034cec82e.png)\n\nNow, any user that attempts to translate \"I love you\" to Dutch, will get \"I hate you\" in Dutch as the response.\n![The victim gets our poisoned data](https://user-images.githubusercontent.com/44903767/285422033-b3853ca2-8a5a-4875-91e8-ba2ef0258bc6.png)\n\n\n### Impact\nAn attacker can control the results other users may get","format":"markdown","source":"ghsa"},{"lang":"es","text":"Translate es un paquete que permite a los usuarios convertir texto a diferentes idiomas en Node.js y el navegador. Antes de la versión 3.0.0, un atacante que controlaba la segunda variable de la función \"traducir\" podía realizar un ataque de envenenamiento de caché. Pueden cambiar el resultado de las solicitudes de traducción realizadas por usuarios posteriores. El parámetro `opt.id` permite sobrescribir la clave de caché. Si un atacante establece la variable `id` en la clave de caché que generaría otro usuario, puede elegir la respuesta que recibirá ese usuario. La versión 3.0.0 soluciona este problema.","source":"nvd"}],"published":"2024-03-22T16:46:21.456Z","modified":"2026-09-10T03:50:00.241Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-20"],"affected":[{"ranges":[{"version":"< 3.0.0","status":"affected"}],"vendor":"franciscop","product":"translate","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"0","fixed":"3.0.0","status":"affected"}],"vendor":"franciscop","product":"translate","cpe":"cpe:2.3:a:franciscop:translate:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.0.0"}],"ecosystem":"npm","package":"translate","purl":"pkg:npm/translate","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.0.0"}],"vendor":"francisco","product":"translate","cpe":"cpe:2.3:a:francisco:translate:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/franciscop/translate/security/advisories/GHSA-882j-4vj5-7vmj","tags":["exploit","vendor-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/franciscop/translate/commit/7a2bf8b9f05f7c45c09683973ef4d8e995804aa4","tags":["patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/franciscop/translate/commit/cc1ba03078102f83e0503a96f1a081489bb865d3","tags":["patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-29042","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/franciscop/translate","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2024-08-01T20:47:55.700Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-29042","url":"https://www.cve.org/CVERecord?id=CVE-2024-29042","licence":"CVE Terms of Use","modified":"2024-08-02T01:03:51.704Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-882j-4vj5-7vmj","url":"https://github.com/advisories/GHSA-882j-4vj5-7vmj","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:00.241Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-29042","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-29042","licence":"Public domain","modified":"2026-06-17T07:22:18.630Z"}],"updatedAt":"2026-11-25T22:58:37.852Z","epss":{"score":0.0065,"percentile":0.52437,"date":"2026-12-01T12:00:22.000Z"}}