Search
Find a vulnerability
Search criteria
Related vulnerabilities
CVE-2024-24575 (GCVE-0-2024-24575)
Vulnerability from cvelistv5 – Published: 2024-02-06 21:27 – Updated: 2025-02-13 17:40
VLAI
EPSS
VEX
Title
libgit2 is vulnerable to a denial of service attack in `git_revparse_single`
Summary
libgit2 is a portable C implementation of the Git core methods provided as a linkable library with a solid API, allowing to build Git functionality into your application. Using well-crafted inputs to `git_revparse_single` can cause the function to enter an infinite loop, potentially causing a Denial of Service attack in the calling application. The revparse function in `src/libgit2/revparse.c` uses a loop to parse the user-provided spec string. There is an edge-case during parsing that allows a bad actor to force the loop conditions to access arbitrary memory. Potentially, this could also leak memory if the extracted rev spec is reflected back to the attacker. As such, libgit2 versions before 1.4.0 are not affected. Users should upgrade to version 1.6.5 or 1.7.2.
Severity
7.5 (High)
SSVC
Exploitation: none
Automatable: no
Technical Impact: partial
CISA Coordinator · CISA-ADP (v2.0.3)
Decision recorded 2024-02-21 18:43 UTC
CWE
- CWE-400 - Uncontrolled Resource Consumption
Assigner
References
9 references
Impacted products
{
"containers": {
"adp": [
{
"metrics": [
{
"other": {
"content": {
"id": "CVE-2024-24575",
"options": [
{
"Exploitation": "none"
},
{
"Automatable": "no"
},
{
"Technical Impact": "partial"
}
],
"role": "CISA Coordinator",
"timestamp": "2024-02-21T18:43:05.693788Z",
"version": "2.0.3"
},
"type": "ssvc"
}
}
],
"providerMetadata": {
"dateUpdated": "2024-07-05T17:21:51.653Z",
"orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"shortName": "CISA-ADP"
},
"title": "CISA ADP Vulnrichment"
},
{
"providerMetadata": {
"dateUpdated": "2024-08-01T23:19:52.905Z",
"orgId": "af854a3a-2127-422b-91ae-364da2661108",
"shortName": "CVE"
},
"references": [
{
"name": "https://github.com/libgit2/libgit2/security/advisories/GHSA-54mf-x2rh-hq9v",
"tags": [
"x_refsource_CONFIRM",
"x_transferred"
],
"url": "https://github.com/libgit2/libgit2/security/advisories/GHSA-54mf-x2rh-hq9v"
},
{
"name": "https://github.com/libgit2/libgit2/commit/add2dabb3c16aa49b33904dcdc07cd915efc12fa",
"tags": [
"x_refsource_MISC",
"x_transferred"
],
"url": "https://github.com/libgit2/libgit2/commit/add2dabb3c16aa49b33904dcdc07cd915efc12fa"
},
{
"name": "https://github.com/libgit2/libgit2/releases/tag/v1.6.5",
"tags": [
"x_refsource_MISC",
"x_transferred"
],
"url": "https://github.com/libgit2/libgit2/releases/tag/v1.6.5"
},
{
"name": "https://github.com/libgit2/libgit2/releases/tag/v1.7.2",
"tags": [
"x_refsource_MISC",
"x_transferred"
],
"url": "https://github.com/libgit2/libgit2/releases/tag/v1.7.2"
},
{
"tags": [
"x_transferred"
],
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/S635BGHHZUMRPI7QOXOJ45QHDD5FFZ3S/"
},
{
"tags": [
"x_transferred"
],
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4M3P7WIEPXNRLBINQRJFXUSTNKBCHYC7/"
},
{
"tags": [
"x_transferred"
],
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/7CNDW3PF6NHO7OXNM5GN6WSSGAMA7MZE/"
},
{
"tags": [
"x_transferred"
],
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/Z6MXOX7I43OWNN7R6M54XLG6U5RXY244/"
},
{
"tags": [
"x_transferred"
],
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZGNHOEE2RBLH7KCJUPUNYG4CDTW4HTBT/"
}
],
"title": "CVE Program Container"
}
],
"cna": {
"affected": [
{
"product": "libgit2",
"vendor": "libgit2",
"versions": [
{
"status": "affected",
"version": "\u003e= 1.4.0, \u003c 1.6.5"
},
{
"status": "affected",
"version": "\u003e= 1.7.0, \u003c 1.7.2"
}
]
}
],
"descriptions": [
{
"lang": "en",
"value": "libgit2 is a portable C implementation of the Git core methods provided as a linkable library with a solid API, allowing to build Git functionality into your application. Using well-crafted inputs to `git_revparse_single` can cause the function to enter an infinite loop, potentially causing a Denial of Service attack in the calling application. The revparse function in `src/libgit2/revparse.c` uses a loop to parse the user-provided spec string. There is an edge-case during parsing that allows a bad actor to force the loop conditions to access arbitrary memory. Potentially, this could also leak memory if the extracted rev spec is reflected back to the attacker. As such, libgit2 versions before 1.4.0 are not affected. Users should upgrade to version 1.6.5 or 1.7.2."
}
],
"metrics": [
{
"cvssV3_1": {
"attackComplexity": "LOW",
"attackVector": "NETWORK",
"availabilityImpact": "HIGH",
"baseScore": 7.5,
"baseSeverity": "HIGH",
"confidentialityImpact": "NONE",
"integrityImpact": "NONE",
"privilegesRequired": "NONE",
"scope": "UNCHANGED",
"userInteraction": "NONE",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"version": "3.1"
}
}
],
"problemTypes": [
{
"descriptions": [
{
"cweId": "CWE-400",
"description": "CWE-400: Uncontrolled Resource Consumption",
"lang": "en",
"type": "CWE"
}
]
}
],
"providerMetadata": {
"dateUpdated": "2024-02-22T04:06:00.858Z",
"orgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
"shortName": "GitHub_M"
},
"references": [
{
"name": "https://github.com/libgit2/libgit2/security/advisories/GHSA-54mf-x2rh-hq9v",
"tags": [
"x_refsource_CONFIRM"
],
"url": "https://github.com/libgit2/libgit2/security/advisories/GHSA-54mf-x2rh-hq9v"
},
{
"name": "https://github.com/libgit2/libgit2/commit/add2dabb3c16aa49b33904dcdc07cd915efc12fa",
"tags": [
"x_refsource_MISC"
],
"url": "https://github.com/libgit2/libgit2/commit/add2dabb3c16aa49b33904dcdc07cd915efc12fa"
},
{
"name": "https://github.com/libgit2/libgit2/releases/tag/v1.6.5",
"tags": [
"x_refsource_MISC"
],
"url": "https://github.com/libgit2/libgit2/releases/tag/v1.6.5"
},
{
"name": "https://github.com/libgit2/libgit2/releases/tag/v1.7.2",
"tags": [
"x_refsource_MISC"
],
"url": "https://github.com/libgit2/libgit2/releases/tag/v1.7.2"
},
{
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/S635BGHHZUMRPI7QOXOJ45QHDD5FFZ3S/"
},
{
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4M3P7WIEPXNRLBINQRJFXUSTNKBCHYC7/"
},
{
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/7CNDW3PF6NHO7OXNM5GN6WSSGAMA7MZE/"
},
{
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/Z6MXOX7I43OWNN7R6M54XLG6U5RXY244/"
},
{
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZGNHOEE2RBLH7KCJUPUNYG4CDTW4HTBT/"
}
],
"source": {
"advisory": "GHSA-54mf-x2rh-hq9v",
"discovery": "UNKNOWN"
},
"title": "libgit2 is vulnerable to a denial of service attack in `git_revparse_single`"
}
},
"cveMetadata": {
"assignerOrgId": "a0819718-46f1-4df5-94e2-005712e83aaa",
"assignerShortName": "GitHub_M",
"cveId": "CVE-2024-24575",
"datePublished": "2024-02-06T21:27:57.328Z",
"dateReserved": "2024-01-25T15:09:40.211Z",
"dateUpdated": "2025-02-13T17:40:13.105Z",
"state": "PUBLISHED"
},
"dataType": "CVE_RECORD",
"dataVersion": "5.1"
}
RUSTSEC-2024-0013 (GHSA-22Q8-GHMQ-63VF)
Vulnerability from osv_rustsec – Published: 2024-02-06 12:00 – Updated: 2024-02-15 01:22 – Source website
VLAI
Summary
Memory corruption, denial of service, and arbitrary code execution in libgit2
Details
The libgit2 project fixed three security issues in the 1.7.2 release. These issues are:
- The
git_revparse_singlefunction can potentially enter an infinite loop on a well-crafted input, potentially causing a Denial of Service. This function is exposed in thegit2crate via theRepository::revparse_singlemethod. - The
git_index_addfunction may cause heap corruption and possibly lead to arbitrary code execution. This function is exposed in thegit2crate via theIndex::addmethod. - The smart transport negotiation may experience an out-of-bounds read when a remote server did not advertise capabilities.
The libgit2-sys crate bundles libgit2, or optionally links to a system libgit2 library. In either case, versions of the libgit2 library less than 1.7.2 are vulnerable. The 0.16.2 release of libgit2-sys bundles the fixed version of 1.7.2, and requires a system libgit2 version of at least 1.7.2.
It is recommended that all users upgrade.
Aliases
Severity
8.6 (High)
References
4 references
Impacted products
1 product
| Ecosystem | Package | Version |
|---|---|---|
| crates.io |
libgit2-sys
pkg:cargo/libgit2-sys
|
Affected: ≥ 0.0.0-0, < 0.16.2 (semver)
|
{
"affected": [
{
"database_specific": {
"categories": [
"denial-of-service",
"code-execution",
"memory-corruption"
],
"cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L",
"informational": null
},
"ecosystem_specific": {
"affected_functions": null,
"affects": {
"arch": [],
"functions": [
"libgit2_sys::git_index_add",
"libgit2_sys::git_revparse_single"
],
"os": []
}
},
"package": {
"ecosystem": "crates.io",
"name": "libgit2-sys",
"purl": "pkg:cargo/libgit2-sys"
},
"ranges": [
{
"events": [
{
"introduced": "0.0.0-0"
},
{
"fixed": "0.16.2"
}
],
"type": "SEMVER"
}
],
"versions": []
}
],
"aliases": [
"GHSA-22q8-ghmq-63vf"
],
"database_specific": {
"license": "CC0-1.0"
},
"details": "The [libgit2](https://github.com/libgit2/libgit2/) project fixed three security issues in the 1.7.2 release. These issues are:\n\n* The `git_revparse_single` function can potentially enter an infinite loop on a well-crafted input, potentially causing a Denial of Service. This function is exposed in the `git2` crate via the [`Repository::revparse_single`](https://docs.rs/git2/latest/git2/struct.Repository.html#method.revparse_single) method.\n* The `git_index_add` function may cause heap corruption and possibly lead to arbitrary code execution. This function is exposed in the `git2` crate via the [`Index::add`](https://docs.rs/git2/latest/git2/struct.Index.html#method.add) method.\n* The smart transport negotiation may experience an out-of-bounds read when a remote server did not advertise capabilities.\n\nThe `libgit2-sys` crate bundles libgit2, or optionally links to a system libgit2 library. In either case, versions of the libgit2 library less than 1.7.2 are vulnerable. The 0.16.2 release of `libgit2-sys` bundles the fixed version of 1.7.2, and requires a system libgit2 version of at least 1.7.2.\n\nIt is recommended that all users upgrade.",
"id": "RUSTSEC-2024-0013",
"modified": "2024-02-15T01:22:49Z",
"published": "2024-02-06T12:00:00Z",
"references": [
{
"type": "PACKAGE",
"url": "https://crates.io/crates/libgit2-sys"
},
{
"type": "ADVISORY",
"url": "https://rustsec.org/advisories/RUSTSEC-2024-0013.html"
},
{
"type": "WEB",
"url": "https://github.com/rust-lang/git2-rs/pull/1017"
},
{
"type": "WEB",
"url": "https://github.com/libgit2/libgit2/releases/tag/v1.7.2"
}
],
"related": [
"CVE-2024-24575",
"CVE-2024-24577",
"GHSA-54mf-x2rh-hq9v",
"GHSA-j2v7-4f6v-gpg8"
],
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:L",
"type": "CVSS_V3"
}
],
"summary": "Memory corruption, denial of service, and arbitrary code execution in libgit2"
}