/

CVE-2026-54350

Severity:

CRITICAL RISK

(10.0)

JSON Injection (CWE-89) in Budibase Public Queries

CVE-2026-54350

Modified

Vulnerability type

Category:

Injection

CWE:

CWE-89, CWE-943

Impact:

Unauthenticated mass data exposure and modification

Severity:

CRITICAL RISK

(10.0)

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

A JSON injection flaw in Budibase allows unauthenticated visitors of a published app to tamper with query bodies and filters sent to backing data sources.

When a builder exposes PUBLIC read or write queries, crafted parameter values can expand filters to match entire collections, enabling mass data disclosure and modification in a single request.

Affected context

This vulnerability affects Budibase deployments where builders have published queries with a PUBLIC role against data sources such as MongoDB, CouchDB, Elasticsearch, DynamoDB-PartiQL, or REST endpoints that accept JSON bodies.

The issue arises when query parameters are interpolated directly into JSON query templates and parsed without robust escaping of JSON metacharacters, while access control middleware short-circuits for PUBLIC queries and CSRF protections are not applied on this path.

Exploit preconditions

  • Attack surface: The POST /api/v2/queries/:queryId endpoint exposed by any published Budibase app.
  • Required access: No authentication or valid session is needed; knowledge of the public app URL and its x-budibase-app-id value suffices.
  • Trigger point: Submission of crafted query parameters that include closing quotes and additional JSON keys, causing the parsed filter object to be reshaped.
  • Why exploitation is possible: Parameter values are substituted into raw JSON bodies and then parsed; the validator only blocks Handlebars markers and fails to escape JSON metacharacters, so attackers can inject extra fields that override builder-defined filters and broaden query scope.

Why this happens

The core bug stems from unsafe construction of JSON query bodies using direct string substitution of untrusted parameters followed by JSON.parse, without proper encoding or structural validation.

Because the validator focuses on rejecting template syntax ({{, }}) rather than enforcing strict JSON escaping, attacker input can break out of intended value positions and introduce new keys or operators.

This pattern maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command, generalized here as injection into a query language, and CWE-943: Improper Neutralization of Special Elements in Data Query Logic, where user-controlled data is permitted to influence query structure and filter semantics.

Potential impact

  • Unauthenticated visitors may read every document in affected collections.
  • Attackers could modify every document in a collection via PUBLIC write queries.
  • Data integrity can be compromised through bulk updates or overwrites.
  • Confidential data stored behind the app may be exfiltrated at scale.
  • Application behavior and analytics built on the data can be subtly or overtly poisoned.

General mitigation guidance

Effective mitigation centers on treating query parameters strictly as data, never as structural components of query logic.

Builders and platform developers can:

  • Use structured parameter binding APIs that construct filter objects programmatically instead of interpolating raw JSON strings.
  • Enforce rigorous escaping or encoding of JSON metacharacters and disallow any syntax that alters object structure or operators.
  • Apply least-privilege principles to PUBLIC queries, avoiding broad read/write operations and limiting accessible fields and actions.
  • Introduce server-side validation that checks filters against a schema or allowlist of permitted operators, rejecting unexpected keys.
  • Ensure that public-facing query execution paths are protected by CSRF defenses where appropriate and do not bypass authorization middleware.

How teams detect issues like this

Detection typically involves combining code-level and configuration-level scrutiny:

  • Static analysis or linters can flag patterns where JSON.parse is used on strings built via concatenation or template substitution of request parameters.
  • Code review should highlight any query construction logic that accepts untrusted input and directly feeds it into data source drivers, such as Mongo collection.find() or updateMany() calls.
  • Configuration reviews of Budibase apps can identify PUBLIC queries with broad filters or write actions and prioritize them for hardening.
  • Logging and security monitoring can watch for anomalous query traffic from unauthenticated sources, especially requests that return unusually large result sets or update many documents.

Sources

SourceLink
github.comgithub.com/Budibase/budibase/security/advisories/GHSA-8qv3-p479-cj62

Frequently asked

questions

Yes. The affected endpoint accepts requests with no session when the query is marked PUBLIC, so an unauthenticated visitor with access to the published app URL can exploit it.

Only the ability to send HTTP requests to the app's public query endpoint and include the public x-budibase-app-id header is required; no credentials or elevated roles are necessary.

Avoid building query filters via raw string substitution and JSON.parse. Instead, use structured parameter binding, ensure untrusted input is treated strictly as data, and apply server-side validation that enforces allowed operators and shapes.

Design query APIs so that user input is never allowed to control query structure, escape all special characters before interpolation, restrict public endpoints to minimal read-only operations, and incorporate automated checks and security reviews for any code that constructs queries from request parameters.

Find out what's already
exploitable in your codebase.