Summary
Flowise Chatflow configuration handling allows modification of upload settings so that application/javascript files are accepted as valid configuration uploads.
When this occurs, an attacker can upload and persist arbitrary .js files, including Node.js-based web shells, which can be invoked to achieve remote code execution on the server.
Affected context
This vulnerability affects Flowise deployments where Chatflow configuration file upload settings can be altered server-side or through an administrative interface.
The risk arises when MIME-type validation is either disabled or expanded to include application/javascript, allowing JavaScript files to be treated as acceptable configuration content.
Instances exposed to untrusted users, multi-tenant environments, or shared administration contexts are more likely to be impacted, especially when uploaded files are stored and later executed or interpreted by the Node.js runtime.
Exploit preconditions
- Attack surface: Chatflow configuration file upload endpoint exposed by the Flowise server.
- Required access: Ability to modify or influence Chatflow upload settings and submit configuration uploads (often via authenticated access, but dependent on deployment controls).
- Trigger point: Upload of a .js file masquerading as or accepted as a Chatflow configuration file when application/javascript is allowed as a MIME type.
- Why exploitation is possible: The server-side logic permits JavaScript files to be uploaded and persisted without robust content-type and content validation, and these files can be used as Node.js web shells or executed in a way that leads to code execution.
Why this happens
The underlying issue is a lack of strict server-side enforcement of allowed file types and content for Chatflow configuration uploads.
While the frontend nominally restricts JavaScript uploads, the configuration settings can be modified so that application/javascript is accepted, bypassing the original safety assumptions.
This maps to CWE-434: Unrestricted Upload of File with Dangerous Type, where user-controlled uploads of executable or scriptable content are inadequately constrained, enabling attackers to introduce server-side code or scripts into the runtime environment.
Potential impact
- Remote execution of arbitrary Node.js code on the Flowise server.
- Persistent installation of Node.js web shells for long-term unauthorized access.
- Exfiltration or tampering of Chatflow logic, prompts, credentials, or integration secrets.
- Lateral movement to other services or infrastructure reachable from the compromised server.
- Complete compromise of the affected Flowise instance and potentially its underlying host environment.
General mitigation guidance
Effective mitigation centers on tightening server-side validation and limiting what uploaded files can do:
- Enforce a strict allowlist of MIME types and file extensions for Chatflow configuration uploads, excluding all executable or scriptable types (e.g., application/javascript, .js).
- Validate file content against expected configuration schemas rather than relying solely on MIME type or extension.
- Store uploaded configuration files outside of any executable path and ensure they are treated purely as data, not code.
- Apply least-privilege principles to the Flowise process and any worker processes so that even if a file is misused, its capabilities are constrained.
- Centralize configuration of upload settings and restrict who can modify them, preferably via role-based access control and configuration-as-code.
These patterns reduce the chance that user-controlled uploads can be turned into executable server-side artifacts.
How teams detect issues like this
Detection is most effective when combining configuration review with ongoing monitoring:
- Use static configuration analysis or policy-as-code (e.g., security baselines) to ensure upload settings do not permit application/javascript or other executable types.
- During code review, look for upload handlers that:
- Accept broad or dynamic MIME-type lists.
- Do not validate file content against an expected configuration schema.
- Save files to locations that the runtime can execute or import as code.
- Configure logging and alerting for unusual .js uploads, especially in directories associated with configuration or user content.
- Employ application security testing tools to probe file upload endpoints for acceptance of dangerous file types and unexpected execution behavior.
- Periodically scan server file systems for anomalous .js files in upload or configuration directories.

