Black Hat Europe 2025 | From Live Exploitation to Zero-Day Discovery: Investigating Attacks on Gogs
Why It Matters
Unpatched self‑hosted Git services can become a silent conduit for widespread remote code execution, demanding proactive monitoring and rapid patching of both code and configuration flaws.
Key Takeaways
- •Live malware alert led to discovery of a zero‑day in Gogs.
- •Exploited path‑traversal and symlink bugs allowed arbitrary file writes.
- •Attackers leveraged open repository creation to gain remote code execution.
- •Over 700 Gogs instances worldwide were compromised using unique patterns.
- •Behavioral indicators like repository names can reveal large‑scale compromises.
Summary
The Black Hat Europe 2025 talk detailed how a routine YARA‑based malware alert uncovered a previously unknown zero‑day vulnerability in the self‑hosted Git service Gogs. Researchers from Wiz traced the infection on a customer’s cloud server, ruled out common entry points, and eventually linked the breach to two unpatched bugs—a path‑traversal flaw in the put‑contents API and a symlink‑editing weakness in the web editor.
By chaining these flaws, an attacker could create a repository, commit a symbolic link to the .git/config file, and overwrite it via the API, injecting arbitrary commands that execute when Gogs accesses the repository. The exploit required only the default, publicly accessible repository creation feature, allowing remote code execution and exfiltration of sensitive files such as /etc/passwd.
The presenters demonstrated the attack live, showing how the malicious repository appeared with eight‑character random names and how a simple Python scanner identified the same pattern on hundreds of exposed Gogs instances. Shodan queries revealed roughly 1,500 public Gogs servers, and the custom script flagged over 700 compromised hosts, confirming a widespread campaign.
The incident underscores the risk of self‑hosted development tools that lack rigorous update cycles and default open‑access settings. It also highlights the value of behavioral indicators—like unique repository naming patterns—as powerful IOCs for detecting large‑scale compromises beyond traditional hash or IP signatures.
Comments
Want to join the conversation?
Loading comments...