{"vuln_id":"CVE-2026-122244","aliases":["GHSA-r2q3-7m4h-63qg"],"description":"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","published_at":"2026-11-20T17:18:07.970000Z","modified_at":"2026-11-21T00:00:03.997775Z","first_seen_at":"2026-11-21T19:15:19.243955Z","severity":"high","severity_source":"nvd","cvss_score":7.7,"cvss_vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N","cwe":["CWE-79","CWE-116","CWE-1021"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00678,"epss_percentile":0.53246,"nvd_status":"Deferred","enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-122244"},"matched_alias":null,"items":[{"id":10800,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-r2q3-7m4h-63qg: 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","summary":"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\n\n## Description\n\n### Summary\n\nA **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.\n\nThe 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.\n\n### Details\n\n**Root cause 1 - the escaper is a no-op.**\n`packages/frontend-core/src/utils/jsonFormatter.ts` (`format()`):\n\n```js\njsonString = jsonString\n.replace(/&/g, \"&\") // no-op: replaces \"&\" with \"&\" (should be \"&\")\n.replace(//g, \">\") // no-op (should be \">\")\n\nreturn jsonString.replace(\n/(\"(\\\\u[a-zA-Z0-9]{4}|\\\\[^u]|[^\\\\\"])*\"(\\s*:)?|\\b(true|false|null)\\b|-?\\d+...)/g,\n(match) => {\nif (/^\"/.test(match)) {\nif (/:$/.test(match)) { color = colors.keyColor } // KEY: NOT escaped\nelse { match = '\"' + escapeHtml(match.substr(1, match.length - 2)) + '\"' } // string VALUE: escaped\n}\nreturn `\n${match}\n`\n})\n```\n\nOnly 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:\n\n1. 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**.\n2. **Object keys** are never escaped.\n\n**Root cause 2 - the output is injected with `{@html}`.**\n`packages/builder/src/components/common/bindings/EvaluationSidePanel.svelte`:\n\n- line 116: `{@html logLine.log}`\n- line 128: `{@html highlightedResult}`\n\n`highlightedResult` is the output of `JsonFormatter.format()`, so the un-escaped attacker string is inserted into the DOM as live markup.\n\n**Root cause 3 - binding output is not entity-escaped upstream.**\nEvery `{{ … }}` 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/`{\n\nAffected: npm:@budibase/server\n\nNo fixed version published yet\n\nReferences:\nhttps://github.com/Budibase/budibase/security/advisories/GHSA-r2q3-7m4h-63qg\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-122244\nhttps://github.com/Budibase/budibase/commit/5f37fb43728639c540cc7233283f1100e9315424\nhttps://github.com/Budibase/budibase\nhttps://github.com/Budibase/budibase/releases/tag/v3.50.0\nhttps://github.com/Budibase/budibase/releases/tag/v4.0.0","url":"https://osv.dev/vulnerability/GHSA-r2q3-7m4h-63qg","published_at":"2026-11-20T23:49:47Z","updated_at":"2026-11-21T00:00:03.997775Z","fetched_at":"2026-11-21T19:15:55.946184Z","severity":"high","cvss_score":7.7,"epss":0.00678,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"@budibase/server","vuln_id":"CVE-2026-122244","vuln_ids":["CVE-2026-122244","GHSA-R2Q3-7M4H-63QG"],"tags":["osv","npm","no-fix-yet"],"cluster_id":1976,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/10800","html":"https://vulnwatch.ve1ve2.com/item/10800"}},{"id":2280,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"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","summary":"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\n\n## Description\n\n### Summary\n\nA **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.\n\nThe 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.\n\n### Details\n\n**Root cause 1 - the escaper is a no-op.**\n`packages/frontend-core/src/utils/jsonFormatter.ts` (`format()`):\n\n```js\njsonString = jsonString\n.replace(/&/g, \"&\") // no-op: replaces \"&\" with \"&\" (should be \"&\")\n.replace(//g, \">\") // no-op (should be \">\")\n\nreturn jsonString.replace(\n/(\"(\\\\u[a-zA-Z0-9]{4}|\\\\[^u]|[^\\\\\"])*\"(\\s*:)?|\\b(true|false|null)\\b|-?\\d+...)/g,\n(match) => {\nif (/^\"/.test(match)) {\nif (/:$/.test(match)) { color = colors.keyColor } // KEY: NOT escaped\nelse { match = '\"' + escapeHtml(match.substr(1, match.length - 2)) + '\"' } // string VALUE: escaped\n}\nreturn `\n${match}\n`\n})\n```\n\nOnly 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:\n\n1. 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**.\n2. **Object keys** are never escaped.\n\n**Root cause 2 - the output is injected with `{@html}`.**\n`packages/builder/src/components/common/bindings/EvaluationSidePanel.svelte`:\n\n- line 116: `{@html logLine.log}`\n- line 128: `{@html highlightedResult}`\n\n`highlightedResult` is the output of `JsonFormatter.format()`, so the un-escaped attacker string is inserted into the DOM as live markup.\n\n**Root cause 3 - binding output is not entity-escaped upstream.**\nEvery `{{ … }}` 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/`{\n\nAffected packages: npm:@budibase/server","url":"https://github.com/advisories/GHSA-r2q3-7m4h-63qg","published_at":"2026-11-20T23:49:47Z","updated_at":"2026-11-20T23:49:49Z","fetched_at":"2026-11-21T19:15:18.416717Z","severity":"high","cvss_score":7.7,"epss":0.00678,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"@budibase/server","vuln_id":"CVE-2026-122244","vuln_ids":["CVE-2026-122244","GHSA-R2Q3-7M4H-63QG"],"tags":["ghsa","npm","CWE-79","CWE-116","CWE-1021"],"cluster_id":1976,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2280","html":"https://vulnwatch.ve1ve2.com/item/2280"}},{"id":9916,"source":{"id":"nvd","name":"NVD CVE API 2.0"},"title":"CVE-2026-122244: Budibase is an open-source low-code platform. Prior to 3.50.0, a BASIC application user, or an unauthenticated visitor to a public write form, can store markup…","summary":"Budibase is an open-source low-code platform. Prior to 3.50.0, a BASIC application user, or an unauthenticated visitor to a public write form, can store markup in a shared external datasource that a builder or administrator later evaluates in any Handlebars binding Preview that surfaces the value, including the Data-section Formula column editor or any binding drawer. jsonFormatter.format() in packages/frontend-core/src/utils/jsonFormatter.ts leaves raw strings and object keys unescaped, while packages/builder/src/components/common/bindings/EvaluationSidePanel.svelte inserts the formatted result as raw HTML. The Handlebars SafeString path preserves the attacker-controlled value, and the Builder origin lacks a Content-Security-Policy that would block the resulting script. This permits stored script execution in the higher-privileged builder or administrator session rather than the writer's own role, allowing privileged Builder API actions and workspace data access. This issue is fixed in versions 3.50.0 and 4.0.0.\n\nReferences:\nhttps://github.com/Budibase/budibase/commit/5f37fb43728639c540cc7233283f1100e9315424\nhttps://github.com/Budibase/budibase/releases/tag/v3.50.0\nhttps://github.com/Budibase/budibase/releases/tag/v4.0.0\nhttps://github.com/Budibase/budibase/security/advisories/GHSA-r2q3-7m4h-63qg\nhttps://github.com/Budibase/budibase/security/advisories/GHSA-r2q3-7m4h-63qg","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-122244","published_at":"2026-11-20T17:18:07.970000Z","updated_at":"2026-11-20T19:18:37.957000Z","fetched_at":"2026-11-21T19:15:31.485415Z","severity":"high","cvss_score":7.7,"epss":0.00678,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":null,"vuln_id":"CVE-2026-122244","vuln_ids":["CVE-2026-122244","GHSA-R2Q3-7M4H-63QG"],"tags":["CWE-79","CWE-116","CWE-1021"],"cluster_id":1977,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/9916","html":"https://vulnwatch.ve1ve2.com/item/9916"}}]}