CVE-2016-2402: Improper Certificate Validation in OkHttp
5.9
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.93129%
CWE
Published
5/13/2022
Updated
1/27/2023
KEV Status
No
Technology
Java
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
com.squareup.okhttp3:okhttp | maven | <= 2.7.3 | 2.7.4 |
com.squareup.okhttp3:okhttp | maven | >= 3.0.0, <= 3.1.1 | 3.1.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from OkHttp's certificate pinning implementation validating against the server's presented certificate chain rather than the system-trusted chain. The CertificatePinner.check()
method in vulnerable versions used peer certificates (untrusted raw chain) instead of the validated local certificates. This allowed MITM attackers to craft a chain containing both a trusted CA certificate and the pinned certificate, tricking the validation. The fix involved switching to the validated chain, as confirmed by vulnerability descriptions and technical analyses of the attack mechanism.