Summary
A server-side request forgery (SSRF) vulnerability in GitHub Enterprise Server's upload endpoint allowed crafted requests to be routed to internal services due to insufficient input validation and path traversal handling.
An unauthenticated attacker could abuse this behavior to coerce the server into making internal API calls, which may expose sensitive credentials or internal service data when the upload functionality is reachable from untrusted networks.
Affected context
The vulnerability occurs in GitHub Enterprise Server instances that expose the affected upload endpoint to users or automated clients.
It manifests when user-controlled request parameters that influence internal request routing or destinations are not adequately sanitized, allowing path traversal elements to alter the intended request flow.
In deployments where the GitHub Enterprise Server host can reach internal APIs, metadata endpoints, or backing services, the SSRF can be used to target those internal resources.
Exploit preconditions
- Attack surface: Publicly or internally accessible upload endpoint on GitHub Enterprise Server.
- Required access: Network access to the endpoint; no authentication required under the described conditions.
- Trigger point: Submission of a crafted upload request containing path traversal content or manipulated parameters that influence the internal request path or target.
- Why exploitation is possible: The server reuses user-supplied request parameters to construct internal requests without robust normalization and validation, allowing path traversal to bypass intended routing and reach internal services.
Why this happens
This issue stems from the server treating user-controlled input as trustworthy when building internal requests.
Path traversal sequences and unvalidated parameters are allowed to influence the internal request path or target endpoint, enabling the attacker to redirect or repurpose the server's own HTTP client toward internal resources.
This maps to CWE-918: Server-Side Request Forgery (SSRF), where an application with broader network reach than the attacker becomes an involuntary proxy to internal networks and sensitive services.
Potential impact
- An attacker may coerce the server into issuing requests to internal APIs or services that are not directly exposed to the internet.
- Internal service metadata or configuration endpoints could be queried, potentially revealing service credentials, tokens, or other secrets.
- The attacker can potentially enumerate internal hostnames or endpoints reachable from the GitHub Enterprise Server instance.
- Depending on the internal services' behavior, this could enable lateral movement or further compromise of infrastructure.
General mitigation guidance
Effective mitigation focuses on constraining where and how server-side requests can be made and reducing trust in user-controlled input:
- Introduce strict allowlists for all internal destinations that server-side components are permitted to contact, and reject or drop any request that falls outside these boundaries.
- Normalize and strictly validate all path and URL-related parameters used to construct internal requests, removing or rejecting path traversal sequences and ambiguous encodings.
- Decouple user input from low-level request construction by mapping user actions to predefined internal routes instead of passing user-supplied URLs or paths through directly.
- Apply network-level segmentation and egress controls so that application components have minimal reachable internal services and cannot freely access metadata or management endpoints.
- Limit the value and scope of credentials or tokens accessible via internal endpoints, and store sensitive secrets behind dedicated access-control and auditing layers.
How teams detect issues like this
Organizations can use a combination of code-level and operational strategies to detect SSRF patterns:
- Static analysis rules that flag use of user-controlled variables in URL, host, or path construction for outbound HTTP requests.
- Code review checklists that explicitly call out SSRF risks when developers introduce HTTP clients, proxy features, or upload/redirect endpoints.
- Centralized HTTP client wrappers or service layers with built-in logging and enforcement of destination allowlists, making policy violations easier to detect.
- Runtime monitoring of outbound traffic from GitHub Enterprise Server hosts, including anomaly detection for requests targeting internal IP ranges, metadata endpoints, or unexpected ports.
- Use of automated security testing tools or DAST scanners configured to probe endpoints for SSRF behavior using controlled payloads and internal-canary URLs.

