9.4critical
Locutus is vulnerable to Prototype Pollution
- Severity
- 9.4critical CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.31% (higher than 26% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-rxrv-835q-v5mh
Description
Locutus brings stdlibs of other programming languages to JavaScript for educational purposes. In versions from 2.0.12 to before 2.0.39, a prototype pollution vulnerability exists in locutus. Despite a previous fix that attempted to mitigate prototype pollution by checking whether user input contained a forbidden key, it is still possible to pollute Object.prototype via a crafted input using String.prototype. This issue has been patched in version 2.0.39.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| locutusjs locutus | >= 2.0.12, < 2.0.39 | CVE List |
| openshift-logging/elasticsearch6-rhel9 | Not specified | CVE List |
| openshift-logging/elasticsearch-operator-bundle | Not specified | CVE List |
| openshift-logging/elasticsearch-proxy-rhel9 | Not specified | CVE List |
| openshift-logging/elasticsearch-rhel9-operator | Not specified | CVE List |
| openshift-logging/kibana6-rhel8 | Not specified | CVE List |
| openshift-logging/logging-curator5-rhel9 | Not specified | CVE List |
| locutus (npm) | from 2.0.12 before 2.0.39 | GitHub Advisory Database |
| locutus locutus | from 2.0.12 before 2.0.39 | NVD |
All scores
| GitHub_M | 9.4critical CVSS:4.0 | CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H |
| redhat-SADP | 9.3critical CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H |
| GitHub | critical CVSS:4.0 | CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H |
| NVD | 8.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H |
Classification
What each source says
CVE List
Locutus brings stdlibs of other programming languages to JavaScript for educational purposes. In versions from 2.0.12 to before 2.0.39, a prototype pollution vulnerability exists in locutus. Despite a previous fix that attempted to mitigate prototype pollution by checking whether user input contained a forbidden key, it is still possible to pollute Object.prototype via a crafted input using String.prototype. This issue has been patched in version 2.0.39.
GitHub Advisory Database
Summary
A Prototype Pollution vulnerability exists in the the npm package locutus (>2.0.12). Despite a previous fix that attempted to mitigate Prototype Pollution by checking whether user input contained a forbidden key, it is still possible to pollute Object.prototype via a crafted input using String.prototype. This issue was fixed in version 2.0.39.
Details
The vulnerability resides in line 77 to 79 of https://github.com/locutusjs/locutus/blob/main/src/php/strings/parse_str.js where includes() function is used to check whether user provided input contain forbidden strings.
PoC
Steps to reproduce
- Install latest version of locutus using npm install or cloning from git
- Run the following code snippet:
String.prototype.includes = () => false;
console.log({}.polluted);
const locutus = require('locutus');
locutus.php.strings.parse_str('constructor[prototype][polluted]=yes');
console.log({}.polluted); // prints yes -> indicating that the patch was bypassed and Prototype Pollution occurred
Expected behavior
Prototype Pollution should be prevented and {} should not gain new properties. This should be printed on the console:
undefined
undefined OR throw an Error
Actual behavior
Object.prototype is polluted This is printed on the console:
undefined
yes
Impact
This is a Prototype Pollution vulnerability, which can have severe security implications depending on how locutus is used by downstream applications. Any application that processes attacker-controlled input using this locutus.php.strings.parse_str may be affected. It could potentially lead to the following problems:
- Authentication bypass
- Denial of service
- Remote code execution (if polluted property is passed to sinks like eval or child_process)
NVD (es)
Locutus incorpora librerías estándar de otros lenguajes de programación a JavaScript con fines educativos. En las versiones desde la 2.0.12 hasta antes de la 2.0.39, existe una vulnerabilidad de contaminación de prototipos en Locutus. A pesar de una corrección anterior que intentó mitigar la contaminación de prototipos verificando si la entrada del usuario contenía una clave prohibida, todavía es posible contaminar Object.prototype mediante una entrada manipulada utilizando String.prototype. Este problema ha sido corregido en la versión 2.0.39.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-25521 changed 2026-07-15 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-rxrv-835q-v5mh changed 2026-10-05 | CC-BY-4.0 |
| NVD | CVE-2026-25521 changed 2026-07-15 | Public domain |