Summary
Flowise contains a sandbox escape in its JavaScript execution environment, where attacker-controlled process-launch parameters can reach an operating system process-spawning API outside the sandbox boundary.
An authenticated user with access to the custom-function endpoint may execute arbitrary OS commands as the Flowise process and potentially disclose host files, depending on deployment privileges and configuration.
Affected context
The vulnerability occurs in Flowise deployments that expose the authenticated custom-function API and execute user-controlled JavaScript through the vm2 or @flowiseai/nodevm sandbox. The risk is higher when the sandboxed code can influence Puppeteer launch options, when built-in dependencies are enabled in affected configurations, or when the Flowise process has elevated container or host access.
Exploit preconditions
- Attack surface: The authenticated
/api/v1/node-custom-functionendpoint - Required access: An authenticated account authorized to submit or execute custom functions
- Trigger point: Processing attacker-controlled
executablePathandargsvalues during a Puppeteer launch operation - Why exploitation is possible: The launch path invokes process-spawning functionality outside the JavaScript sandbox boundary, allowing supplied process parameters to affect the operating system
- Deployment dependency: Impact depends on runtime configuration, enabled built-in dependencies, process privileges, and container isolation
Why this happens
The underlying bug is an incomplete sandbox boundary. Although custom JavaScript is evaluated inside a restricted virtual machine, attacker-influenced values are passed to a library API that ultimately invokes the operating system process-spawning mechanism outside that boundary.
This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command or Argument, because untrusted input can influence executable and argument selection for an operating system process. It also represents a broader sandbox escape caused by exposing privileged host capabilities through an insufficiently isolated library integration.
Potential impact
- An attacker may execute arbitrary operating system commands as the Flowise process
- A compromised process may disclose files accessible to its operating-system account
- The attacker could access sensitive application configuration, credentials, or workflow data
- A container running with excessive privileges could allow broader service or host compromise
- The vulnerability could enable persistence, data manipulation, or lateral movement
General mitigation guidance
Mitigation generally focuses on preserving the sandbox boundary and reducing the capabilities available to custom-function execution.
Common defensive patterns include:
- Preventing untrusted values from selecting executables or controlling process-spawning APIs
- Allowing only fixed, explicitly approved launch configurations
- Removing direct access from sandboxed code to process, filesystem, and child-process capabilities
- Applying strict schema validation and allowlists before invoking browser or system integrations
- Running Flowise with a dedicated non-root account and minimal filesystem, network, and container privileges
- Using read-only filesystems, restrictive container profiles, and network egress controls where practical
- Limiting access to custom-function endpoints and requiring strong authentication and authorization
- Treating user-submitted workflows and custom code as untrusted even when authentication is present
How teams detect issues like this
Detection approaches can include:
- Static analysis for sandboxed code paths that pass user-controlled values to
puppeteer.launch(),child_process, or equivalent process APIs - Code review checks for executable-path, argument, environment, or browser-launch options derived from request data
- Dependency and configuration reviews covering vm2-style sandbox integrations and built-in module exposure
- Runtime monitoring for unexpected child processes, unusual executable paths, and command execution by the Flowise service account
- File-access monitoring for suspicious reads involving application secrets or host-mounted paths
- Policy enforcement that blocks custom-function API access from unauthorized roles and restricts process creation in containers
- Automated security review tools may help identify unsafe data flow from API inputs to process-launching interfaces

