Authenticated command execution via .git config overwrite
Published Nov 15, 2024 · Updated Nov 15, 2024
OS command injection in Gogs before 0.12.8 on Windows allows remote authenticated users to execute commands through repository uploads. The upload handler accepts tree_path=.git., writes an attacker-supplied config as .git/config, and later honors its core.sshCommand value. Repository write access and enabled file uploads, the default setting, are required; execution runs with the Gogs service account's privileges.
Summary
What happened
OS command injection in Gogs before 0.12.8 on Windows allows remote authenticated users to execute commands through repository uploads. The upload handler accepts tree_path=.git., writes an attacker-supplied config as .git/config, and later honors its core.sshCommand value. Repository write access and enabled file uploads, the default setting, are required; execution runs with the Gogs service account's privileges.
The record
- CVE
- CVE-2022-1884
- Published
- Nov 15, 2024
- Updated
- Nov 15, 2024
- Vendor
- Gogs
- Product
- Gogs
- Classifications
- CWE-77, CWE-78, T1059
- Attack vector
- network
- Privileges
- authenticated
Timeline
How it unfolded
- Nov 15, 2024CVE publishedPublication date reported by the CVE source.
- Nov 15, 2024Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=0 <=0.12.7
- Affected versionversion=unspecified <=latest
What conditions does exploitation require?
What is affected?
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- huntr.dev bounty proof of conceptproof of concept · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo