/

CVE-2026-30821

Severity:

CRITICAL RISK

(9.8)

Unrestricted File Upload in Flowise Attachment API

CVE-2026-30821

Analyzed

Vulnerability type

Category:

Unrestricted File Upload

CWE:

CWE-434

Impact:

Arbitrary File Upload leading to Stored XSS, Malicious File Hosting, and Potential Remote Code Execution

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Flowise exposes an unauthenticated attachment upload endpoint that relies solely on client-supplied MIME types to validate files.

By spoofing the Content-Type header, an attacker can upload arbitrary files to backend storage, which can later be abused for Stored XSS, malicious file hosting, or Remote Code Execution when combined with other features.

Affected context

This vulnerability occurs in Flowise deployments where the /api/v1/attachments/:chatflowId/:chatId endpoint is reachable and treated as a trusted file ingestion path.

It is most relevant when:

  • The endpoint remains in a whitelist or is otherwise accessible without authentication.
  • File uploads are validated only via MIME type values supplied by the client.
  • Uploaded files are stored in persistent backends such as S3, GCS, or local disk and may later be served back to users, used in static hosting, or processed by other backend components.

The risk increases when downstream features render or execute uploaded content in a browser or server context.

Exploit preconditions

  • Attack surface: Public HTTP(S) exposure of the /api/v1/attachments/:chatflowId/:chatId endpoint.
  • Required access: Network-level access to the Flowise API; no authentication needed due to whitelisting.
  • Trigger point: Sending a crafted multipart/form-data upload request that:
  • Targets a valid :chatflowId and :chatId.
  • Sets the Content-Type (file.mimetype) to an allowed value (e.g., application/pdf) while supplying arbitrary file content and extension.
  • Why exploitation is possible:
  • The server's upload validation trusts the client-provided MIME type without verifying:
  • File magic bytes (true content type), or
  • File name/extension (file.originalname).
  • Uploaded files are persisted via addArrayFilesToStorage to storage backends (S3, GCS, or disk), where they can be later accessed or integrated with other features (e.g., static hosting, retrieval views) that may render or execute them.

Why this happens

At its core, this is an unrestricted file upload issue, mapping to CWE-434, where uploaded content is insufficiently constrained and validated.

The upload implementation:

  • Treats client-controlled metadata (file.mimetype) as authoritative, rather than deriving the content type from file signatures or strictly enforced file extensions.
  • Applies logical checks based only on the declared MIME type list in chatbotConfig.fullFileUpload.allowedUploadFileTypes.
  • Does not enforce authentication on a sensitive file upload surface due to the endpoint being listed in WHITELIST_URLS.

This combination of implicit trust in client metadata and broad, unauthenticated access to persistent file storage creates a generic "arbitrary file upload" primitive.

When such files are later rendered in a browser context, served as static assets, or processed by backend logic, this primitive can be transformed into Stored XSS, malicious file hosting, or even Remote Code Execution.

Potential impact

  • Upload and long-term storage of arbitrary files (scripts, binaries, malware) on backend storage (S3, GCS, local disk).
  • Stored Cross-Site Scripting (XSS) if uploaded files are later served with active content types (e.g., HTML, JS) and rendered in user browsers.
  • Use of the application infrastructure as a malicious file hosting platform, aiding phishing, malware distribution, or drive-by attacks.
  • Remote Code Execution (RCE) if other application features or external tools process uploaded files in ways that lead to code execution (e.g., unsafe parsers or converters).
  • Abuse of storage resources and potential cost amplification, including bandwidth and storage overuse.
  • Reputational damage if the Flowise deployment is used as a distribution point for malicious content.

General mitigation guidance

Effective mitigation focuses on tightening both access control and file validation for upload endpoints, and on minimizing the trust granted to uploaded content.

Typical defensive patterns include:

  • Enforce authentication and authorization on all file upload endpoints, especially those persisting data to shared or public storage.
  • Validate files based on server-side checks, such as:
  • Inspecting magic bytes or using robust content-sniffing libraries to confirm true file type.
  • Enforcing a whitelist of safe extensions and verifying the filename format.
  • Restrict allowable file types to the minimal set necessary for the product's core functionality (e.g., limited document types instead of generic binary uploads).
  • Store uploaded files in segregated locations with:
  • Non-executable storage configurations.
  • Distinct domains or subdomains for serving user content, with strict Content-Type and Content-Disposition headers.
  • Apply strong output handling policies when serving files:
  • Avoid inline rendering of potentially hazardous types.
  • Prefer forced download for untrusted file types.
  • Use least privilege for storage and processing components, ensuring that services interacting with uploaded files have constrained permissions and no unnecessary execution capabilities.
  • Introduce centralized upload validation middleware, so new upload surfaces automatically inherit hardened validation and access control policies.

How teams detect issues like this

Detection and assurance can be improved through a mix of code-level, configuration-level, and runtime controls:

  • Static analysis and code scanning:
  • Search for upload handlers that:
  • Read file.mimetype or similar client-controlled metadata without server-side content verification.
  • Are exposed in lists like WHITELIST_URLS or equivalent bypass lists.
  • Flag routes that accept file uploads but lack explicit authentication/authorization checks.
  • Security-focused code review:
  • Examine API route definitions for file upload endpoints and verify:
  • Presence of authentication and permission checks.
  • Enforcement of strict file-type and size constraints.
  • Proper handling of storage paths and file name normalization.
  • Review integration points (static hosting, file retrieval APIs, rendering components) for assumptions about the safety of stored files.
  • Configuration audits:
  • Inspect deployment configuration for public exposure of upload endpoints.
  • Review storage bucket or filesystem policies ensuring user-uploaded content is treated as non-executable and isolated.
  • Runtime and log-based monitoring:
  • Monitor for unusual patterns in uploads, such as:
  • High volume of uploads from unrecognized sources.
  • Uploads whose names or patterns resemble scripts or executable files (e.g., .js, .html, .php, .sh).
  • Use WAF or API gateway rules to inspect multipart/form-data requests and enforce basic file upload policies (size, extension, MIME consistency).
  • Automated security tests:
  • Integrate DAST or custom security testing scripts into CI/CD to probe upload endpoints with mismatched MIME types, suspicious extensions, and potentially executable content.

Sources

SourceLink
github.comgithub.com/FlowiseAI/Flowise/releases/tag/flowise%403.0.13
github.comgithub.com/FlowiseAI/Flowise/security/advisories/GHSA-j8g8-j7fc-43v6

Frequently asked

questions

The issue is broadly exploitable in environments where the affected upload endpoint is reachable over the network, because it does not require authentication. Any external actor who can send HTTP requests to the Flowise instance can attempt arbitrary file uploads, making it a high-risk entry point especially in internet-facing deployments.

Only network access to the exposed Flowise API is required. No user credentials or prior foothold are necessary, because the endpoint is whitelisted and accepts unauthenticated file uploads. However, achieving outcomes like Stored XSS or RCE may require additional conditions, such as the presence of static hosting or vulnerable file processing features.

The most robust fix pattern combines enforcing authentication on upload endpoints with strict, server-side file validation. That typically means:

  • Removing unauthenticated upload routes from any whitelist.
  • Validating file types using magic bytes and extension checks on the server.
  • Limiting allowed file types to a minimal, clearly defined set and storing them in non-executable locations.

To prevent similar vulnerabilities, projects should adopt a standard secure upload design that:

  • Treats all file uploads as untrusted data by default.
  • Centralizes and reuses hardened upload validation logic across endpoints.
  • Disallows reliance on client-provided metadata (such as MIME type) without verification.
  • Ensures uploaded content is stored and served in a way that prevents execution or inline rendering unless explicitly intended and safely handled.
  • Is regularly tested via security reviews and automated scanning as part of the development lifecycle.
Find out what's already
exploitable in your codebase.