CVE-2025-3509 Code injection in Enterprise Server

High 7.1 Published Updated

Attackers with specific permissions can execute arbitrary code via pre-receive hooks during hot patch upgrades, leading to privilege escalation.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Over the internet
Victim action needed
Not needed
Fix
None listed

What is CVE-2025-3509?

CVE-2025-3509 is a high-severity code injection vulnerability in Github Enterprise Server, published on 17 Apr 2025. An attacker needs administrator access to exploit it, with no action from the victim.

Official description

A Remote Code Execution (RCE) vulnerability was identified in GitHub Enterprise Server that allowed attackers to execute arbitrary code by exploiting the pre-receive hook functionality, potentially leading to privilege escalation and system compromise. The vulnerability involves using dynamically allocated ports that become temporarily available, such as during a hot patch upgrade. This means the vulnerability is only exploitable during specific operational conditions, which limits the attack window. Exploitation required either site administrator permissions to enable and configure pre-receive hooks or a user with permissions to modify repositories containing pre-receive hooks where this functionality was already enabled. This vulnerability affected all versions of GitHub Enterprise Server prior to 3.18 and was fixed in versions 3.17.1, 3.16.4, 3.15.8, 3.14.13, 3.13.16. This vulnerability was reported via the GitHub Bug Bounty program.

Weakness: CWE-94

Which versions are affected by CVE-2025-3509?

It affects 1 product.

Products include Github Enterprise Server.

How do I fix CVE-2025-3509?

No fix has been published for CVE-2025-3509 yet. Limit exposure of the affected software until one is available.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2025-3509 being exploited?

There is no known exploitation of CVE-2025-3509 in the wild and no public exploit code.

All Github Enterprise Server vulnerabilities

Sources

Also known as GHSA-g3x6-r9w9-mcxx.

Is CVE-2025-3509 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free