{"id":"CVE-2026-53587","summary":"libgit2 - Unauthenticated network-reachable heap out-of-bounds read in transports/smart_pkt.c:set_data","details":"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. Prior to 1.8.6 and 1.9.5, libgit2 performs a fixed-size strncmp in set_data in src/libgit2/transports/smart_pkt.c without first verifying that the smart-protocol pkt-line capability buffer contains 14 bytes. A malicious Git server can make bytes after the pkt-line complete object-format=, causing format_str to advance beyond the pkt-line and the following memchr length calculation to underflow. The resulting heap out-of-bounds walk can crash a client during the first refs-advertisement packet over HTTP, HTTPS, SSH, or the Git protocol. This issue is fixed in versions 1.8.6 and 1.9.5.","aliases":["GHSA-pm24-4jhq-3xvm"],"modified":"2026-08-22T10:47:45.254092Z","published":"2026-08-20T18:36:43.055Z","related":["openSUSE-SU-2026:11315-1"],"database_specific":{"cwe_ids":["CWE-125","CWE-126","CWE-1284","CWE-20"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/53xxx/CVE-2026-53587.json","cna_assigner":"GitHub_M"},"references":[{"type":"WEB","url":"https://github.com/libgit2/libgit2/releases/tag/v1.8.6"},{"type":"WEB","url":"https://github.com/libgit2/libgit2/releases/tag/v1.9.5"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/53xxx/CVE-2026-53587.json"},{"type":"ADVISORY","url":"https://github.com/libgit2/libgit2/security/advisories/GHSA-pm24-4jhq-3xvm"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-53587"},{"type":"FIX","url":"https://github.com/libgit2/libgit2/commit/2c0ce8c0132ac38ab0db28239462a671e2e5440e"},{"type":"FIX","url":"https://github.com/libgit2/libgit2/commit/affda60c10fcef16723451c0d7dc71b71dc20ad3"},{"type":"FIX","url":"https://github.com/libgit2/libgit2/commit/d7a9fb87f504434e9f45228678953c4fa56e7640"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/libgit2/libgit2","events":[{"introduced":"0"},{"introduced":"338e6fb681369ff0537719095e22ce9dc602dbf0"},{"fixed":"5853918c4c6a7b12f8becf4bd11ff4362ebb9020"},{"fixed":"f7a4071c766ceea3915415e22134cbe3e581c420"},{"fixed":"2c0ce8c0132ac38ab0db28239462a671e2e5440e"},{"fixed":"affda60c10fcef16723451c0d7dc71b71dc20ad3"},{"fixed":"d7a9fb87f504434e9f45228678953c4fa56e7640"}],"database_specific":{"extracted_events":[{"introduced":"0"},{"fixed":"1.8.6"},{"introduced":"1.9.0"},{"fixed":"1.9.5"}],"source":["AFFECTED_FIELD","REFERENCES"]}}],"versions":["v1.8.5","v1.9.4","v1.9.3","v1.9.2","v1.9.1","v1.8.4","v1.9.0","v1.8.3","v1.8.1","v1.8.0","v1.7.0","v1.6.3","v1.6.2","v1.6.1","v1.5.0","v1.3.0","v1.4.0","v1.2.0","v1.1.0","v1.0.0","v0.99.0","v0.28.0-rc1","v0.28.0","v0.27.0","v0.27.0-rc3","v0.26.0-rc2","v0.26.0","v0.27.0-rc1","v0.27.0-rc2","v0.26.0-rc1","v0.24.0","v0.24.0-rc1","v0.23.0","v0.23.0-rc2","v0.23.0-rc1","v0.22.0","v0.22.0-rc2","v0.22.0-rc1","v0.21.0","v0.18.0","v0.17.0","v0.16.0","v0.15.0","v0.14.0","v0.13.0","v0.12.0","v0.11.0","v0.10.0","v0.8.0","v0.3.0","v0.2.0","v0.1.0"],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-53587.json","vanir_signatures_modified":"2026-08-22T10:47:45Z","vanir_signatures":[{"deprecated":false,"digest":{"threshold":0.9,"line_hashes":["177057447943472058086633744144048853923","251528568997499059294437311657068512347","263233899593817864986485995768435296270","118977050417539920786203167605572346572"]},"id":"CVE-2026-53587-1ad3cda7","signature_type":"Line","signature_version":"v1","source":"https://github.com/libgit2/libgit2/commit/d7a9fb87f504434e9f45228678953c4fa56e7640","target":{"file":"src/libgit2/transports/smart_pkt.c"}},{"signature_type":"Function","signature_version":"v1","source":"https://github.com/libgit2/libgit2/commit/affda60c10fcef16723451c0d7dc71b71dc20ad3","target":{"file":"src/libgit2/transports/smart_pkt.c","function":"set_data"},"deprecated":false,"digest":{"function_hash":"200721615194512407914353922973112910719","length":1230},"id":"CVE-2026-53587-7240f0e4"},{"signature_version":"v1","source":"https://github.com/libgit2/libgit2/commit/2c0ce8c0132ac38ab0db28239462a671e2e5440e","target":{"file":"src/libgit2/transports/smart_pkt.c"},"deprecated":false,"digest":{"line_hashes":["177057447943472058086633744144048853923","251528568997499059294437311657068512347","129832296391823552556717622608358726660","112216264362753484961119941099410836764"],"threshold":0.9},"id":"CVE-2026-53587-78ef06aa","signature_type":"Line"},{"signature_version":"v1","source":"https://github.com/libgit2/libgit2/commit/d7a9fb87f504434e9f45228678953c4fa56e7640","target":{"function":"set_data","file":"src/libgit2/transports/smart_pkt.c"},"deprecated":false,"digest":{"length":1230,"function_hash":"200721615194512407914353922973112910719"},"id":"CVE-2026-53587-97056e87","signature_type":"Function"},{"source":"https://github.com/libgit2/libgit2/commit/2c0ce8c0132ac38ab0db28239462a671e2e5440e","target":{"file":"src/libgit2/transports/smart_pkt.c","function":"set_data"},"deprecated":false,"digest":{"function_hash":"173194287901579505293439928511578045548","length":1119},"id":"CVE-2026-53587-9efce08d","signature_type":"Function","signature_version":"v1"},{"signature_version":"v1","source":"https://github.com/libgit2/libgit2/commit/affda60c10fcef16723451c0d7dc71b71dc20ad3","target":{"file":"src/libgit2/transports/smart_pkt.c"},"deprecated":false,"digest":{"line_hashes":["177057447943472058086633744144048853923","251528568997499059294437311657068512347","263233899593817864986485995768435296270","118977050417539920786203167605572346572"],"threshold":0.9},"id":"CVE-2026-53587-d2b13f5c","signature_type":"Line"}]}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"}]}