Summary
A missing authorization check in Budibase's attachment upload endpoint allows anonymous callers to obtain pre-signed AWS S3 PUT URLs minted with the victim's IAM credentials.
By knowing or guessing valid workspace and S3 datasource identifiers, an attacker can write arbitrary objects to any bucket those IAM credentials can access, creating a high-impact cloud account abuse scenario.
Affected context
This vulnerability arises in Budibase deployments that expose the /api/attachments/:datasourceId/url route with public access and S3-backed datasources.
It becomes relevant where workspaces and datasource identifiers can be enumerated or inferred, and where the configured AWS IAM credentials grant write access to one or more buckets.
The issue is especially risky in environments where Budibase is connected to production cloud storage or broader AWS accounts using powerful IAM roles.
Exploit preconditions
- Attack surface: Public HTTP endpoint
POST /api/attachments/:datasourceId/url - Required access: Network reachability to the Budibase server; no authenticated session is required
- Attacker knowledge: Ability to know or enumerate a valid workspace id (
app_...) and S3 datasource id (ds_...) - Trigger point: Calling the endpoint with crafted JSON specifying a target bucket and object key
- Why exploitation is possible: The route is registered with
publicAllowed: trueand only recaptcha middleware, omitting authorization checks. The controller uses stored IAM access keys to generate a pre-signed PUT URL for attacker-chosen bucket and key, not constrained to the datasource's configured bucket.
Why this happens
The core bug is a missing authorization control on a high-privilege backend operation, aligning with CWE-862: Missing Authorization.
The static file upload endpoint is treated as publicly accessible, yet it performs actions on behalf of a specific workspace and datasource using stored AWS IAM credentials.
Instead of enforcing that the requester is authenticated and authorized within the workspace context, the code path allows anonymous requests and trusts workspace and datasource identifiers supplied via headers, body, query string, or path segments.
Additionally, the design fails to pin uploads to the datasource's configured bucket, allowing the operation to be redirected to any bucket reachable with those IAM credentials.
Potential impact
- Anonymous attackers can write arbitrary objects into any S3 bucket accessible to the configured IAM credentials
- Data tampering or overwrite of existing objects in victim-controlled buckets
- Abuse of victim IAM identity for malicious storage operations (e.g., staging malware, phishing content, or exfiltration dumps)
- Potential escalation into wider cloud account compromise if write access is granted to critical buckets or infrastructure artifacts
- Financial impact from unexpected storage or bandwidth consumption due to attacker-driven uploads
General mitigation guidance
Effective mitigation focuses on enforcing strict authorization on sensitive routes and constraining cloud-side actions:
- Require authenticated, workspace-scoped authorization for endpoints that mint pre-signed URLs or operate on cloud resources
- Bind upload operations to the datasource's configured bucket and key prefix, avoiding attacker-controlled bucket parameters
- Minimize the scope of IAM credentials used by application datasources, following least-privilege principles and separating roles per app or environment
- Centralize and audit access control policy for API routes so that "publicAllowed" or anonymous access is only used for genuinely low-risk operations
- Prefer server-side validation of workspace and datasource relationships instead of trusting identifiers supplied by clients in multiple contextual fields
How teams detect issues like this
Organizations can identify similar authorization flaws by:
- Reviewing route registration and middleware chains, looking for sensitive controllers exposed with
publicAllowedor without authentication/authorization middleware - Using static analysis or policy-as-code tools to flag endpoints that perform cloud operations (e.g., creating pre-signed URLs, manipulating storage) without explicit permission checks
- Conducting threat modeling sessions to map user roles, workspace contexts, and high-privilege actions, then verifying that all such actions require appropriate authorization
- Implementing runtime logging and anomaly detection for pre-signed URL generation, including tracking caller identity, target bucket, and key, and alerting on anonymous or unusual patterns
- Periodically auditing IAM usage to detect abnormal access from application-linked identities, such as unexpected uploads to non-standard buckets

