Budibase REST Connector SSRF via Empty Blacklist
A critical Server-Side Request Forgery (SSRF) vulnerability in Budibase's REST datasource connector allows attackers with Builder privileges to exfiltrate sensitive data from internal network services due to a missing default IP blacklist.
A critical Server-Side Request Forgery (SSRF) vulnerability exists in Budibase version 3.30.6, affecting self-hosted instances that do not explicitly configure the BLACKLIST_IPS environment variable. The vulnerability resides within the REST datasource connector and the backend-core blacklist module. Due to the absence of a default IP blacklist, the isBlacklisted() function in packages/backend-core/src/blacklist/blacklist.ts unconditionally returns false, bypassing SSRF protection. This allows users with Builder privileges or QUERY WRITE permissions to create malicious REST datasources, query internal services, and exfiltrate sensitive data, including CouchDB credentials, application data, and internal service metadata. This vulnerability impacts confidentiality, integrity, and availability, potentially leading to complete instance takeover.
Attack Chain
- An attacker with
Builderprivileges logs into the Budibase application. - The attacker creates a new REST datasource via
POST /api/datasources, configuring it to target an internal service likehttp://couchdb-service:5984. - The Budibase server, specifically the
packages/server/src/integrations/rest.tscomponent, evaluates the URL against the blacklist. Due to the emptyBLACKLIST_IPS, theisBlacklisted()function returnsfalse. - The REST integration proceeds with the request using the
fetchAPI, sending the request to the specified internal service. - The internal service (e.g., CouchDB) responds with data.
- The attacker creates a query via
POST /api/queriesthat uses the malicious REST datasource. - The attacker executes the query via
POST /api/v2/queries/:id, triggering a request to the internal service. - The response from the internal service, containing sensitive data like database credentials or application data, is returned to the attacker, enabling data exfiltration or further exploitation.
Impact
Successful exploitation allows attackers to read CouchDB databases, including user credentials (bcrypt password hashes) and platform configurations. They can also modify user records, create new admin accounts, alter application data, or delete databases. The vulnerability enables resource exhaustion, database destruction, and service disruption. The vulnerability crosses the security boundary between the Budibase application layer and the infrastructure layer, granting access to CouchDB, MinIO, Redis, and other internal services.
Recommendation
- Immediately set the
BLACKLIST_IPSenvironment variable in your Budibase deployment to include at least127.0.0.1, private IP ranges (10.0.0.0/8,172.16.0.0/12,192.168.0.0/16), link-local addresses (169.254.0.0/16), and cloud metadata endpoints to mitigate the SSRF vulnerability. - Restrict
BUILDERrole access to only trusted users. Consider using the principle of least privilege for application-level permissions. - Deploy the Sigma rule “Detect Budibase REST Datasource Creation Targeting Internal IPs” to your SIEM and tune for your environment to detect potential exploitation attempts.
- If you have unpatched instances of Budibase and have granted
QUERY WRITEpermissions widely, immediately audit and revoke those permissions from untrusted users. - Monitor webserver logs for unusual requests originating from the Budibase application server to internal IP addresses or services, particularly those used by CouchDB, Redis, or MinIO, to identify potential SSRF attempts.
Detection coverage 2
Detect Budibase REST Datasource Creation Targeting Internal IPs
highDetects the creation of Budibase REST datasources that target internal IP addresses, indicating potential SSRF exploitation.
Detect Budibase Query Execution Targeting Internal REST Datasources
mediumDetects execution of queries that use a REST datasource pointing to a private IP address, indicating potential SSRF exploitation.
Detection queries are kept inside the platform. Get full rules →