Summary
Flowise versions before 3.1.3 contain a regex-based Python code validation bypass in CSV and Airtable Agent nodes. An unauthenticated attacker may use prompt injection to invoke insufficiently restricted pandas functionality, potentially exfiltrating data, accessing internal services, or executing code through the prediction API.
Affected context
The vulnerability occurs in Flowise deployments that expose CSV or Airtable Agent nodes through an accessible workflow or prediction API. Risk is highest when user-controlled prompts can influence Python-oriented processing and validation relies on regex filtering that does not comprehensively restrict callable functions or generated expressions.
Exploit preconditions
- Attack surface: Flowise workflows using CSV or Airtable Agent nodes and an exposed prediction API
- Required access: No authentication may be required when the affected prediction endpoint is publicly reachable
- Trigger point: Processing of attacker-controlled prompt content by an Agent node
- Why exploitation is possible: Regex-based validation can be bypassed to reach insufficiently restricted pandas functionality, enabling unintended data access, network requests, or code execution
Why this happens
The underlying flaw is an incomplete security boundary around Python-oriented expression or function validation. Regex-based filters are not reliable substitutes for a restricted execution model because they may overlook alternate APIs, aliases, indirect calls, or permitted functions with security-sensitive behavior. This maps to CWE-94: Improper Control of Generation of Code, where attacker-influenced input can affect executable logic.
Potential impact
- An attacker may execute unauthorized code in the Flowise server process
- Sensitive datasets may be read or exfiltrated
- Internal services may be reached through server-side request forgery
- Credentials, environment variables, or connected service data could be exposed
- The Flowise instance could be used for lateral movement or further compromise
General mitigation guidance
Mitigation generally focuses on removing attacker influence over executable behavior rather than expanding denylist-based validation.
Common defensive patterns include:
- Replacing dynamic Python evaluation with purpose-built, non-executable data-processing operations
- Applying allowlisted functionality with explicit argument and resource constraints
- Treating prompts and workflow inputs as untrusted data throughout processing
- Requiring authentication and authorization for prediction endpoints and sensitive workflows
- Running Flowise with least-privilege service accounts, isolated network access, and minimal filesystem permissions
- Restricting access to datasets, secrets, and internal services from agent execution environments
How teams detect issues like this
Detection can include:
- Static analysis for regex-based validation surrounding dynamic Python execution or expression evaluation
- Code review checks for prompt-controlled function names, module access, and unrestricted data-processing APIs
- Policy enforcement that blocks unauthenticated access to prediction endpoints and limits agent capabilities
- Runtime monitoring for unexpected outbound requests, filesystem access, process creation, or unusual dataset reads
- Automated security review tools that identify code-generation and insufficient sandboxing patterns

