git: Use of Hard-coded, Security-relevant Constants
CVE-2024-32021 is a high-severity use of hard-coded, security-relevant constants vulnerability in git, with a CVSS 3.1 base score of 7.1 out of 10. It can be exploited with local access to the system by an unauthenticated attacker, but only if a user takes part, for example by opening a link or file. The record lists versions 2.39.4, 2.40.2, 2.41.1 as the first without the flaw, so updating git to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 1.02% chance of exploitation within 30 days, higher than 64% of scored CVEs.
High severity with no evidence of exploitation so far.
What to do
- Update git to 2.39.4 or 2.40.2 or 2.41.1 or 2.42.2, whichever matches your release line, or a later version.
- Read the advisory on github.com for workarounds and exact fixed builds.
- Because the attack needs a user to take part, warn users about unexpected links and files related to this product until it is patched.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Git | git | = 2.45.0; = 2.44.0; >= 2.43.0, < 2.43.4; >= 2.42.0, < 2.42.2; = 2.41.0; >= 2.40.0, < 2.40.2; < 2.39.4; before 2.39.4; and 6 more ranges | 2.39.4, 2.40.2, 2.41.1, 2.42.2, 2.43.4, 2.44.1 |
| Fedora Project | Fedora | 40 | Not stated |
| Debian | Debian Linux | 10.0; 11.0 | Not stated |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- LocalThe attacker needs local access or must trick a user into running something.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- RequiredA user must take an action such as opening a file or link.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- HighData or code can be modified at will.
- Availability
- NoneAvailability is not affected.
Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 3.9 | Low | CNA (github.com) |
| CVSS 3.1 | 7.1 | High | NVD |
Official description
Git is a revision control system. Prior to versions 2.45.1, 2.44.1, 2.43.4, 2.42.2, 2.41.1, 2.40.2, and 2.39.4, when cloning a local source repository that contains symlinks via the filesystem, Git may create hardlinks to arbitrary user-readable files on the same filesystem as the target repository in the `objects/` directory. Cloning a local repository over the filesystem may creating hardlinks to arbitrary user-owned files on the same filesystem in the target Git repository's `objects/` directory. When cloning a repository over the filesystem (without explicitly specifying the `file://` protocol or `--no-local`), the optimizations for local cloning will be used, which include attempting to hard link the object files instead of copying them. While the code includes checks against symbolic links in the source repository, which were added during the fix for CVE-2022-39253, these checks can still be raced because the hard link operation ultimately follows symlinks. If the object on the filesystem appears as a file during the check, and then a symlink during the operation, this will allow the adversary to bypass the check and create hardlinks in the destination objects directory to arbitrary, user-readable files. The problem has been patched in versions 2.45.1, 2.44.1, 2.43.4, 2.42.2, 2.41.1, 2.40.2, and 2.39.4.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Use of Hard-coded, Security-relevant Constants
The product uses hard-coded constants instead of symbolic names for security-critical values, which increases the likelihood of mistakes during code maintenance or security policy change.
How developers prevent this class of flaw
- Avoid using hard-coded constants. Configuration files offer a more flexible solution.
More Use of Hard-coded, Security-relevant Constants vulnerabilities (CWE-547)
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: poc, automatable: no, technical impact: partial).
- Record last changed materially (score, affected products, status or references).
References
Advisories
Third-party and government advisories
- openwall.com/lists/oss-security/2024/05/14/2Mailing List, Third Party Advisory
- lists.debian.org/debian-lts-announce/2024/06/msg00018.htmlMailing List, Third Party Advisory
- lists.fedoraproject.org/archives/list/[email protected]/message/S4CK4IYTXEOBZTEM5K3T6L…Mailing List, Third Party Advisory
- lists.debian.org/debian-lts-announce/2024/09/msg00009.htmlMailing List, Third Party Advisory
Other vulnerabilities in git
- 7.5 High severity
- 8.6 High severity
- 8.0 High severity
Git Link Following Exploited
- 8.8 High severity
- 7.5 High severity
- 7.8 High severity
Spotted an error? Tell us.