Summary
Open-Generative-AI contains an unrestricted file upload vulnerability in the S3 Upload functionality exposed through /api/upload-binary. If a remote attacker can reach the endpoint and influence the x-proxy-target-url value, they may upload files without adequate authorization or type restrictions.
Affected context
The issue affects deployments of Anil-matcha Open-Generative-AI through versions 1.0.11 and 2.0.0 when the S3 Upload endpoint is exposed and does not sufficiently constrain proxy target handling or uploaded content. Risk depends on how uploaded objects are stored, whether they are publicly reachable or executable, and the permissions available to the application.
Exploit preconditions
- Attack surface: Network-accessible
/api/upload-binaryendpoint - Required access: Ability to send requests to the upload functionality; authentication requirements may vary by deployment
- Trigger point: Processing of an upload request containing a user-controlled
x-proxy-target-urlvalue - Why exploitation is possible: Insufficient authorization and upload restrictions may allow attacker-controlled content to be written to an unintended or insufficiently protected destination
Why this happens
The vulnerability reflects inadequate access control and file upload validation. A request-controlled proxy target is accepted in the S3 Upload flow without reliably restricting where content may be sent or enforcing strong controls over the uploaded object. This maps primarily to CWE-434: Unrestricted Upload of File with Dangerous Type, with CWE-284: Improper Access Control also relevant where authorization boundaries are not properly enforced.
Potential impact
- An attacker may store unauthorized files in application-managed or cloud-backed storage
- Uploaded content could be used to host malicious material or phishing resources
- Public or executable storage configurations could increase the risk of code execution or client-side attacks
- The application or associated storage account could experience data integrity, availability, or reputational impact
General mitigation guidance
Mitigation generally focuses on enforcing authorization and treating every upload destination and file as untrusted.
Common defensive patterns include:
- Allowing uploads only to server-selected destinations rather than accepting arbitrary proxy targets
- Enforcing strict allowlists for permitted storage locations, buckets, prefixes, and endpoints
- Validating file type, size, name, and content independently of client-supplied metadata
- Storing uploads outside executable or publicly served paths by default
- Applying least-privilege permissions to application and storage identities
- Using isolated storage with safe content-disposition and access policies
- Limiting upload rates and recording security-relevant upload events
How teams detect issues like this
Detection approaches can include:
- Static analysis for upload handlers that use client-controlled paths, URLs, bucket names, or object keys
- Code review checks for missing authorization, content validation, destination allowlists, and executable storage separation
- Web-application policy rules that alert on unusual
x-proxy-target-urlvalues or uploads to unapproved destinations - Monitoring object-storage events for unexpected prefixes, file types, public-access changes, or anomalous upload volumes
- Automated security review tools that identify unrestricted upload and access-control patterns during CI analysis

