VulnWatch by ve1ve2
high 7.7 EPSS 0.68%

GHSA-r2q3-7m4h-63qg / CVE-2026-122244: Budibase: Cross-privilege Stored XSS in the Budibase Builder via broken HTML-escaping in `jsonFormatter.format()` rendered through `{@html}` in the CSP-less Builder origin

Source:
GitHub Security Advisories
Published:
Fetched:
Updated:
Affects:
@budibase/server

https://github.com/advisories/GHSA-r2q3-7m4h-63qg ↗

ghsanpmCWE-79CWE-116CWE-1021

Budibase: Cross-privilege Stored XSS in the Budibase Builder via broken HTML-escaping in `jsonFormatter.format()` rendered through `{@html}` in the CSP-less Builder origin ## Description ### Summary A **low-privileged application end-user** (role `BASIC` - **not** a builder or admin, and on a public data-collection form, an unauthenticated visitor) can store an HTML/JavaScript payload in ordinary row data. When a **builder or admin** later opens that table in the Budibase Builder and evaluates any Handlebars binding whose Preview surfaces the value (the Data-section **Formula** column editor, or any binding drawer), the stored value is rendered as **raw HTML** and the attacker's JavaScript executes in the Builder's origin. The Builder SPA is served by nginx with **no Content-Security-Policy** (the CSP middleware only decorates the server-rendered *published-app* document, not `/builder/`). The injected script therefore runs unrestricted in the highest-trust surface of the product - the admin/builder session that can create datasources, run server-side JavaScript via automations, read and modify every table, and manage users. This is a **cross-privilege stored XSS** (app end-user → builder/admin), i.e. full workspace takeover, not self-XSS. ### Details **Root cause 1 - the escaper is a no-op.** `packages/frontend-core/src/utils/jsonFormatter.ts` (`format()`): ```js jsonString = jsonString .replace(/&/g, "&") // no-op: replaces "&" with "&" (should be "&") .replace(//g, ">") // no-op (should be ">") return jsonString.replace( /("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+...)/g, (match) => { if (/^"/.test(match)) { if (/:$/.test(match)) { color = colors.keyColor } // KEY: NOT escaped else { match = '"' + escapeHtml(match.substr(1, match.length - 2)) + '"' } // string VALUE: escaped } return ` ${match} ` }) ``` Only quoted JSON *string values* are passed through `escapeHtml`. Everything else is emitted verbatim, because the leading `.replace(/&/g,"&")…` chain replaces each character with itself. Two consequences: 1. A **raw, non-JSON string** (the normal result of a Handlebars binding that resolves to a plain text field value) matches none of the regex tokens and is returned **completely un-escaped**. 2. **Object keys** are never escaped. **Root cause 2 - the output is injected with `{@html}`.** `packages/builder/src/components/common/bindings/EvaluationSidePanel.svelte`: - line 116: `{@html logLine.log}` - line 128: `{@html highlightedResult}` `highlightedResult` is the output of `JsonFormatter.format()`, so the un-escaped attacker string is inserted into the DOM as live markup. **Root cause 3 - binding output is not entity-escaped upstream.** Every `{{ … }}` statement is wrapped by the `ALL` helper in `packages/string-templates/src/helpers/index.ts`, which returns a `Handlebars.SafeString`; Handlebars therefore performs no HTML escaping, and the raw field value reaches the formatter/`{ Affected packages: npm:@budibase/server

Linked vulnerabilities (2)

CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N

Budibase: Cross-privilege Stored XSS in the Budibase Builder via broken HTML-escaping in `jsonFormatter.format()` rendered through `{@html}` in the CSP-less Builder origin

CWE: CWE-79, CWE-116, CWE-1021Aliases: CVE-2026-122244
CVE-2026-122244 high 7.7 EPSS 0.68% (p53) NVDCVE.orgGHSA
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N

Budibase: Cross-privilege Stored XSS in the Budibase Builder via broken HTML-escaping in `jsonFormatter.format()` rendered through `{@html}` in the CSP-less Builder origin

CWE: CWE-79, CWE-116, CWE-1021Aliases: GHSA-r2q3-7m4h-63qgNVD: Deferred

Also reported by (1)