CVE-2016-2402 — okhttp
MEDIUMCVE-2016-2402 is a medium-severity (CVSS 5.9) CWE-295 vulnerability in com.squareup.okhttp3:okhttp. 4 public exploit or proof-of-concept references are indexed, so weaponization risk is real. A fix is available for com.squareup.okhttp3:okhttp — see the affected versions and patch details below.
Improper Certificate Validation in OkHttp
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
com.squareup.okhttp3:okhttp☕com.squareup.okhttp3:okhttpReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.
Description
OkHttp before 2.7.4 and 3.x before 3.1.2 allows man-in-the-middle attackers to bypass certificate pinning by sending a certificate chain with a certificate from a non-pinned trusted CA and the pinned certificate.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| ☕Maven | com.squareup.okhttp3:okhttp | all versions | 2.7.4com.squareup.okhttp3:okhttp:2.7.4 |
| ☕Maven | com.squareup.okhttp3:okhttp | ≥ 3.0.0&&< 3.1.2 | 3.1.2com.squareup.okhttp3:okhttp:3.1.2 |
Affected Products
okhttpsquareupokhttp3squareupResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for com.squareup.okhttp3:okhttp, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update com.squareup.okhttp3:okhttp to 2.7.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2016-2402 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Frequently Asked Questions
Is CVE-2016-2402 in your dependencies?
Find it across Maven, including transitive dependencies.