libgit2 v1.9.7
v1.9.7
This is a security release with one change.
-
Escape remote repository paths in libssh2
In v1.8.5, we started escaping repository paths in the OpenSSH-based exec ssh transport. Bring the same escaping to the libssh2 transport to avoid any potential command injection.
In addition, changes have been ported from the main branch to update CI builds.
Thank you to @izzy0101010101 for responsibly disclosing this issue to us, and thank you to @sgallagher for the fix. This bug was identified as CVE 2026-5917 by an unrelated third party.
Full Changelog: v1.9.6...v1.9.7
libgit2 v1.8.7
v1.8.7
This is a security release with one change.
-
Escape remote repository paths in libssh2
In v1.8.5, we started escaping repository paths in the OpenSSH-based exec ssh transport. Bring the same escaping to the libssh2 transport to avoid any potential command injection.
In addition, changes have been ported from the main branch to update CI builds.
Thank you to @izzy0101010101 for responsibly disclosing this issue to us, and thank you to @sgallagher for the fix. This bug was identified as CVE 2026-5917 by an unrelated third party.
Full Changelog: v1.8.6...v1.8.7
libgit2 v1.9.6
libgit2 v1.9.5
v1.9.5
π This is a security release with multiple changes.
-
Fix for blame error handling on hunk creation failures
hunk_from_entrycan returnNULLon error; handle that and
return an error. -
Fix for potential PCRE memory access: 1-byte heap-buffer-overflow WRITE in bundled PCRE 8.45 reachable via revspec
git_revparse_singleaccepts revspecs of the form:/<pattern>(the "grep by commit message" shorthand) and forwards<pattern>directly to libgit2's regex backend. When libgit2 is using its builtin regular expression engine, this causes a heap buffer overflow.This vulnerability was identified by @DavidKorczynski.
-
Fix for CVE-2026-53586: give auth callback current host
libgit2's builtin HTTP transport follows offsite redirects for the initial smart HTTP request by default. If the redirected server then
returns 401 Unauthorized, libgit2 asks the application credential callback for credentials using the original remote URL, not the redirected URL. The returned credential is then attached to the next request to the redirected host as an Authorization header.This vulnerability was identified by @sondt99, and CVE-2026-53586 was issued for this vulnerability.
-
Fix for CVE-2026-53587: libgit2 version 1.9.4 and below is vulnerable to a heap out-of-bounds read in
set_datainsrc/libgit2/transports/smart_pkt.c.When given capabilities, we check for the object-format capability; we need to ensure that the current packet buffer is large enough before actually doing the check.
This vulnerability was identified by @manop55555, and CVE-2026-53587 was issued for this vulnerability.
-
Fix for CVE-2026-53585: Unbounded Memory Allocation via Delta Object Result-Size Header
Potential denial of service because
git_delta_applyreads the claimed result size (res_sz) from the delta object header β data entirely controlled by the sender β and immediately allocates a buffer of that size.This vulnerability was identified by MichaΕ Majchrowicz and Marcin Wyczechowski, members of the AFINE Team, and CVE-2026-53585 was issued for this vulnerability.
-
Fix for CVE-2026-53584: submodule: check paths for escaping
A crafted repository with a submodule whose path contains traversal components (e.g. "../") can cause the library to create directories outside the repository's working tree.
This vulnerability was identified by @sectroyer, and CVE-2026-53584 was issued for this vulnerability.
-
Fix for CVE-2026-53583: inverted IP SubjectAltName comparison in OpenSSL backend.
An inverted comparison in the OpenSSL TLS backend causes IP SubjectAltName (SAN) verification to accept certificates with mismatched IP addresses and reject certificates with correct IP addresses. This allows a network attacker with a valid CA-signed certificate containing any IP SAN to perform MITM attacks against libgit2 clients connecting to IP-literal HTTPS URLs.
This vulnerability was identified by @pavelkohout396, and CVE-2026-53583 was issued for this vulnerability.
All users of the v1.8 release line are recommended to upgrade.
libgit2 thanks the reporters of these issues for their responsible disclosure.
Full Changelog: v1.8.4...v1.9.5
libgit2 v1.8.6
v1.8.6
π This is a security release with multiple changes.
-
Fix for blame error handling on hunk creation failures
hunk_from_entrycan returnNULLon error; handle that and
return an error. -
Fix for potential PCRE memory access: 1-byte heap-buffer-overflow WRITE in bundled PCRE 8.45 reachable via revspec
git_revparse_singleaccepts revspecs of the form:/<pattern>(the "grep by commit message" shorthand) and forwards<pattern>directly to libgit2's regex backend. When libgit2 is using its builtin regular expression engine, this causes a heap buffer overflow.This vulnerability was identified by @DavidKorczynski.
-
Fix for CVE-2026-53586: give auth callback current host
libgit2's builtin HTTP transport follows offsite redirects for the initial smart HTTP request by default. If the redirected server then
returns 401 Unauthorized, libgit2 asks the application credential callback for credentials using the original remote URL, not the redirected URL. The returned credential is then attached to the next request to the redirected host as an Authorization header.This vulnerability was identified by @sondt99, and CVE-2026-53586 was issued for this vulnerability.
-
Fix for CVE-2026-53587: libgit2 version 1.9.4 and below is vulnerable to a heap out-of-bounds read in
set_datainsrc/libgit2/transports/smart_pkt.c.When given capabilities, we check for the object-format capability; we need to ensure that the current packet buffer is large enough before actually doing the check.
This vulnerability was identified by @manop55555, and CVE-2026-53587 was issued for this vulnerability.
-
Fix for CVE-2026-53585: Unbounded Memory Allocation via Delta Object Result-Size Header
Potential denial of service because
git_delta_applyreads the claimed result size (res_sz) from the delta object header β data entirely controlled by the sender β and immediately allocates a buffer of that size.This vulnerability was identified by MichaΕ Majchrowicz and Marcin Wyczechowski, members of the AFINE Team, and CVE-2026-53585 was issued for this vulnerability.
-
Fix for CVE-2026-53584: submodule: check paths for escaping
A crafted repository with a submodule whose path contains traversal components (e.g. "../") can cause the library to create directories outside the repository's working tree.
This vulnerability was identified by @sectroyer, and CVE-2026-53584 was issued for this vulnerability.
-
Fix for CVE-2026-53583: inverted IP SubjectAltName comparison in OpenSSL backend.
An inverted comparison in the OpenSSL TLS backend causes IP SubjectAltName (SAN) verification to accept certificates with mismatched IP addresses and reject certificates with correct IP addresses. This allows a network attacker with a valid CA-signed certificate containing any IP SAN to perform MITM attacks against libgit2 clients connecting to IP-literal HTTPS URLs.
This vulnerability was identified by @pavelkohout396, and CVE-2026-53583 was issued for this vulnerability.
All users of the v1.8 release line are recommended to upgrade.
libgit2 thanks the reporters of these issues for their responsible disclosure.
Full Changelog: v1.8.5...v1.8.6
libgit2 v1.9.4
This release includes a few small but important bugfixes.
libgit2 v1.9.3
v1.9.3
This release includes a number of bugfixes and compatibility improvements, particularly around SHA256 support.
- cmake: fix linker error when using ninja build generator by @kcsaul in #7249
- Handle redirects with Content-Length: 0 correctly by @ethomson in #7246
- ci: use poxygit v0.8.1 in the tests by @ethomson in #7248
- Zero indexer stats in pack objects by @ethomson in #7243
- submodule: git_index_add_bypath does not move conflict entries to REUC by @lrm29 in #7003
- fix: prevent SSH timeout infinite loop and enable TCP keepalive by @ambv in #7165
- merge_files: avoid UB in xdiff by @ethomson in #7239
- git_merge_file_from_index: handle cases when a child (ours or theirs) is null by @eantoranz in #7092
- cmake: write git.h.tmp to current binary directory by @kcsaul in #7241
- fix(pack): ensure pack_backend__read returns null terminated buffer by @kanru in #7238
- Check object lengths against headers in read_loose by @howtonotwin in #7178
- cmake: don't recreate git2.h unnecessarily by @ethomson in #7234
- Memory Backend Corruption Fix by @kcsaul in #7232
- Fixed a heap-buffer-overflow in the smart_pkt.c:set_data function by @oliverchang in #7118
- fix(transport): get oid_type on local transport by @weihanglo in #7229
GIT_REMOTE_DOWNLOAD_TAGS_ALL: remove stray "the" in docs by @DanielEScherzer in #7228- fix(clone): propagate object format in local clone by @weihanglo in #7226
- repo: Fix possible null pointer dereference by @csware in #7225
- revparse: Allow
HEADabbreviation@by @KoviRobi in #7218 - camke: include libssh2 in
Requires.privatein the PC file by @carlosmn in #7215 - futils: fix undefined behavior in O_FSYNC fallback definition by @cehoffman in #7211
- pcre: actually fix dangling-pointer warning by @ethomson in #7206
- pcre: update cmake warnings for non-gcc by @ethomson in #7205
- Fix some warnings with gcc by @ethomson in #7203
- fix: apply insteadOf from global config for detached remotes by @weihanglo in #7195
- Fix
git_index_entrydocumentation by @bakersdozen123 in #7192 - config: Fix potential null value passed to %s by @ethomson in #7190
- index: support USE_NSEC=OFF by @ethomson in #7187
- feat(remote): expose
git_remote_oid_typeby @weihanglo in #7185 - fix(smart): keep caps across RPC stream resets by @weihanglo in #7183
- fix wrong comment by @Murmele in #7181
- fix(sha256): pass correct oid type by @weihanglo in #7179
- examples: correct
git_commit_timecomment by @qaqland in #7175 - tests: update to latest clar by @ethomson in #7173
- delta: fix undefined behavior in hdr_sz varint parsing by @Oblivionsage in #7172
- ci: Update macos-13 to macos-14 images on GitHub Actions by @ambv in #7167
- ci: Fix cases of -Werror=discarded-qualifiers raised by @gcc 15.2 by @ambv in #7164
- Use CMAKE_INSTALL_INCLUDEDIR for libgit2package INSTALL_INTERFACE by @aware70 in #7155
- Fix C4703 uninitialized pointer variable warnings by @ShiningMassXAcc in #7154
- test: check the correct filesystem for case-sensitivity by @ambv in #7153
- ci: update ci/docker/fedora to work with Rawhide 44 by @ambv in #7152
- refs: honor REFSPEC_SHORTHAND for multi-segment refs by @roberth in #7148
- config: Fix potential null value passed to %s by @orgads in #7131
- Fix potential access to uninitialized variables by @orgads in #7130
- refspec: Detect DEL character in is_valid_name by @xokdvium in #7120
- Update documentation to clarify that cert cb is always called by @ehuss in #7119
- Update
racy.creference by @emmanuel-ferdman in #7091 - Avoid duplicate definition of git_http_auth_dummy. by @JohannesWilde in #7077
libgit2 v1.8.5
v1.8.5
π This is a security release with multiple changes.
-
A bug in the external SSH execution is fixed that could cause arbitrary command execution. Remote repository names were improperly sent to the shell without quoting. Arguments to the external SSH command are now sent parameterized.
-
A bug in SSH credential creation is fixed that could cause a buffer overflow. Public keys that are not NUL terminated were improperly zeroed. The given length of public keys is now honored.
The libgit2 project thanks @0xkato and @bakersdozen123 for finding the bugs and providing details and reproduction steps.
All users of the v1.8 release line are recommended to upgrade.
Full Changelog: v1.8.4...v1.8.5
libgit2 v1.9.2
v1.9.2
π This is a security release with multiple changes.
-
A bug in the external SSH execution is fixed that could cause arbitrary command execution. Remote repository names were improperly sent to the shell without quoting. Arguments to the external SSH command are now sent parameterized.
-
A bug in SSH credential creation is fixed that could cause a buffer overflow. Public keys that are not NUL terminated were improperly zeroed. The given length of public keys is now honored.
The libgit2 project thanks @0xkato and @bakersdozen123 for finding the bugs and providing details and reproduction steps.
All users of the v1.9 release line are recommended to upgrade.
Full Changelog: v1.9.1...v1.9.2
libgit2 v1.9.1
What's Changed
Bug fixes
- hash: allow
unsigned int!=size_tin sha256 by @ethomson in #6996 - include: Fix code comment termination by @florianpircher in #6997
- alternates: allow relative paths in all repositories by @vapier in #7019
- FIx potential null dereference by @peter15914 in #6998
- cli: fix undefined alloca() on CYGWIN by @carlo-bramini in #7022
- attr: honor ignorecase in attribute matching by @ethomson in #7018
- tag: Refuse to use HEAD as a tagname by @csware in #7061
- Fix memory leak in openssl fips modes by @wklatka in #7064
- Fix circular includes between types.h and oid.h by @georgthegreat in #7059
- diff: correct diff stat alignment in presence of renames w/ common prefix. by @kivikakk in #7057
- Revert include path regression by @ytnuf in #7039
Build and CI improvements
- benchmarks: update path to baseline cli by @ethomson in #7006
- Update SelectSSH.cmake by @lrm29 in #7012
- ci: update download-artifact version by @ethomson in #7038
- install cmake files into configured libdir by @kanavin in #7004
- Test updates by @ethomson in #7025
- conflict tests: check
core.ignorecaseby @emilazy in #7026 - Include common.h in version.h by @ethomson in #7030
- clar: update to latest version by @ethomson in #7029
- Fix MSVC cross compilation by @Faless in #7079
- fuzzers: Fix CFLAGS by @nelhage in #7044
- Avoid duplicate definition of
git_http_auth_dummy. by @JohannesWilde in #7077
Documentation improvements
- docs: add
update_refsas ABI breaking change by @ethomson in #7005 - docs: correct wrong docstring info for
git_remote_urlby @DominiqueFuchs in #7076
New Contributors
- @peter15914 made their first contribution in #6998
- @kanavin made their first contribution in #7004
- @carlo-bramini made their first contribution in #7022
- @vapier made their first contribution in #7019
- @emilazy made their first contribution in #7026
- @ytnuf made their first contribution in #7039
- @DominiqueFuchs made their first contribution in #7076
- @wklatka made their first contribution in #7064
- @kivikakk made their first contribution in #7057
- @JohannesWilde made their first contribution in #7077
Full Changelog: v1.9.0...v1.9.1