# CVE-2024-29042: Translate Cache Poisoning Vulnerability

> An attacker can poison the translation cache to serve malicious or incorrect translations to other users by manipulating the cache key.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 22 Mar 2024
- **Updated:** 2 Aug 2024
- **Also known as:** GHSA-882j-4vj5-7vmj

## What is CVE-2024-29042?

CVE-2024-29042 is a medium-severity vulnerability in franciscop translate, published on 22 Mar 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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.

Weakness: CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2024-29042?

2 open source packages ship an affected version, including translate. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `translate` | npm | All versions | 3.0.0 |
| `translate` | npm | All versions | 3.0.0 |

Products: Francisco Translate.

## How do I fix CVE-2024-29042?

Upgrade translate to 3.0.0 or later.

## Is CVE-2024-29042 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-29042 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-29042 and fix it if it is affected.

What it is: CVE-2024-29042 is a medium-severity vulnerability in franciscop translate, published on 22 Mar 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-29042 exists.

Affected packages and fixed versions:
- translate (npm): affected all versions; fixed in 3.0.0
- translate (npm): affected all versions; fixed in 3.0.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-29042/ (Markdown: https://insights.sbomify.com/CVE-2024-29042/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-29042
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-29042
- OSV: https://osv.dev/vulnerability/CVE-2024-29042

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-29042/
Summaries are generated and may contain mistakes; the official description above is the record.
