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.
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.
- Went after
- Take over the GHES appliance
- 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
The whole attack, one row per step. Pick a step on the left, or click a box in its row.
Exploitation needed site administrator rights to enable and configure pre-receive hooks, or permission to modify a repository where hooks were already enabled.
What breaks this step
- Keep GitHub Enterprise Server on a supported release with current patches
- Keep the Management Console and admin SSH off the general network.
Some services use dynamically allocated ports that become available briefly, for example during a hot patch upgrade. Hook code running in that window could take one over, which limits when the attack works.
That gave code execution outside the hook, leading to privilege escalation and compromise of the instance. Every version before 3.17 was affected; it was fixed in 3.16.2, 3.15.6, 3.14.11 and 3.13.14 after a bug bounty report.
Frameworks
Part of
Fixed. First seen April 2025. Mapping by ghtier, not yet reviewed. Threat landscape