CVE-2026-32304: Locutus Package Vulnerable to RCE via Unsanitized Input in create_function()

locutus Updated 13 Mar 2026

Summary

13/03/2026
Yes i
Critical
9.8

CVE-2026-32304: Locutus vulnerable to RCE via unsanitized input in create_function(). Affects locutus versions < 3.0.14. Fixed in 3.0.14. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Locutus is a JavaScript library that provides PHP functions for Node.js environments, allowing developers to use PHP-like syntax in their JavaScript applications. It aims to bridge the gap between PHP and JavaScript, enabling easier migration of PHP code to JavaScript. However, a critical vulnerability has been identified in the 'create_function()' method, which can lead to remote code execution (RCE) when unsanitized input is processed.

Vulnerability Detail

The vulnerability arises from the 'create_function(args, code)' function, which directly passes its parameters to the 'Function' constructor without any input validation. This oversight allows an attacker to execute arbitrary code by controlling either the 'args' or 'code' parameters. The issue is particularly severe as it can lead to full remote code execution, impacting systems that utilize this function. The vulnerability has been confirmed in Locutus version 3.0.11 and can be exploited using a simple JavaScript snippet that executes system commands.

How To Fix

Latest published version: 3.0.36 as of 23 Oct 2026

npm install locutus@3.0.36

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.0.14

This is the first release that contains the fix.

npm install locutus@3.0.14

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a workaround, avoid using the 'create_function()' method in your code. If you need similar functionality, consider implementing a safe alternative that does not rely on dynamic code execution. For example, you can use predefined functions or closures instead of creating functions dynamically.

Conclusion

The CVE-2026-32304 vulnerability in the Locutus package poses a significant risk due to its potential for remote code execution. It is crucial for developers using this library to update to the patched version 3.0.14 to mitigate the risk. Additionally, utilizing tools like Vulert can help monitor and manage vulnerabilities in open-source software effectively.

See every vulnerability recorded for locutus →

Share this vulnerability

FAQ

The CVE-2026-32304 vulnerability has a CVSS score of 9.8, indicating a critical level of severity.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. You can check your application without any signup using the Vulert playground at Vulert Scanner.

Exploitation of this vulnerability can lead to remote code execution, allowing attackers to execute arbitrary commands on the server, potentially compromising the entire system.

Yes, instead of using 'create_function()', consider using predefined functions or closures that do not involve dynamic code execution.

Versions of Locutus up to and including 3.0.13 are affected by this vulnerability. The issue has been fixed in version 3.0.14.

Related vulnerabilities

Recent vulnerabilities recorded for locutus.

How To Fix

Latest published version: 3.0.36 as of 23 Oct 2026

npm install locutus@3.0.36

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.0.14

This is the first release that contains the fix.

npm install locutus@3.0.14

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback