CVE-2024-43370: Gettext.js Cross-Site Scripting Vulnerability
HIGHCVE-2024-43370 is a HIGH (CVSS 7.2) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Gettext.js libraries in the npm ecosystem. The issue involves gettext.js has a cross-site scripting injection. Remediation is available by upgrading affected packages to version 2.0.3.
CVE-2024-43370 at a Glance
Security Impact
CVSS: 7.2
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:C/C:L/I:L/A:N).
How to Fix CVE-2024-43370
To remediate this vulnerability, upgrade all affected Gettext.js 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 gettext.js@2.0.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls gettext.js
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-43370, inspect your project dependencies using npm:
npm ls gettext.js
Analyze the terminal output to locate any version of Gettext.js in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.3), your application is affected.
Note: The npm ls gettext.js 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Gettext.js, 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-43370 Affected Gettext.js Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
gettext.js
|
npm |
< 2.0.3
|
2.0.3
|
References
Frequently Asked Questions
What is CVE-2024-43370?
Which Gettext.js versions are affected?
What version fixes CVE-2024-43370?
Is gettext.js affected?
What is the CVSS score of CVE-2024-43370?
What CWE is associated with CVE-2024-43370?
How can I check npm dependencies for CVE-2024-43370?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-vwhg-jwr4-vxgg",
"modified" : "2024-08-16T18:15:39Z",
"published" : "2024-08-15T18:06:50Z",
"aliases" : [ "CVE-2024-43370" ],
"summary" : "gettext.js has a Cross-site Scripting injection ",
"details" : "### Impact\nPossible vulnerability to XSS injection if .po dictionary definition files is corrupted\n\n### Patches\nUpdate gettext.js to 2.0.3\n\n### Workarounds\nMake sure you control the origin of the definition catalog to prevent the use of this flaw in the definition of plural forms.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "gettext.js"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.0.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/guillaumepotier/gettext.js/security/advisories/GHSA-vwhg-jwr4-vxgg"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-43370"
}, {
"type" : "WEB",
"url" : "https://github.com/guillaumepotier/gettext.js/commit/8150aeba833183e14c2291a8a148b8f79d1d68d8"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/guillaumepotier/gettext.js"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-08-15T18:06:50Z",
"nvd_published_at" : "2024-08-16T02:15:17Z"
}
}