Summary
Budibase's REST datasource query preview endpoint allows authenticated admins to supply arbitrary URLs that the server will request on their behalf, without sufficient validation.
This behavior can be abused to reach internal services and cloud metadata endpoints that are not exposed to the internet, enabling token theft, internal network enumeration, and broader cloud compromise depending on the environment.
Affected context
The vulnerability arises in Budibase deployments that:
- Use versions 3.30.6 and prior
- Expose the REST datasource query preview endpoint at
POST /api/queries/preview - Allow authenticated admin users to configure REST queries that specify arbitrary URLs in
fields.path - Run within an environment where internal services, cloud metadata endpoints, or internal network resources are reachable from the Budibase server
The risk is elevated in cloud deployments (AWS, GCP, Azure) where metadata endpoints can issue tokens with broad scopes.
Exploit preconditions
- Attack surface: The Budibase HTTP API, specifically
POST /api/queries/preview - Required access: Authenticated admin privileges in Budibase (or an account with equivalent access to REST datasource configuration and preview)
- Trigger point: Submitting a query preview request that sets
fields.pathto an attacker-controlled URL, causing the server to perform an outbound HTTP request - Why exploitation is possible: The endpoint performs server-side HTTP requests directly to user-supplied URLs without enforcing network-level or host-level restrictions and without robust validation against internal IP ranges, metadata endpoints, or reserved hosts
Why this happens
This issue is a classic instance of Server-Side Request Forgery (SSRF), mapped to CWE-918.
The affected Budibase endpoint is designed to help admins preview REST queries by having the server send HTTP requests to configured URLs. However, the implementation trusts the user-supplied fields.path parameter and forwards requests to arbitrary URLs without:
- Restricting destinations to a safe allowlist
- Blocking access to internal IP ranges and cloud metadata addresses
- Enforcing DNS or protocol-level safeguards to prevent pivoting into internal networks
By conflating user-controlled configuration with trusted server-side network access, the application exposes its privileged network position to authenticated users, allowing them to route traffic into otherwise unreachable internal or cloud control-plane services.
Potential impact
- Access to cloud provider metadata services, including:
- On GCP, theft of OAuth2 tokens with
cloud-platformscope, which can allow broad or full access to GCP resources for that project or account - On AWS or Azure, retrieval of instance credentials or access tokens associated with the running workload
- Enumeration and probing of internal network services (e.g., databases, message brokers, internal HTTP APIs, Kubernetes control-plane endpoints, or services bound only to private interfaces)
- Interaction with internal Kubernetes APIs and in-cluster services, potentially leading to lateral movement within the cluster
- Discovery of internal hostnames, IP ranges, ports, and service behaviors that can be combined with other vulnerabilities for further compromise
- Indirect data exposure if internal HTTP services respond with sensitive configuration, secrets, or system metadata
General mitigation guidance
Mitigation generally focuses on constraining server-initiated HTTP requests and hardening the app's network trust boundaries rather than relying solely on user discipline.
Useful defensive patterns include:
- Destination allowlisting: Restrict server-side HTTP requests to a managed set of approved domains or services that are required for Budibase functionality, and deny all others by default.
- Blocklist for sensitive ranges: Add explicit checks to prevent requests to:
- Cloud metadata endpoints (e.g.,
169.254.169.254, GCP metadata hostnames) - Private IP ranges (RFC1918, link-local, loopback, and other non-routable addresses)
- Internal-only hostnames, such as Kubernetes API cluster DNS names, unless explicitly required and tightly controlled.
- Network-layer segmentation: Use firewall rules, security groups, service meshes, or egress proxies to prevent the Budibase server from directly reaching cloud metadata services and sensitive internal networks.
- Privileged token hardening: In cloud environments, configure instance/service identities with the minimum necessary permissions so that any accessible metadata tokens are of limited value.
- Safer preview mechanisms: Where possible, redesign query preview functionality so that:
- Previews are simulated or constrained to known-safe backends
- Admin-configurable URLs are not used for free-form server-side requests without prior validation
- Administrative control discipline: Limit who holds Budibase admin roles and regularly review those assignments, recognizing that admins will have amplified impact if SSRF paths exist.
How teams detect issues like this
Detection efforts can look at both code-level patterns and runtime behavior:
- Static analysis and code review:
- Flag server-side HTTP client usage where URLs or hosts are derived from request parameters or admin-configured fields without validation.
- Look for HTTP client calls inside API handlers like
/api/queries/previewthat directly use user-controlled values forhost,URL, orpath. - Review configurations around query preview or integration features that offer "test connection" or "preview" actions from the server's perspective.
- Runtime monitoring and logging:
- Log outbound HTTP requests made by the Budibase server, including destination host, IP, and path, and monitor for:
- Requests to metadata addresses (e.g.,
169.254.169.254, GCP metadata hostnames) - Unexpected internal IP ranges or non-standard ports
- Correlate unusual outbound requests with admin actions or query preview invocations.
- Network-level controls:
- Use egress proxies or firewalls with logging enabled to detect attempts from the Budibase server to reach blocked destinations.
- Implement anomaly detection rules for new or unusual destinations reached by the application.
- Automated security tooling:
- Incorporate API-focused security scanners or SSRF-focused testing into CI/CD to identify endpoints that accept user-controlled URLs and make server-side calls without enforcement of safe destinations.

