Skip to main content
Live Webinar with SANS (June 25)— Agentic CTI Automation for Fun & ProfitRegister Free
Mallory
CriticalPublic exploit

Gogs built-in SSH server argument injection RCE

IdentifiersCVE-2024-39930CWE-88· Improper Neutralization of…

CVE-2024-39930 is an argument injection vulnerability in the built-in SSH server of Gogs affecting versions through 0.13.0. According to the provided content, the flaw exists in internal/ssh/ssh.go and can be triggered by an authenticated attacker who opens an SSH connection to a Gogs instance with the built-in SSH server enabled and sends a malicious --split-string environment request. Improper handling of attacker-controlled input allows command-line argument injection, which can lead to remote code execution. The content states that Windows installations are unaffected.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation can result in remote code execution on the Gogs server. This gives an authenticated attacker the ability to execute commands in the security context of the affected Gogs service/process, potentially leading to full compromise of the application host, access to repositories and associated secrets available to that process, and follow-on post-exploitation activity.

Mitigation

If you can’t patch tonight, do this now.

If immediate patching is not possible, disable Gogs's built-in SSH server and use an external SSH service instead, or otherwise prevent untrusted users from accessing the built-in SSH interface. Restrict SSH access to trusted administrators/users only and reduce exposure of the Gogs SSH service from untrusted networks. These are compensating controls only; patching is the definitive fix.

Remediation

Patch, then assume compromise.

Upgrade Gogs to a version newer than 0.13.0 that includes the vendor fix for CVE-2024-39930. Because the issue is in the built-in SSH server code path, ensure the deployment is updated to a release in which the argument injection flaw in internal/ssh/ssh.go has been corrected.
PUBLIC EXPLOITS

Exploits

3 valid exploits after Mallory filtered fakes, detection scripts, and README-only repos (2 hidden).

VALID 3 / 5 TOTALView more in app
CVE-2025-81110-PoCMaturityPoCVerified exploit

This repository is a small standalone Python exploit PoC consisting of one executable script (CVE-2025-81110.py), a README, and a license. The script uses the requests library plus local git subprocess calls to exploit a Gogs content-update symlink handling flaw. The workflow is: authenticate with valid credentials, create an API token, create an empty repository, initialize a temporary local Git repo, push a symlink named evil_link that points to the server-side pre-receive hook path, query the repository contents API to recover the symlink SHA, then use the PutContents API to overwrite the symlink target with a base64-encoded shell script. A final Git push triggers the modified hook and executes the payload on the server. The exploit has two built-in capabilities: (1) 'suid' mode copies /bin/bash to /tmp/rootbash and sets mode 4755 for local privilege escalation, and (2) 'rev' mode writes a bash reverse shell that connects back to an attacker-supplied host and port. The exploit is operational rather than a simple detector because it performs the full attack chain and includes working payloads, though payload customization is limited to the reverse-shell callback parameters. Notable fingerprintable targets include multiple Gogs API endpoints under /api/v1/, the Git remote path for the created repository, the internal hook path /root/gogs-repositories/<user>/<repo>.git/hooks/pre-receive, and the payload artifact /tmp/rootbash. The README states the target is Gogs prior to 0.13.0 and describes the issue as improper symbolic link handling in the PutContents API. There is a naming inconsistency: the script banner references CVE-2024-39930 while the repository and filename reference CVE-2025-81110, but the code clearly implements an authenticated Gogs symlink-to-hook overwrite leading to server-side command execution.

BridgerAldersonDisclosed Apr 11, 2026pythonmarkdownwebnetwork
-CVE-2024-39930MaturityPoCVerified exploit

This repository contains a working exploit for CVE-2024-39930, a critical remote code execution vulnerability in Gogs (<= 0.13.0). The exploit is implemented in Python (exploit.py) and leverages both the Gogs HTTP API and SSH access to achieve arbitrary command execution on the target server. The attack chain involves authenticating to the Gogs API with valid user credentials, creating an API token, generating a temporary repository, clearing and uploading a malicious SSH key, and finally connecting via SSH to inject and execute arbitrary shell commands using argument injection. The exploit requires the attacker to have valid credentials and the ability to upload SSH keys. The code is operational and automates the full exploitation process, including API interaction and SSH command execution. The README.md provides a brief description of the vulnerability. No hardcoded endpoints are present; the target is specified at runtime. The main entry point is exploit.py, which is well-structured and modular, with clear separation of API interaction and SSH exploitation logic.

alexander47777Disclosed Jul 22, 2025pythonnetwork
CVE-2024-39930-PoCMaturityPoCVerified exploit

This repository provides a working exploit for CVE-2024-39930, a remote command execution (RCE) vulnerability in Gogs (<=0.13.0) via its SSH server. The repository contains three files: a README.md describing the exploit, 'exploit.py' (the main exploit script), and 'gogs_install.sh' (a helper script to set up a vulnerable Gogs instance). The exploit works by leveraging the Gogs API to authenticate as a user, create a repository, and add an attacker-controlled SSH key. It then connects to the Gogs SSH server using the provided private key and abuses argument injection to execute arbitrary shell commands on the server. The exploit requires valid Gogs credentials and access to the SSH server (default port 2222 as per the install script, but configurable). The 'exploit.py' script is written in Python and automates the entire attack chain: API token acquisition, repository creation, SSH key management, and command execution via SSH. The payload is any shell command supplied by the attacker. The 'gogs_install.sh' script sets up a Gogs instance with PostgreSQL and configures it to run the vulnerable version with SSH enabled for testing purposes. Key endpoints include the Gogs web API (e.g., http://gogs.local:3000/api/v1), the SSH server (default localhost:2222), and several file paths used in the installation and configuration process. The exploit is operational and demonstrates full RCE capability against vulnerable Gogs instances.

theMcSamDisclosed Jun 29, 2025pythonbashnetwork
EXPOSURE SURFACE

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
GogsGogsapplication

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware

Malware families riding this exploit, with evidence and IOCs.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity3

Community discussion across Reddit, Mastodon, and other social sources.