Remote Command Execution in Gogs Repository Contents API
CVE-2025-64111 is a critical vulnerability in Gogs, the self-hosted Git service, affecting version 0.13.3 and earlier. The flaw stems from an insufficient fix for CVE-2024-56731 in the repository content update logic. By bypassing security checks in the UpdateRepoFile function, an attacker can use the API to modify files within the repository’s .git directory, including repository configuration data. Abuse of this path validation weakness allows tampering with Git configuration in a way that leads to remote command execution on the Gogs server.
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
Successful exploitation can result in remote command execution on the server hosting Gogs. An attacker may be able to alter repository configuration to trigger execution of attacker-controlled commands, leading to full compromise of the affected service context. Depending on deployment architecture and privileges, this can enable unauthorized access to repository data, theft of sensitive information, service manipulation, and potential follow-on compromise of adjacent systems reachable from the Gogs host.
If you can’t patch tonight, do this now.
If immediate patching is not possible, restrict or disable the vulnerable repository contents update API functionality, particularly code paths invoking UpdateRepoFile. Enforce server-side validation that rejects writes to any path resolving into the .git directory, including through symlink-based path manipulation. Limit API access to trusted users and networks, reduce repository write permissions where possible, and monitor for suspicious attempts to modify repository configuration through content update operations.
Patch, then assume compromise.
Upgrade Gogs to version 0.13.4 or later. The issue is reported as patched in 0.13.4 and 0.14.0+dev. Because the vulnerability is due to an incomplete prior fix, administrators should ensure all affected instances are updated to a release that fully blocks writes resolving into the .git directory through the repository contents API.
No public exploits tracked yet. Mallory keeps watching.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
6 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.