.. / CVE-2018-18925

Exploit for Gogs (Go Git Service) 0.11.66 - Remote Code Execution (CVE-2018-18925)

Description:

Gogs 0.11.66 allows remote code execution because it does not properly validate session IDs, as demonstrated by a “..” session-file forgery in the file session provider in file.go. This is related to session ID handling in the go-macaron/session code for Macaron.

Proof of Concept

PoC exploit

Nuclei Template

View the template here CVE-2018-18925.yaml

Validate with Nuclei

echo "$URL" | nuclei -t ~/nuclei-templates/http/cves/2018/CVE-2018-18925.yaml
Copy

Try the exploit in a lab environment:

Lab Machine Link
Hack The Box Ghoul Go to Practice

References:

https://github.com/vulhub/vulhub/tree/master/gogs/CVE-2018-18925
https://github.com/gogs/gogs/issues/5469
https://github.com/j4k0m/CVE-2018-18925
https://www.anquanke.com/post/id/163575
https://nvd.nist.gov/vuln/detail/cve-2018-18925