Privilege escalation via incomplete repository ownership checks
Published Jul 12, 2022 · Updated Aug 3, 2024
Local privilege escalation in affected Git releases allows local users to execute arbitrary code through an attacker-created repository. The ensure_valid_ownership function in setup.c verifies only the worktree owner, not the .git directory or gitfile, allowing an attacker-owned repository inside a victim-owned shared directory to pass the safe.directory check. Exploitation requires a higher-privileged user to invoke Git from that shared directory, after which repository configuration such as core.fsmonitor executes attacker-controlled commands with that user's privileges.
Summary
What happened
Local privilege escalation in affected Git releases allows local users to execute arbitrary code through an attacker-created repository. The ensure_valid_ownership function in setup.c verifies only the worktree owner, not the .git directory or gitfile, allowing an attacker-owned repository inside a victim-owned shared directory to pass the safe.directory check. Exploitation requires a higher-privileged user to invoke Git from that shared directory, after which repository configuration such as core.fsmonitor executes attacker-controlled commands with that user's privileges.
The record
- CVE
- CVE-2022-29187
- Published
- Jul 12, 2022
- Updated
- Aug 3, 2024
- Vendor
- Git
- Product
- Git
- Classifications
- CWE-282, T1068
- Attack vector
- local
- Privileges
- authenticated
Timeline
How it unfolded
- Jul 12, 2022CVE publishedPublication date reported by the CVE source.
- Aug 3, 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=>= 2.30.3, < 2.30.5
- Affected versionversion=>= 2.31.2, < 2.31.4
- Affected versionversion=>= 2.32.1, < 2.32.3
- Affected versionversion=>= 2.33.2, < 2.33.4
- Affected versionversion=>= 2.34.2, < 2.34.4
- Affected versionversion=>= 2.35.2, < 2.35.4
- Affected versionversion=>= 2.36, < 2.36.2
- Affected versionversion=>= 2.37, < 2.37.1
What conditions does exploitation require?
What is affected?
Published CVSS scores
CVSS describes severity. EPSS estimates exploitation probability.
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
- Shared temporary-directory repository bypass exampleproof 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