/

CVE-2026-76851

Severity:

HIGH RISK

(8.8)

SSRF (CWE-918) in GitHub Enterprise Pre-Receive Hooks

CVE-2026-76851

Analyzed

Vulnerability type

Category:

Server-Side Request Forgery

CWE:

CWE-918

Impact:

Remote Code Execution and Privilege Escalation

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A server-side request forgery vulnerability in GitHub Enterprise Server allowed malicious pre-receive hook code to impersonate an internal service and redirect trusted requests to a privileged service. Under specific repository access and networking conditions, successful exploitation could result in remote code execution on the GitHub Enterprise Server instance.

Affected context

The vulnerability occurs in GitHub Enterprise Server deployments where pre-receive hook networking is enabled. Risk is present when an attacker has site administrator privileges or write access to a repository containing a configured pre-receive hook, and when insufficient network isolation allows hook-originated requests to reach privileged internal services.

Exploit preconditions

  • Attack surface: Network requests initiated by repository pre-receive hook code
  • Required access: Site administrator privileges or write access to a repository with a configured pre-receive hook
  • Trigger point: Execution of the pre-receive hook while networking is enabled
  • Why exploitation is possible: Weak network isolation permits hook code to impersonate an internal service and redirect trusted requests toward a privileged service

Why this happens

The underlying issue is insufficient isolation between user-influenced pre-receive hook execution and privileged internal services. Requests originating from hook code were trusted or routable in a way that allowed them to access internal service functionality beyond the hook's intended authority. This behavior maps to CWE-918: Server-Side Request Forgery, where an attacker can influence a server-side component to make requests to unintended internal destinations.

Potential impact

  • An attacker could execute code with elevated privileges on the GitHub Enterprise Server instance
  • Internal services could be accessed or impersonated
  • Repository confidentiality and integrity could be affected
  • The GitHub Enterprise Server environment could be further compromised
  • Administrative controls or hosted development workflows could be disrupted

General mitigation guidance

Mitigation generally focuses on reducing trust between hook execution environments and privileged internal services.

Common defensive patterns include:

  • Disabling pre-receive hook networking when it is not required
  • Enforcing strict egress filtering and network segmentation for hook processes
  • Using explicit service allowlists rather than broad internal network reachability
  • Separating hook execution from privileged services and authentication contexts
  • Applying least-privilege identities and narrowly scoped credentials to hook workloads
  • Treating all repository-controlled hook code as untrusted input
  • Restricting repository write permissions and reviewing configured hooks

These controls reduce the likelihood that a hook can impersonate an internal component or reach privileged functionality.

How teams detect issues like this

Organizations can look for this vulnerability class through:

  • Static analysis and code review rules for server-side request destinations influenced by repository content
  • Review of pre-receive hook configuration, execution permissions, and network access
  • Network telemetry identifying hook processes making requests to internal or administrative services
  • Egress policies that alert on unexpected destinations, metadata endpoints, or privileged service interfaces
  • Audit logs correlating repository writes, hook execution, and unusual administrative activity
  • Automated security review tools that flag SSRF-prone request handling and missing network boundaries

Sources

SourceLink
docs.github.comdocs.github.com/en/enterprise-server@3.17/admin/release-notes#3.17.20
docs.github.comdocs.github.com/en/enterprise-server@3.18/admin/release-notes#3.18.14
docs.github.comdocs.github.com/en/enterprise-server@3.19/admin/release-notes#3.19.11
docs.github.comdocs.github.com/en/enterprise-server@3.20/admin/release-notes#3.20.7
docs.github.comdocs.github.com/en/enterprise-server@3.21/admin/release-notes#3.21.5

Frequently asked

questions

It can be exploitable through GitHub Enterprise Server functionality when the required repository or administrative access exists and pre-receive hook networking is enabled. It is not generally an unauthenticated attack.

Exploitation requires site administrator privileges or write access to a repository containing a configured pre-receive hook, along with a deployment configuration that permits the relevant network requests.

The safest pattern is to isolate hook execution from privileged internal services, restrict outbound connectivity with explicit allowlists, and disable hook networking where it is unnecessary.

Treat repository-controlled hooks as untrusted code, enforce least privilege, segment internal services, monitor hook-originated traffic, and review changes to hook configuration and repository permissions.

Find out what's already
exploitable in your codebase.