/

CVE-2026-52098

Severity:

CRITICAL RISK

(9.8)

Code Injection (CWE-94) in Flowise Prediction Endpoint

CVE-2026-52098

Analyzed

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Remote Code Execution

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 3.1.2 contains a critical code-injection vulnerability in the prediction API endpoint associated with a flow. A remote attacker who can reach the affected endpoint may be able to execute arbitrary code in the Flowise runtime, depending on deployment configuration and exposed access controls.

Affected context

The vulnerability occurs in Flowise 3.1.2 deployments that expose the /api/v1/prediction/<flowId> endpoint and process attacker-controlled request data through a code-execution path. Risk is higher when the endpoint is reachable from untrusted networks, authentication is absent or weak, or the Flowise process has broad operating-system or cloud permissions.

Exploit preconditions

  • Attack surface: Network-accessible Flowise prediction API
  • Required access: Ability to send requests to a reachable prediction endpoint; authentication requirements depend on deployment configuration
  • Trigger point: Processing of a request for a selected flow through /api/v1/prediction/<flowId>
  • Why exploitation is possible: Attacker-controlled input can reach an unsafe code execution or evaluation path, allowing unintended operations within the application process

Why this happens

The underlying issue is a code-injection flaw, mapped to CWE-94: Improper Control of Generation of Code ('Code Injection'). The vulnerable behavior occurs when externally influenced data is handled in a way that permits it to alter or invoke executable logic rather than being treated strictly as inert application data. This breaks the boundary between API input and trusted program instructions.

Potential impact

  • An attacker may execute arbitrary code in the Flowise process context
  • The application could be compromised or used to access connected services
  • Sensitive configuration, credentials, or flow data could be exposed
  • The host or container could be used for lateral movement
  • Data could be modified, deleted, or poisoned

General mitigation guidance

Mitigation generally focuses on removing code-evaluation behavior from request processing and reducing the trust placed in API input.

Common defensive patterns include:

  • Treating prediction parameters and flow identifiers as data only, never as executable expressions
  • Replacing dynamic evaluation with allowlisted operations and typed interfaces
  • Applying strict input validation, canonicalization, and schema enforcement
  • Requiring strong authentication and authorization for prediction endpoints
  • Restricting network exposure through gateways, segmentation, and policy controls
  • Running Flowise with least-privilege operating-system, container, and cloud permissions
  • Preventing access to unnecessary files, metadata services, and administrative interfaces
  • Logging and rate-limiting sensitive API activity

How teams detect issues like this

Detection can combine application, code, and infrastructure controls:

  • Use static analysis rules to identify dynamic evaluation, interpreter invocation, shell execution, or string-to-code conversion involving request data
  • Review API handlers for unvalidated values flowing from route parameters or request bodies into executable functions
  • Enforce pull-request policies that prohibit unsafe evaluation primitives and require security review for dynamic execution
  • Monitor prediction endpoints for unusual flow identifiers, repeated probing, unexpected command-like input, and abnormal child-process creation
  • Use runtime application protection and network policies to constrain outbound access and privileged operations
  • Automated code review and software composition analysis tools may help identify related unsafe patterns

Sources

SourceLink
github.comgithub.com/FlowiseAI/Flowise
github.comgithub.com/FlowiseAI/Flowise/blob/main/packages/server/src/utils/constants.ts
github.comgithub.com/FlowiseAI/Flowise/blob/main/packages/server/src/utils/validateKey.ts

Frequently asked

questions

Yes. The affected prediction endpoint is network-facing, so exploitation may be remote when an attacker can reach it and the deployment's access controls do not block the request path.

Not necessarily. The required access depends on how Flowise is deployed and whether the endpoint is protected by authentication, authorization, or an upstream gateway.

Remove unsafe code-generation or evaluation behavior from request processing, validate inputs against a strict schema, and use explicit allowlisted operations instead.

Treat all API input as untrusted, prohibit dynamic evaluation of request-derived data, enforce least privilege, restrict endpoint exposure, and monitor for abnormal execution behavior.

Find out what's already
exploitable in your codebase.