Two security vulnerabilities were identified in libgit2 prior to versions 1.8.6 and 1.9.5. The first involves improper IP address validation in OpenSSL builds, allowing a network attacker with a CA-trusted certificate containing any IP SubjectAltName to intercept connections to IP-literal HTTPS URLs. The second is a heap out-of-bounds read caused by insufficient validation of the smart-protocol pkt-line capability buffer, which can crash clients during the first refs-advertisement packet over multiple protocols. Both issues are fixed in libgit2 versions 1.8.6 and 1.9.5.