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

Arbitrary file write in Gogs PutContents API leading to SSH access

IdentifiersCVE-2024-55947CWE-22· Improper Limitation of a Pathname…

CVE-2024-55947 affects Gogs, the self-hosted Git service. According to the provided content, the flaw is in the PutContents/file update API and allows a malicious user to write a file to an arbitrary path on the server. Supporting context characterizes the issue as a path traversal flaw in the Gogs file update API that permits writes outside the intended repository boundary. This arbitrary file write can be used to place attacker-controlled content into sensitive locations on the host, ultimately enabling the attacker to gain SSH access to the server. The issue was fixed in Gogs version 0.13.1.

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 allows an attacker to overwrite arbitrary files on the underlying server outside the repository scope. Depending on the chosen target path, this can compromise sensitive system or application configuration files and enable unauthorized SSH access to the host. Because the flaw permits writes to attacker-selected filesystem locations, impact can extend to host compromise and, in practical terms, remote code execution or equivalent server takeover.

Mitigation

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

If immediate upgrade is not possible, reduce exposure of Gogs to untrusted users and networks. Restrict access to the instance, disable or tightly control user registration, and monitor for unexpected file modifications or abuse of repository file update functionality. These are general mitigations inferred from the described attack path; specific vendor mitigation guidance for CVE-2024-55947 is not otherwise provided in the content.

Remediation

Patch, then assume compromise.

Upgrade Gogs to version 0.13.1 or later, as the provided content states the vulnerability was fixed in 0.13.1. Apply the vendor patch addressing the PutContents API path traversal condition and validate that file-write operations are constrained to repository boundaries.
PUBLIC EXPLOITS

Exploits

1 valid exploit after Mallory filtered fakes, detection scripts, and README-only repos.

VALID 1 / 1 TOTALView more in app
CVE-2025-8110MaturityPoCVerified exploit

Repository contains two files: a README describing CVE-2025-8110 and a single Python exploit implementation (exploit.py). The exploit targets Gogs <= 0.13.3 and abuses the PutContents API path validation weakness by first committing a symlink into an attacker-controlled repository and then using the API to write through that symlink to an arbitrary server-side file. The code is a standalone Python CLI tool, not tied to a major exploitation framework. Based on the visible code and README, its workflow is: normalize target URL, create a requests session, optionally verify the target is Gogs/vulnerable, authenticate, create a repository, push a symlink via local git operations, invoke the vulnerable /api/v1/repos/.../contents/... endpoint, then optionally trigger execution depending on the selected strategy. Supported capabilities include check-only detection, arbitrary file write, SSH authorized_keys planting, cron-based reverse shell setup, .git/config sshCommand poisoning, and Git hook overwrite/triggering. The script also supports cleanup, JSON-style reporting, proxying, SSL verification control, and configurable timeout/output. Fingerprintable targets include the Gogs REST API prefix /api/v1 and sensitive filesystem paths such as /root/.ssh/authorized_keys, /etc/crontab, .git/config, and hooks/pre-receive. Overall, this is an operational authenticated web exploit that escalates a repository content-write primitive into arbitrary file overwrite and practical RCE on misconfigured or root-running Gogs deployments.

popyueDisclosed Apr 13, 2026pythonmarkdownwebnetwork
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 signatures1

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 activity8

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