/

CVE-2026-48149

Severity:

HIGH RISK

(8.1)

Stored XSS in Budibase Markdown Text Component

CVE-2026-48149

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Arbitrary JavaScript Execution in Users' Browsers

Severity:

HIGH RISK

(8.1)

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 Text component, when used in Markdown mode, renders user-controlled content directly into innerHTML without sanitization, creating a stored cross-site scripting (XSS) condition.

Any database column bound to this component becomes a persistent XSS sink for users with write access, potentially allowing arbitrary script execution in other users' browsers.

Affected context

This vulnerability arises in Budibase applications that:

  • Use the Text component in Markdown mode
  • Bind the component to database columns that BASIC app users with WRITE permission can modify
  • Render this content for other users (including higher-privileged builders or admins) in a browser

The issue is located in packages/bbui/src/Markdown/MarkdownViewer.svelte, where marked.parse(markdown) output is assigned directly to innerHTML without sanitization or HTML filtering.

Exploit preconditions

  • Attack surface: Web UI of Budibase applications using the Markdown Text component
  • Required access: BASIC app user account with WRITE permission on a table column bound to a Markdown Text component
  • Trigger point: Viewing of the affected page or component by any user whose browser renders the stored Markdown content
  • Why exploitation is possible: The Markdown rendering pipeline (marked.parse) returns HTML that is written directly to innerHTML without sanitation or context-aware encoding, allowing embedded scripts or event handlers to execute in the viewer's browser.

Why this happens

The underlying issue is an improper neutralization of input before using it in a web page, mapped to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting).

The Markdown viewer treats user-supplied content as trusted and:

  • Converts it to HTML with marked.parse(markdown)
  • Assigns the resulting HTML directly to innerHTML in Svelte

Without a sanitization step or context-aware escaping, hostile payloads embedded in Markdown are preserved and executed by the browser.

Architecturally, the bug stems from coupling rich-text/Markdown rendering with raw HTML injection, without enforcing an invariant that all HTML sinks are protected by an HTML sanitizer or strict allowlist.

Potential impact

  • Execution of arbitrary JavaScript in the context of the affected Budibase app
  • Session hijacking or theft of authentication tokens stored in accessible cookies or web storage
  • Unauthorized actions performed on behalf of a victim user via their browser (e.g., modifying data, changing configurations)
  • Defacement or manipulation of application UI to mislead users or facilitate phishing
  • Lateral movement to other parts of the application through CSRF-like interactions initiated from the victim's browser

General mitigation guidance

Effective mitigation focuses on treating Markdown and HTML output as untrusted and enforcing consistent output encoding policies:

  • Introduce a robust HTML sanitization step between Markdown parsing and innerHTML, using a well-maintained sanitizer with a strict, minimal allowlist of tags and attributes.
  • Avoid writing arbitrary HTML to innerHTML wherever possible; prefer framework-level rendering APIs that escape content by default.
  • Distinguish between trusted and untrusted rich text data, and only allow raw HTML output for content produced by highly trusted sources under explicit review.
  • Apply content security policies (CSP) that reduce XSS impact, for example by disallowing inline scripts and restricting script sources, recognizing that CSP is a defense-in-depth control.
  • Enforce the principle of least privilege for app users and roles so that only necessary users can write to fields that are displayed as rich content.

How teams detect issues like this

Teams can detect similar vulnerabilities by examining both code and behavior:

  • Static analysis patterns: Search for assignments to innerHTML, outerHTML, or similar sinks, especially where data originates from user inputs or database fields, and check for absent or weak sanitization.
  • Markdown/HTML pipeline review: Inspect Markdown rendering components to ensure they include a sanitizer or safe rendering mode before output reaches the DOM.
  • Code review checklists: Add explicit review questions around any feature that uses rich text, WYSIWYG editors, or Markdown parsing to verify output encoding and sanitization.
  • Automated security testing: Use dynamic scanners or security testing tools configured to inject XSS payloads into rich-text fields and observe whether the payload is stored and executed.
  • Policy enforcement in CI/CD: Integrate lint rules or SAST tools that flag direct DOM injection patterns and require justification or compensating controls.

Sources

SourceLink
github.comgithub.com/Budibase/budibase/security/advisories/GHSA-57p7-9h9w-xqpw

Frequently asked

questions

Yes. Any remote user of the Budibase app with WRITE access to an affected table column can store a malicious payload. Other users who view the page render this content and may have the payload executed in their browsers.

The attacker must be a BASIC app user (or equivalent) with WRITE permission on the underlying table bound to a Text component in Markdown mode. They do not need administrative privileges to inject the payload.

Ensure that all Markdown-rendered content passes through a strong HTML sanitizer before reaching innerHTML (or equivalent DOM sinks), or switch to rendering methods that escape content by default and only allow a tightly controlled subset of HTML when explicitly required.

Establish a standard for handling rich text that mandates sanitization and context-aware encoding, prohibit unsanitized writes to HTML sinks in coding guidelines and automated checks, and consistently review new components or features that introduce Markdown, HTML, or WYSIWYG editing capabilities.

Find out what's already
exploitable in your codebase.