CVE-2024-43370
High · 7.2CVSS
7.2
EPSS
0.4%
Published
Aug 16, 2024
CISA due date
—
Cloudanix analysis
A bug in a translation library can let attackers run harmful code in visitors' browsers if a corrupted language file is loaded.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Data Tampering
- Component
- Library
- Class
- XSS
- Remediation
- Upgrade
- Effort
- Low
- Patch risk
- Low
What it actually does
Corrupted .po dictionary files allow injection of arbitrary JavaScript into plural-form definitions that are later rendered without sanitization, resulting in reflected or stored XSS in applications using the library.
Why it matters to the business
Attackers can execute scripts in users' browsers, potentially stealing session data, performing unauthorized actions, or defacing pages served by applications that consume untrusted translation catalogs.
How an attack unfolds
An attacker crafts a malicious .po file containing JavaScript in a plural-forms header, hosts or supplies it to the target application, and waits for the gettext.js library to parse and render the corrupted definition, executing the payload in the victim's browser context.
How to fix it
Upgrade guillaumepotier/gettext.js to version 2.0.3 or later (commit 5d18cb4e512eba1210ab7cead968ed85483323e4). As a temporary control, ensure all .po catalog files originate from trusted, authenticated sources only.
How to confirm the fix worked
Verify the installed package version or commit hash matches the fixed release; test by loading a known-malicious .po file and confirming that script execution is blocked.
Typical attack path
- Identify an application that loads .po catalogs from an attacker-influenced source
- Craft a .po file with JavaScript payload inside the Plural-Forms header
- Deliver the file via upload, supply-chain substitution, or MITM on catalog retrieval
- Trigger catalog loading in a victim browser session
- Execute arbitrary client-side code via the unsanitized plural-form evaluation
How to detect it
Search web server and application logs for unexpected plural-forms values containing script tags or event handlers; monitor for unusual JavaScript execution originating from translation catalog parsing.
What your security team should do
- Immediately audit all applications for direct or transitive use of gettext.js and schedule upgrades to the fixed commit
- Implement origin validation and integrity checks on all translation catalog files before parsing
- Add automated dependency scanning to CI pipelines to block future vulnerable versions
- Review and restrict any user-supplied or third-party .po file ingestion paths
The record
gettext.js is a GNU gettext port for node and the browser. There is a cross-site scripting (XSS) injection if `.po` dictionary definition files are corrupted. This vulnerability has been patched in version 2.0.3. As a workaround, control the origin of the definition catalog to prevent the use of this flaw in the definition of plural forms.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| npm | gettext.js | 0 | 2.0.3 |
| Debian:11 | gettext.js | 0 | 0.7.0-2+deb11u1 |
| Debian:12 | gettext.js | 0 | 0.7.0-2+deb11u1 |
| Debian:13 | gettext.js | 0 | 0.7.0-4 |
| Ubuntu:18.04:LTS | gettext.js | 0 | No fix |
| Ubuntu:20.04:LTS | gettext.js | 0 | No fix |
| Ubuntu:22.04:LTS | gettext.js | 0 | No fix |
| Ubuntu:24.04:LTS | gettext.js | 0 | No fix |
| Ubuntu:24.10 | gettext.js | 0 | 0.7.0-4 |
| Ubuntu:Pro:18.04:LTS | gettext.js | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | gettext.js | 0 | No fix |
Related vulnerabilities
- CVE-2026-96379 Improper Neutralization of Input During Web Page Generation ("Cross-site Scripting")… CWE-79
- CVE-2026-96382 Improper Neutralization of Input During Web Page Generation ("Cross-site Scripting")… CWE-79
- CVE-2026-96368 Improper Neutralization of Input During Web Page Generation ("Cross-site Scripting")… CWE-79
- CVE-2026-96361 Improper Neutralization of Input During Web Page Generation ("Cross-site Scripting")… CWE-79
- CVE-2026-96362 Improper Neutralization of Input During Web Page Generation ("Cross-site Scripting")… CWE-79
- CVE-2026-96360 Improper Neutralization of Input During Web Page Generation ("Cross-site Scripting")… CWE-79
- CVE-2026-96357 Improper Neutralization of Input During Web Page Generation ("Cross-site Scripting")… CWE-79
- CVE-2026-96358 Improper Neutralization of Input During Web Page Generation ("Cross-site Scripting")… CWE-79