Gogs
CVE-2025-8110
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate with repo write access
-
DeliveryPlant symlink via file-editor API
-
ExploitCall PutContents with traversing path
-
ExecutionWrite file outside repository root
-
ImpactExecute code on Gogs server
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK
2 techniques across 2 tactics: Discovery, Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires an authenticated account with write/push access to at least one repository (consistent with PR:L); the attacker then abuses the Gogs file-editor 'PutContents' API path, where the pre-patch UpdateRepoFile/GetDiffPreview logic only checked the final target for being a symlink and failed to reject symlinks anywhere in the path hierarchy, allowing a planted symlink to redirect the os.WriteFile write outside the repository working directory and achieve code execution. Limiting factors: exploitation is gated on obtaining repository write permission (not fully anonymous), and no victim user interaction is needed (UI:N). The fix (commit 553707f3) rejects any operation where hasSymlinkInPath detects a symlink in the path, so patched instances are not exploitable via this vector. |
| Impact | This is a genuine top-priority vulnerability, with multiple independent signals aligning rather than conflicting. CISA KEV confirms active exploitation in the wild, EPSS is 85.20% at the 100th percentile (among the most likely-to-be-exploited CVEs tracked), and a public exploit exists (Wiz Research RCE write-up plus the upstream PR). The provided CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:L/UI:N, VC:H/VI:H/VA:H) with SSVC-style metrics E:A (attacked) and V:C (concentrated/confirmed) reinforces that this is weaponized, not theoretical. The one notable tension is that the NVD description labels this 'Local Execution of Code' while the CVSS vector is AV:N (network): the realistic reading is that a remote, network-reachable but authenticated user (PR:L - needs a valid account with repository write access) abuses the server-side file-editor API to achieve code execution ON the server host; the 'local' wording likely refers to the server-side code-execution outcome rather than requiring local/console access. Net: not a high-CVSS-but-low-real-risk issue - treat as emergency patching given KEV + public exploit + near-certain EPSS. |
| Exploit ScenarioDerived | An attacker who holds (or registers/obtains) an account with write access to a Gogs repository uses the file-editor 'PutContents' API to create or update a file along a path that passes through an attacker-planted symbolic link, causing Gogs to write attacker-controlled content to a location outside the intended repository directory and leading to code execution on the server. A public proof-of-concept and technical exploit write-up exist (Wiz Research), and CISA KEV confirms this chain is being used in the wild. The low attack complexity (AC:L) and lack of required user interaction make exploitation straightforward once write access is held. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 14, 2026
Code execution on Gogs servers is possible through improper symbolic-link handling in the repository file editor's PutContents API, which allows an authenticated user holding write/push access to at least one repository to plant a symlink and redirect file writes outside the repository working directory. The issue is confirmed actively exploited (CISA KEV), publicly available exploit code exists, and the EPSS score is 85.20% (100th percentile), placing it among the highest-priority items to patch. Exploitation requires only repository write permission - no victim interaction is needed (CVSS 3.1 vector PR:L, UI:N) - and it is rated CVSS 8.7.
RemediationAI
The primary fix is the upstream commit 553707f3fd5f68f47f531cfcff56aa3ec294c6f6 (referenced alongside GitHub PR 8078), which adds hasSymlinkInPath validation to both UpdateRepoFile and GetDiffPreview; this constitutes an upstream fix available via PR/commit, though a released patched version is not independently confirmed, so deploy the commit or an official Gogs release that demonstrably contains it and verify by checking that internal/database/repo_editor.go performs a per-component symlink check. Because exploitation is confirmed actively exploited (CISA KEV) and requires an authenticated account with write/push access to at least one repository (PR:L), the highest-value compensating control while patching is to audit and restrict repository write permissions to fully trusted users only - the trade-off being reduced collaboration and potential workflow disruption for contributors who currently hold push rights. Additionally, consider disabling or restricting access to the web file-editor/PutContents endpoint through a reverse proxy or feature flag where that is operationally acceptable, accepting loss of in-browser file editing as the cost; run the Gogs process under a dedicated low-privileged OS account inside a container or sandbox with a read-only root filesystem and write access limited to the Gogs data and repository directories, which does not remove the flaw but sharply limits where a redirected write can land and is the most effective blast-radius reduction when patching must be delayed. Monitor repositories for unexpected symlinks and watch for Gogs file-write operations targeting paths outside the repository root, and consult the vendor advisory references, the Wiz research blog, the Openwall oss-security threads from December 2025 and January 2026, and the CISA KEV catalog entry for updated guidance. Note that no vendor-released patch version number is specified in the available data; do not assume a particular release is fixed without confirming it contains commit 553707f3fd5f68f47f531cfcff56aa3ec294c6f6.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in go
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The root cause is CWE-22 path traversal realized through unsafe symlink following in Gogs' Go code. The vulnerable code lives in internal/database/repo_editor.go, where UpdateRepoFile and GetDiffPreview computed a target path with path.Join(localPath, opts.NewTreeName) and then called os.WriteFile. Pre-patch logic only validated the final target with osutil.IsSymlink (and only in specific branches, e.g. new-file creation or move operations), so a symlink located anywhere earlier in the path hierarchy - a parent directory inside the repository working tree - was followed by the Go standard library, letting the write escape the repo directory and land in an attacker-chosen location such as a cron directory, SSH authorized_keys, or a configuration file loaded by the server process. The fix commit 553707f3fd5f68f47f531cfcff56aa3ec294c6f6 introduces a helper, hasSymlinkInPath(base, relPath), which splits the relative path into components and checks each progressive prefix with osutil.IsSymlink, then rejects the operation outright with "cannot update file with symbolic link in path" in both UpdateRepoFile and GetDiffPreview. The same commit also folds the previously duplicated new-file/move symlink checks into this centralized validation and tidies error handling, confirming the defect was the incomplete (leaf-only) symlink check rather than the underlying file-write primitive itself. The affected surface is the web file-editor backing API (PutContents), which is reachable over the network. Authentication requirements are confirmed as authenticated per the provided CVSS vector (PR:L).
Know when Gogs gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:A/AU:Y/R:U/V:C
Network-reachable file-editor API abused by an authenticated user with repo write access (PR:L, AC:L, UI:N); arbitrary file write yields server code execution, so C:H/I:H/A:H with unchanged scope.
Primary rating from Vendor (9947ef80-c5d5-474a-bbab-97341a59000e).
CVSS VectorVendor: 9947ef80-c5d5-474a-bbab-97341a59000e
Lifecycle Timeline
2DescriptionCVE.org
Improper Symbolic link handling in the PutContents API in Gogs allows Local Execution of Code.
Executive ViewAI
Gogs, a self-hosted Git service, is affected by a high-severity code execution vulnerability (CVE-2025-8110) that has been confirmed actively exploited (CISA KEV) and for which publicly available exploit code exists. An authenticated attacker with write access to any repository can exploit this flaw to execute arbitrary code on the server, potentially leading to unauthorized access to sensitive source code, intellectual property theft, or further compromise of internal systems. Security leadership should prioritize immediate patching and access reviews to mitigate organizational risk.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
Affected Products (CPE)CVE.org
Multiple SQL injection vulnerabilities in Gogs (aka Go Git Service) 0.3.1-9 through 0.5.x before 0.5.6.1105 Beta allow r
The git hook feature in Gogs 0.5.5 through 0.12.2 allows for authenticated remote code execution. Rated high severity (C
Gogs through 0.13.0 allows argument injection during the previewing of changes. Rated critical severity (CVSS 9.9), this
The built-in SSH server of Gogs through 0.13.0 allows argument injection in internal/ssh/ssh.go, leading to remote code
Gogs self-hosted Git service v0.13.3 has a command injection vulnerability enabling remote code execution through crafte
Unauthenticated file upload in Gogs self-hosted Git service 0.13.4 and below. Default configuration exposes file upload
OS Command Injection in GitHub repository gogs/gogs prior to 0.12.9. Rated critical severity (CVSS 9.8), this vulnerabil
Gogs 0.11.66 allows remote code execution because it does not properly validate session IDs, as demonstrated by a ".." s
Supply chain attack via LFS object overwrite across repos in Gogs before 0.14.2. PoC and patch available.
Path Traversal in GitHub repository gogs/gogs prior to 0.12.9. Rated critical severity (CVSS 9.1), this vulnerability is
Missing Authorization in GitHub repository gogs/gogs prior to 0.12.5. Rated critical severity (CVSS 9.1), this vulnerabi
In Gogs, versions v0.6.5 through v0.12.10 are vulnerable to Stored Cross-Site Scripting (XSS) that leads to an account t
NVD
CVE.org
CISA KEV
EPSS
GitHub
Exploit-DB