CVE-2016-2402 Improper Certificate Validation in OkHttp

Medium 5.9 Published Updated

Man-in-the-middle attackers can bypass certificate pinning in OkHttp by presenting a valid chain from a non-pinned trusted CA.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2016-2402?

CVE-2016-2402 is a medium-severity vulnerability in n/a, published on 30 Jan 2017. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.

Weakness: CWE-295

Which versions are affected by CVE-2016-2402?

4 open source packages ship an affected version, including com.squareup.okhttp3:okhttp. It affects 2 products.

PackageAffectedFixed in
com.squareup.okhttp3:okhttp MavenAll versions2.7.4
com.squareup.okhttp3:okhttp MavenAll versions2.7.4
com.squareup.okhttp3:okhttp MavenFrom 3.0.03.1.2
com.squareup.okhttp3:okhttp MavenFrom 3.0.03.1.2

Products include Squareup Okhttp, Squareup Okhttp3.

How do I fix CVE-2016-2402?

Upgrade com.squareup.okhttp3:okhttp to a fixed version for your release line: 2.7.4 or 3.1.2.

Is CVE-2016-2402 being exploited?

There is no known exploitation of CVE-2016-2402 in the wild and no public exploit code.

Public exploit code: 2 proofs of concept on GitHub.

Sources

Also known as CLEANSTART-2026-HM98634, GHSA-4hc2-jh7r-wrc3.

Is CVE-2016-2402 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free