Summary
Gerapy up to version 0.9.13 contains a missing authentication flaw in its project upload endpoint, allowing unauthenticated users to interact with backend functionality that should be protected.
When this endpoint is exposed over the network, a remote attacker may be able to upload or replace project resources without valid credentials, depending on deployment configuration.
Affected context
This vulnerability occurs in Gerapy installations that expose the project upload endpoint defined in gerapy/server/core/views.py.
It is relevant when the server is reachable over a network (e.g., internet or internal LAN) and no additional reverse-proxy or network-layer authentication is enforced.
Under these conditions, an attacker can reach the upload API without being required to present valid user credentials, enabling unauthorized project-level operations.
Exploit preconditions
- Attack surface: HTTP(S) project upload endpoint in the Gerapy server.
- Required access: Network-level access to the Gerapy web interface; no valid application account is strictly required if endpoint is left unprotected.
- Trigger point: Directly invoking the project upload route with crafted HTTP requests.
- Why exploitation is possible: The handler responsible for processing project uploads does not correctly enforce authentication and/or authorization checks, allowing anonymous callers to perform operations intended only for authenticated users.
Why this happens
The root cause aligns with CWE-287: Improper Authentication and CWE-306: Missing Authentication for Critical Function.
A critical server-side endpoint responsible for handling project uploads is implemented without robust verification that the caller is an authenticated and authorized user.
This may stem from relying solely on client-side assumptions, misconfigured decorators or middleware, or placing the endpoint outside of the normal authentication flow.
As a result, the system treats unauthenticated requests as trusted, exposing sensitive functionality over a remote attack surface.
Potential impact
- An attacker may upload arbitrary projects or code into the Gerapy environment.
- An attacker could overwrite or replace existing project configurations, potentially disrupting scheduled scraping jobs.
- Unauthorized modifications can lead to data integrity issues, scraping of unintended targets, or exfiltration of collected data through malicious project logic.
- Operational outages or instability can occur if malformed or hostile uploads interfere with normal job execution.
General mitigation guidance
Mitigation typically focuses on enforcing strong authentication and access control on all critical endpoints:
- Ensure upload and administrative routes are consistently wrapped in server-side authentication and authorization checks (e.g., login-required decorators, middleware, role-based access control).
- Centralize authentication logic so that new views or APIs cannot bypass it inadvertently.
- Restrict project management operations to dedicated administrative roles and segregate duties where possible.
- Place the Gerapy interface behind an authenticated reverse proxy or VPN to limit direct exposure.
- Apply least-privilege principles to the runtime environment so that uploaded content has constrained capabilities.
How teams detect issues like this
Effective detection approaches include:
- Static analysis rules or code scanning patterns that flag view functions or routes lacking authentication decorators or middleware, especially under admin or upload paths.
- Manual code review focusing on server-side endpoints that modify state (create/update/delete/upload) to verify consistent use of authentication and authorization mechanisms.
- Configuration and policy checks ensuring that all administrative URLs are covered by authentication policies at the application and reverse-proxy layers.
- Runtime monitoring and logging to detect unusual upload activity patterns or accesses from unexpected IP ranges, leveraging alerting on unauthenticated POST requests to sensitive endpoints.

