## Summary
FlowiseAI versions prior to 3.1.4 contain a path validation flaw in the Sql Database Chain node for SQLite connections. Authenticated attackers can supply a crafted SQLite file path to write arbitrary files, enabling remote code execution and/or stored XSS depending on where the file is written.
## Technical Details
The Sql Database Chain node accepts a user-provided SQLite database file path without input validation, as described in the Flowise security advisory. This allows improper limitation of a pathname to a restricted directory (CWE-22).
The advisory points to the implementation in SqlDatabaseChain.ts (referenced at the [email protected] path) where the node’s SQLite option is handled and the file path is used without validation.
Attackers can leverage the write primitive by providing a path that targets sensitive locations:
- Writing a malicious SQLite database into system directories.
- Injecting files into the web root.
Depending on the deployment and how Flowise serves/uses the written artifacts, this can lead to command execution and/or stored XSS.
## Affected
- FlowiseAI/Flowise 3.1.2 (explicitly listed in the GHSA advisory)
- Flowise versions >= 0, < 3.1.4 (as stated by VulnCheck)
## Impact
- Authenticated attackers can write arbitrary files via the Sql Database Chain node.
- Potential outcomes include remote code execution, stored XSS, and full compromise of confidentiality/integrity/availability (per CVSS vector 8.8).
## Mitigation
1. Upgrade Flowise to 3.1.4 or later (the advisory and VulnCheck both indicate the issue affects versions before 3.1.4).
2. Restrict access to features that allow authenticated users to configure the Sql Database Chain node, reducing exposure to attackers with valid credentials.
3. Review and harden any file-serving paths/web roots to prevent execution or rendering of attacker-controlled files written via misconfigured database paths.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CWE-22