ghtier

These write-ups are not threat intelligence and are not kept up to date as an incident develops. They are here to show how each attack worked, so you can find and fix the same techniques in your own setup. For the latest on an incident, read its sources.

← All incidents

CVE-2025-3509: pre-receive hook RCE via port reuse

Fixed 2025 · Fixed

During windows such as a hot patch upgrade, a pre-receive hook on GitHub Enterprise Server could take over a dynamically allocated port that briefly became free and run code on the appliance, for a site admin or anyone who could edit a repository with hooks.

Access held
T0Site administrator (Enterprise Server)Code execution on the appliance
Full summary

CVE-2025-3509 (CVSS 7.2) was a remote code execution flaw in GitHub Enterprise Server's pre-receive hooks. Some internal services use dynamically allocated ports that become free for a moment, for example during a hot patch upgrade, and hook code could use that window to run commands beyond the hook, leading to privilege escalation on the appliance. It needed site administrator rights to enable and configure hooks, or permission to modify a repository whose hooks were already enabled. It affected every version before 3.17 and was fixed in 3.16.2, 3.15.6, 3.14.11 and 3.13.14 after a bug bounty report.

How it unfolded

Pick a step to zoom into it. A dashed line is a step the sources do not state. Blue dots are the checklist items that break the step.

Whole path

Vulnerability in GitHubEnterprise Serverway inSite administrator (EnterpriseServer)Or a hook repo editorEscalate from a GHES roleto roottechniqueCode execution on theapplianceHook code in the window

The whole attack, one row per step. Pick a step on the left, or click a box in its row.

Frameworks

Part of

Fixed. First seen April 2025. Mapping by ghtier, not yet reviewed. Threat landscape

Sources