Summary
HeyForm's /api/upload endpoint allows any anonymous internet user to upload arbitrary files and obtain a permanent public URL, without authentication or form-context binding.
This becomes risky when the service is exposed to the public internet, as it can be abused for hosting unwanted content, facilitating malware distribution, or aiding other attacks.
Affected context
The vulnerability occurs in HeyForm deployments where the /api/upload endpoint is reachable over the public internet and is not protected by authentication or contextual access controls.
It is relevant in environments that allow unauthenticated form submissions, rely on shared infrastructure, or assume that uploads are always tied to a valid form or user session.
In such cases, any incoming request to the upload API is treated as acceptable and results in files being stored and served from the HeyForm domain without ownership or purpose validation.
Exploit preconditions
- Attack surface: Publicly exposed HTTP API endpoint at
POST /api/upload. - Required access: No authentication, token, session, or form context is required; any internet-connected client can send requests.
- Trigger point: Sending a
POSTrequest with a supported file (e.g., PDF, DOC/DOCX, XLS/XLSX, CSV, TXT, MP4, images) up to the allowed size limit. - Why exploitation is possible: The endpoint lacks authentication guards, global guards, form-context checks, open token verification, and session cookie enforcement, so the system cannot distinguish legitimate uploads from arbitrary file hosting or abuse.
Why this happens
The underlying issue is a missing access control and contextual validation on a file upload endpoint.
Instead of binding uploads to an authenticated user, a validated form, or a scoped token, the implementation accepts any request and stores the file, mapping to CWE-306 (Missing Authentication for Critical Resource) and CWE-434 (Unrestricted Upload of File with Dangerous Type).
Conceptually, the design trusts that only intended clients will use the endpoint, but in a networked environment, unauthenticated, broadly accessible file upload APIs become generic hosting surfaces that can be abused for distributing arbitrary content, including potentially harmful or policy-violating files.
Potential impact
- Service may be abused as a free, anonymous file hosting platform.
- Attackers can upload potentially malicious or policy-violating content (e.g., malware, pirated material, offensive media).
- Public URLs on the HeyForm domain can be leveraged to lend credibility to phishing campaigns or social engineering attacks.
- Increased storage, bandwidth, and operational costs due to automated or bulk abuse.
- Potential reputational damage if harmful or illegal content is discovered hosted under the service's domain.
General mitigation guidance
Effective mitigation focuses on enforcing access control and contextual constraints on upload operations.
Common defensive patterns include:
- Requiring authentication or a scoped token for all file uploads, with clear association to a user or form instance.
- Implementing form-context validation so each upload is bound to a specific form configuration and submission flow.
- Applying least-privilege principles to upload endpoints, limiting who can initiate uploads and in what circumstances (e.g., creator-only vs controlled submitter flows).
- Enforcing strict file type and size validation, coupled with content scanning, to reduce the risk of hosting dangerous files.
- Designing URLs and storage policies so that uploads are not permanently public by default and can be expired or revoked based on ownership and policy.
How teams detect issues like this
Detection typically involves reviewing access control and API boundaries around file uploads.
Useful approaches include:
- Static analysis or code inspection to identify upload handlers that lack authentication, authorization, or context checks.
- API gateway or reverse-proxy policies that require tokens or sessions for all write operations, including file uploads.
- Logging and monitoring of upload traffic to detect anomalous patterns, such as high-volume anonymous uploads or suspicious file types.
- Periodic security reviews of public URLs and stored content to uncover abuse and inform policy and configuration adjustments.

