Summary
Budibase can render attacker-controlled markup as raw HTML in Handlebars binding previews, allowing stored cross-site scripting. A BASIC user or an unauthenticated visitor to a public write form may be able to place a value in a shared datasource that later executes in a builder's or administrator's session when previewed.
Affected context
The issue occurs in Budibase Builder binding previews that display values from shared external datasources, including the Data-section Formula column editor and binding drawers. Risk arises when attacker-controlled strings or object keys reach the preview formatter and are inserted as raw HTML; the described Builder origin also lacks a Content-Security-Policy that would block the resulting script.
Exploit preconditions
- Attack surface: Builder binding previews that surface values from a shared external datasource.
- Required access: Ability to write to the datasource, which may be available to a BASIC application user or an unauthenticated visitor using a public write form.
- Trigger point: A builder or administrator opens a relevant preview containing the stored value.
- Why exploitation is possible: Formatting leaves raw strings and object keys unescaped, the preview inserts the result as HTML, and the Handlebars SafeString path preserves attacker-controlled content.
Why this happens
The underlying flaw is a stored cross-site scripting issue mapped to CWE-79: Improper Neutralization of Input During Web Page Generation. Data that should be treated as text is formatted without adequate HTML escaping and then inserted into the Builder interface as raw HTML. This also relates to CWE-116, because output encoding is missing, and CWE-1021, because browser-side security controls do not adequately restrict the rendered content.
Potential impact
- Script may execute in a builder's or administrator's browser session.
- An attacker could perform privileged Builder API actions in the affected session.
- Workspace data may be exposed or modified within the victim's available permissions.
- The issue could enable further compromise of applications managed in the workspace.
General mitigation guidance
Defensive patterns include treating datasource values as untrusted regardless of who can write them, and rendering them as text rather than raw HTML by default. Apply context-appropriate output encoding or use a narrowly configured HTML sanitizer when rich markup is required. Avoid preserving untrusted values through safe-string mechanisms, use a restrictive Content-Security-Policy as defense in depth, and limit the permissions available to Builder sessions and datasource writers.
How teams detect issues like this
Review rendering paths that pass datasource values through formatters, Handlebars bindings, or safe-string helpers before inserting content into the DOM. Static analysis and code review can flag raw HTML insertion, missing context-sensitive escaping, and unsafe handling of object keys or strings. Test preview surfaces with untrusted stored values, and enforce policies that require safe rendering APIs and an appropriate Content-Security-Policy. Automated code review tools may help identify these patterns.

