/

CVE-2024-58351

Severity:

CRITICAL RISK

(9.8)

Code Injection (CWE-94) via Flowise overrideConfig Option

CVE-2024-58351

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Remote Code Execution and Server-Side Abuse

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Flowise prior to version 2.1.4 exposes a configuration injection capability through the overrideConfig option in both the web integration and backend Prediction API.

Because this option is enabled by default, lacks an allow-list, and depends on vm2 sandboxing, an attacker can influence Chainflow execution to achieve remote code execution, sandbox escape, server-side request forgery, data exfiltration, and denial of service against the hosting server.

Affected context

The vulnerability appears in Flowise deployments that:

  • Use Chainflow with the overrideConfig option available (default-enabled)
  • Expose either the frontend web integration or the backend Prediction API to untrusted or semi-trusted callers
  • Rely on vm2-based sandboxing to constrain dynamic configuration behavior

In these scenarios, dynamically supplied configuration can be interpreted in a way that allows attacker-controlled logic to influence the underlying execution environment.

Exploit preconditions

  • Attack surface:
  • Public or internal Flowise frontend integrations that forward overrideConfig options
  • Backend Prediction API endpoints that accept overrideConfig from clients
  • Required access:
  • Ability to invoke the Prediction API or embedded web integration, and to supply custom overrideConfig parameters
  • Trigger point:
  • Execution of a Chainflow where overrideConfig is read, merged into the active configuration, and interpreted within the vm2 sandbox
  • Why exploitation is possible:
  • overrideConfig is enabled by default and accepts arbitrary configuration keys
  • No built-in allow-list restricts which variables or behaviors can be changed
  • vm2 sandboxing is relied upon as a primary boundary but can be abused or bypassed, enabling attacker-controlled code paths to interact with server resources

Why this happens

This issue stems from treating externally supplied configuration as implicitly trustworthy and allowing it to drive code execution behavior.

The overrideConfig mechanism merges user-controlled data into the Chainflow configuration without strict validation or a constrained schema, enabling attackers to inject values that ultimately influence dynamic evaluation inside a vm2 sandbox.

This aligns with CWE-94: Improper Control of Generation of Code, where inputs that should be considered data are allowed to shape executable logic or sensitive execution parameters.

The over-reliance on sandbox isolation, instead of strict configuration validation and least-privilege design, magnifies the impact when the sandbox can be escaped or misused.

Potential impact

  • Remote code execution in the Flowise server context
  • Sandbox escape from vm2, leading to broader access to the host environment
  • Denial of service by consuming resources or crashing the Flowise process
  • Server-side request forgery (SSRF) against internal or external services
  • Exfiltration of environment variables, API keys, and other sensitive server-side data
  • Manipulation of AI prompts and flows, including prompt injection and response tampering
  • Unauthorized access to or leakage of data processed by Chainflow pipelines

General mitigation guidance

Effective mitigation focuses on constraining how configuration is accepted, interpreted, and used to affect execution:

  • Narrow the configuration surface by disabling runtime override mechanisms where not strictly needed, or scoping them to trusted components only.
  • Apply strict allow-listing for overrideConfig keys and value types, ensuring only a minimal, well-defined subset of configuration options can be changed at runtime.
  • Enforce schema-based validation for all externally supplied configuration, rejecting any unexpected fields or complex object structures.
  • Separate control data (e.g., model choice, temperature) from executable or interpreter-adjacent parameters, and avoid any pattern where configuration can indirectly cause code evaluation.
  • Treat sandboxing as a defense-in-depth measure only; design flows so that even if sandbox controls fail, arbitrary server access or code execution is not possible.
  • Run Flowise components with least-privilege OS accounts, restricted network egress, and minimal access to sensitive environment variables and files to reduce blast radius.

How teams detect issues like this

Detection efforts can combine code-centric and operational strategies:

  • Use static analysis and code review to flag any paths where user-controlled configuration is:
  • Merged into global or process-wide settings
  • Passed into evaluation, scripting, or sandboxed execution contexts
  • Used to construct function names, module references, or dynamic behavior selectors
  • Define secure coding guidelines around configuration handling and enforce them via pull-request templates and review checklists, especially around overrideConfig-like mechanisms.
  • Employ automated application security testing (SAST/DAST) tools configured to detect dynamic evaluation patterns and sandbox usage that depends on untrusted input.
  • Instrument Flowise deployments with logging for overrideConfig usage, including keys and structural anomalies, and monitor for abnormal patterns or high-entropy configuration payloads.
  • Implement runtime monitoring and anomaly detection for:
  • Unexpected outbound network requests (potential SSRF)
  • Unusual spikes in CPU or memory usage suggesting DoS attempts
  • Access to sensitive environment variables or file paths from AI-related execution contexts.

Sources

SourceLink
github.comgithub.com/FlowiseAI/Flowise/security/advisories/GHSA-5cph-wvm9-45gj
vulncheck.comvulncheck.com/advisories/flowise-remote-code-execution-via-overrideconfig-parameter

Frequently asked

questions

The issue is exploitable wherever the Flowise frontend integration or Prediction API is reachable by an attacker and overrideConfig can be supplied. The attacks are self-targeted, meaning they impact the hosting Flowise instance rather than other tenants or users directly, but they can still compromise the server and its data.

It depends on how the Flowise endpoints are exposed. If the Prediction API or embedded integration is publicly reachable without strong authentication or input controls, then unauthenticated attackers may exploit it. In more locked-down environments, an attacker would need whatever level of access is required to call the relevant endpoints with overrideConfig parameters.

The most robust fix involves restricting or disabling dynamic overrideConfig behavior by default, enforcing strict allow-lists for permitted configuration keys, and validating configuration structure against a schema before use. Additionally, designing Chainflow logic so that configuration cannot indirectly lead to code execution significantly reduces risk.

Future designs should treat any external configuration input as untrusted data, confine it to a narrow, well-defined set of parameters, and avoid patterns where configuration influences interpreters, sandboxes, or dynamic evaluation. Combining schema validation, principle of least privilege, and layered defenses (such as limited network access and reduced secret exposure) can prevent configuration-driven code injection and sandbox escape scenarios.

Find out what's already
exploitable in your codebase.