CVE-2025-8110

8.8 HIGH CISA KEV

📋 TL;DR

CVE-2025-8110 is a path traversal vulnerability in Gogs' PutContents API that allows improper symbolic link handling, enabling authenticated attackers to write arbitrary files and achieve remote code execution. This affects Gogs instances with authenticated user access. The vulnerability stems from insufficient validation of symbolic links in file operations.

💻 Affected Systems

Products:
  • Gogs
Versions: Versions prior to 0.14.0
Operating Systems: All platforms running Gogs
Default Config Vulnerable: ⚠️ Yes
Notes: Requires authenticated user access; affects all default installations with user accounts.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full server compromise with root/system-level code execution, data exfiltration, lateral movement, and persistent backdoor installation.

🟠

Likely Case

Authenticated attackers achieving remote code execution with the privileges of the Gogs service account, potentially leading to repository manipulation, credential theft, and further network exploitation.

🟢

If Mitigated

Limited impact with proper network segmentation, minimal service privileges, and strict access controls preventing successful exploitation or lateral movement.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires authenticated access but is straightforward once authentication is obtained; public proof-of-concept code is available.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.14.0 and later

Vendor Advisory: https://github.com/gogs/gogs/security/advisories/GHSA-xxxx-xxxx-xxxx

Restart Required: Yes

Instructions:

1. Backup your Gogs data and configuration. 2. Download Gogs version 0.14.0 or later from the official repository. 3. Stop the Gogs service. 4. Replace the existing Gogs binary with the new version. 5. Restart the Gogs service. 6. Verify the version is updated.

🔧 Temporary Workarounds

Disable PutContents API

all

Temporarily disable or restrict access to the vulnerable PutContents API endpoint.

Modify Gogs configuration to block or require additional authentication for the affected API endpoint.

Restrict User Permissions

all

Limit authenticated users to minimal necessary permissions and implement strict access controls.

Review and adjust user roles and permissions in Gogs administration panel.

🧯 If You Can't Patch

  • Implement network segmentation to isolate Gogs instances from critical systems.
  • Deploy application-level firewalls or WAF rules to block suspicious API requests targeting the PutContents endpoint.

🔍 How to Verify

Check if Vulnerable:

Check the Gogs version; if it's below 0.14.0, the system is vulnerable. Review logs for suspicious file write operations via the PutContents API.

Check Version:

gogs --version or check the version in the Gogs web interface under Settings > About.

Verify Fix Applied:

Confirm the Gogs version is 0.14.0 or higher and test that symbolic link handling in file operations is properly validated.

📡 Detection & Monitoring

Log Indicators:

  • Unusual file write operations via PutContents API, especially involving symbolic links or path traversal patterns.

Network Indicators:

  • Suspicious HTTP requests to the PutContents endpoint with crafted parameters.

SIEM Query:

source="gogs.log" AND (PUT /api/v1/repos/*/contents/* OR path_traversal OR symlink)

🔗 References

📤 Share & Export