GHSA-vh9h-29pq-r5m8
CRITICALLocutus vulnerable to RCE via unsanitized input in create_function()
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
Blast Radius
Weekly download volume for affected packages — a proxy for how broadly this vulnerability is deployed.
locutusnpmDescription
Summary
The create_function(args, code) function passes both parameters directly to the Function constructor without any sanitization, allowing arbitrary code execution.
This 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.
Root Cause
src/php/funchand/create_function.ts:17:
return new Function(...params, code)
Zero input validation on either parameter.
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) ...
Confirmed on locutus v3.0.11, Node.js v24.13.1.
Impact
Full RCE when an attacker can control either argument to create_function(). 597K weekly npm downloads.
Suggested Fix
Remove create_function or replace new Function() with a safe alternative. PHP itself deprecated create_function() in PHP 7.2 for the same reason.
Response
Thanks for the report.
We confirmed that php/funchand/create_function was still present through [email protected] and that it exposed dynamic code execution via new Function(...).
While 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.
We fixed this in [email protected] by removing php/funchand/create_function entirely. That matches our PHP 8.3 parity target more closely: .
We 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.
Release:
- npm:
[email protected] - GitHub release: https://github.com/locutusjs/locutus/releases/tag/v3.0.14
Credit to @ByamB4 for the report.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | locutus | all versions | 3.0.14 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for locutus. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update locutus to 3.0.14 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-vh9h-29pq-r5m8 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-vh9h-29pq-r5m8 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-vh9h-29pq-r5m8. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-vh9h-29pq-r5m8 in your dependencies?
O3 detects GHSA-vh9h-29pq-r5m8 across npm dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.