/

CVE-2026-46426

Severity:

HIGH RISK

(7.6)

Stored Cross-Site Scripting via Unrestricted File Upload

CVE-2026-46426

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting via Unrestricted File Upload

CWE:

CWE-79, CWE-434

Impact:

Stored Cross-Site Scripting (XSS) impacting all application end users

Severity:

HIGH RISK

(7.6)

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

Budibase's attachment processing endpoint allows authenticated builders to upload active web content (such as SVGs with inline scripts, HTML with JavaScript, or JS modules) without enforcing extension-based restrictions in certain configurations.

When other users later access the signed URLs for these uploaded files, their browsers execute the embedded scripts, leading to persistent stored XSS across application end users.

Affected context

The issue arises in Budibase deployments where authenticated builders can upload attachments via POST /api/attachments/process and where the active-content checks are only applied to public users or non-self-hosted environments.

Because uploaded files are stored in an object store (e.g., MinIO or S3) with their correct MIME types and later served through signed URLs, uploaded HTML, SVG, or JavaScript content can be rendered and executed directly in the user's browser.

This typically affects multi-user Budibase instances where builders and end users share access to the same applications and attachment assets.

Exploit preconditions

  • Attack surface: The /api/attachments/process file upload endpoint in Budibase.
  • Required access: Authenticated builder-level access (not just anonymous public users), with permission to upload attachments.
  • Trigger point: An uploaded active-content file (HTML, SVG with inline <script>, or .js) is later accessed via its signed URL by any application user.
  • Why exploitation is possible: The server-side logic for filtering dangerous file types is conditionally applied based on isPublicUser and env.SELF_HOSTED, leaving a path where authenticated builders can upload executable content that is served back with the correct MIME type and executed by the browser.

Why this happens

The underlying issue combines two common web security weaknesses:

  • CWE-434: Unrestricted Upload of File with Dangerous Type – The upload handler relies on conditional checks that only enforce active-content restrictions for certain user types or deployment configurations. As a result, authenticated builders can upload files that are inherently executable in a browser context, such as HTML documents, SVGs with inline script tags, or JavaScript modules.
  • CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting) – These dangerous files are stored and later served via signed URLs with their correct MIME types, causing browsers to interpret them as first-class web content. Since there is no neutralization or transformation of the embedded scripts, user-controlled script content is executed in the context of the application domain.

Abstractly, the bug class is that untrusted user content is being accepted and later rendered as active web content without sufficient type restrictions, sanitization, or isolation, allowing arbitrary script execution in users' browsers.

Potential impact

  • Application end users may have their session cookies or authentication tokens exfiltrated.
  • Attackers could perform actions on behalf of victim users (e.g., modifying data, changing configurations) within the permissions of the compromised session.
  • Malicious scripts could log keystrokes, inject additional phishing content, or redirect users to attacker-controlled domains.
  • The compromise may be persistent, as the uploaded payload remains accessible and re-executable by any user who opens the signed URL or assets referencing it.
  • In multi-tenant or shared environments, a malicious builder could target a broad user base across multiple applications.

General mitigation guidance

Effective mitigation focuses on strictly controlling what file types can be uploaded and how they are served back to clients, particularly in the context of a low-code platform where builders control significant application behavior.

Recommended defensive patterns include:

  • Enforcing server-side allowlists for attachment types, explicitly disallowing any file that can be directly interpreted as active web content (e.g., text/html, image/svg+xml with scripts, application/javascript).
  • Decoupling user-uploaded files from the primary application origin by serving them from a distinct domain or subdomain without access to application cookies or storage, limiting the impact of any active content.
  • Normalizing or transforming potentially risky formats (e.g., sanitizing SVGs, converting them to raster images) before storage or delivery when such formats are required.
  • Applying defense-in-depth controls such as content security policy (CSP) to constrain script execution, reducing the blast radius of any single uploaded asset.
  • Minimizing builder privileges where feasible and applying role-based controls so that only trusted roles can upload certain file types.

How teams detect issues like this

Detection can leverage both static and runtime approaches:

  • Code-level review: Inspect upload handlers for conditional checks on file extensions and MIME types that depend on user role or deployment mode; flag any paths that allow unrestricted upload of HTML, SVG, or JavaScript.
  • Static analysis rules: Configure linters or SAST tools to detect patterns where user-supplied files are stored and then served as-is, especially when responses preserve original MIME types and originate from the main application domain.
  • Configuration and policy checks: Define and enforce policies requiring explicit allowlists for upload endpoints and regular review of any bypass conditions tied to environment flags (e.g., SELF_HOSTED) or user roles.
  • Runtime monitoring: Log and monitor uploaded file metadata (names, MIME types, sizes) and alert on suspicious patterns, such as builders uploading .html, .svg, or .js files, or unusual spikes in access to these assets via signed URLs.

Sources

SourceLink
github.comgithub.com/Budibase/budibase/releases/tag/3.38.2
github.comgithub.com/Budibase/budibase/security/advisories/GHSA-82rc-gxrg-v4gf

Frequently asked

questions

Yes, but it requires an attacker to have authenticated builder-level access to the Budibase instance. Once the malicious file is uploaded, any user who accesses the signed URL—potentially via links embedded in the application—can be impacted, even if they are remote end users.

The attacker must be an authenticated builder or a user with equivalent permissions that allow uploading attachments via /api/attachments/process. Public or anonymous users alone, without such privileges, cannot directly exploit this specific path.

The safest pattern is to enforce strict allowlists for file types at the server side, completely blocking uploads of content that can execute code in a browser (HTML, SVG with scripts, JavaScript). Additionally, serve all user-uploaded files from an isolated origin or domain and apply strong CSP where possible to limit script execution.

Incorporate security review of file upload and attachment features during design, ensuring that active-content types are either rejected, sanitized, or isolated. Pair this with automated checks in CI/CD (e.g., tests or static analysis rules for upload endpoints), maintain clear policies for MIME-type handling and domain separation, and periodically test applications for stored XSS and unrestricted upload behaviors.

Find out what's already
exploitable in your codebase.