CVE-2026-32304: Locutus Remote Code Execution Vulnerability
CRITICALCVE-2026-32304 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Locutus libraries in the npm ecosystem. The issue involves locutus vulnerable to rce via unsanitized input in create_function(). Remediation is available by upgrading affected packages to version 3.0.14.
CVE-2026-32304 at a Glance
Security Impact
CVSS: 9.8
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:U/C:H/I:H/A:H).
How to Fix CVE-2026-32304
To remediate this vulnerability, upgrade all affected Locutus 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 locutus@3.0.14
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls locutus
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-32304, inspect your project dependencies using npm:
npm ls locutus
Analyze the terminal output to locate any version of Locutus in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.0.14), your application is affected.
Note: The npm ls locutus 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Locutus, 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-2026-32304 Affected Locutus Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
locutus
|
npm |
< 3.0.14
|
3.0.14
|
References
Frequently Asked Questions
What is CVE-2026-32304?
Which Locutus versions are affected?
What version fixes CVE-2026-32304?
Is locutus affected?
What is the CVSS score of CVE-2026-32304?
What CWE is associated with CVE-2026-32304?
How can I check npm dependencies for CVE-2026-32304?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-vh9h-29pq-r5m8",
"modified" : "2026-03-16T17:06:41Z",
"published" : "2026-03-13T16:10:29Z",
"aliases" : [ "CVE-2026-32304" ],
"summary" : "Locutus vulnerable to RCE via unsanitized input in create_function()",
"details" : "## Summary\n\nThe `create_function(args, code)` function passes both parameters directly to the `Function` constructor without any sanitization, allowing arbitrary code execution.\n\nThis is distinct from CVE-2026-29091 (GHSA-fp25-p6mj-qqg6) which was `call_user_func_array` using `eval()` in v2.x. This finding affects `create_function` using `new Function()` in v3.x.\n\n## Root Cause\n\n`src/php/funchand/create_function.ts:17`:\n```typescript\nreturn new Function(...params, code)\n```\n\nZero input validation on either parameter.\n\n## PoC\n\n```javascript\nconst { create_function } = require('locutus/php/funchand/create_function');\nconst rce = create_function('', 'return require(\"child_process\").execSync(\"id\").toString()');\nconsole.log(rce());\n// Output: uid=501(user) gid=20(staff) ...\n```\n\nConfirmed on locutus v3.0.11, Node.js v24.13.1.\n\n## Impact\n\nFull RCE when an attacker can control either argument to `create_function()`. 597K weekly npm downloads.\n\n## Suggested Fix\n\nRemove `create_function` or replace `new Function()` with a safe alternative. PHP itself deprecated `create_function()` in PHP 7.2 for the same reason.\n\n## Response\n\nThanks for the report.\n\nWe confirmed that `php/funchand/create_function` was still present through `locutus@3.0.13` and that it exposed dynamic code execution via `new Function(...)`.\n\nWhile this was intended behavior, `create_function()` inherently needs to be unsafe in order for it to work, `create_function()` was deprecated in PHP 7.2 and removed in PHP 8.0. Given that Locutus' parity target today is 8.3, this function shouldn't have been in Locutus at all anymore.\n\nWe fixed this in `locutus@3.0.14` by removing `php/funchand/create_function` entirely. That matches our PHP 8.3 parity target more closely: . \n\nWe also updated `php/var/var_export` so closures now export using the PHP 8-style `\\Closure::__set_state(array(...))` form instead of referencing the removed API.\n\nRelease:\n- npm: `locutus@3.0.14`\n- GitHub release: https://github.com/locutusjs/locutus/releases/tag/v3.0.14\n\nCredit to @ByamB4 for the report.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "locutus"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.0.14"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 3.0.13"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/locutusjs/locutus/security/advisories/GHSA-vh9h-29pq-r5m8"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-32304"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/locutusjs/locutus"
}, {
"type" : "WEB",
"url" : "https://github.com/locutusjs/locutus/releases/tag/v3.0.14"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-13T16:10:29Z",
"nvd_published_at" : "2026-03-13T19:54:41Z"
}
}