Two security vulnerabilities were identified in libgit2 prior to versions 1.8.6 and 1.9.5. The first involves an incorrect IP address verification 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 improper validation of smart-protocol pkt-line capability buffers, which can crash clients during the first refs-advertisement packet over various protocols. Both issues are fixed in libgit2 versions 1.8.6 and 1.9.5.