Summary
DeepAudit has a server-side request forgery vulnerability in its repository URL handling that can expose server-wide GitLab or Gitea tokens. A registered user may exploit it by requesting branches for a project configured with a controlled host, potentially capturing tokens or reaching internal hosts.
Affected context
The issue affects DeepAudit's repository integration flow for GitLab or Gitea projects. It becomes risky when a registered user can supply or influence a repository_url and the server makes requests to that URL while exposing operator credentials or having access to internal hosts.
Exploit preconditions
- Attack surface: Server-side requests made by the GitLab or Gitea repository integration.
- Required access: A registered user account with the ability to create or configure a project.
- Trigger point: A branch request for a project whose
repository_urlpoints to a host controlled by the user. - Why exploitation is possible: The server processes a user-influenced URL in a way that can expose server-wide integration tokens or allow requests to internal hosts.
Why this happens
The underlying issue is insufficient restriction of destinations used for server-side requests based on user-controlled repository URLs. This maps to CWE-918: Server-Side Request Forgery, where an application can be induced to make requests to unintended hosts or network locations. If credentials are attached to or otherwise exposed through these requests, an attacker may capture them.
Potential impact
- An attacker may obtain server-wide GitLab or Gitea tokens.
- Requests could reach internal hosts that are not directly accessible to the attacker.
- Exposed tokens could enable unauthorized access to connected source-code services.
- Internal services or data could be exposed, depending on network access and permissions.
General mitigation guidance
Mitigation generally focuses on restricting outbound requests and separating user-supplied destinations from privileged credentials.
- Allow only approved repository hosts and required URL schemes.
- Avoid sending server-wide credentials to destinations that have not been explicitly trusted.
- Scope integration tokens to the minimum required permissions and projects.
- Restrict outbound network access from the application, especially to internal and metadata services.
- Validate destinations after DNS resolution and re-check them across redirects to reduce bypass risks.

