CVE-2016-2402: Improper Certificate Validation in OkHttp

com.squareup.okhttp3:okhttp Updated 02 Oct 2025

Summary

13/05/2022
Yes i
Moderate
5.9

CVE-2016-2402: Improper Certificate Validation in OkHttp. Affects com.squareup.okhttp3:okhttp across 2 version ranges.

< 2.7.4 >= 3.0.0, < 3.1.2

Fixed in 2.7.4 or 3.1.2, depending on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

OkHttp is a popular open-source HTTP client for Java applications. It provides a simple and efficient way to make HTTP requests and handle responses. OkHttp is widely used in various projects and frameworks for network communication. However, versions before 2.7.4 and 3.x before 3.1.2 are vulnerable to an improper certificate validation issue.

Vulnerability Detail

The vulnerability in OkHttp allows man-in-the-middle attackers to bypass certificate pinning. Certificate pinning is a security mechanism that ensures the client only accepts specific certificates when establishing a secure connection. However, an attacker can exploit this vulnerability by sending a certificate chain with a certificate from a non-pinned trusted CA and the pinned certificate. This allows the attacker to intercept and manipulate the communication between the client and the server.

How To Fix

Latest published version: 5.5.1 as of 22 Oct 2026

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 2.7.4 2.7.4
  • >= 3.0.0, < 3.1.2 3.1.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

There is no known workaround for this vulnerability. It is essential to update to the fixed versions of OkHttp to ensure the security of the application.

Conclusion

The improper certificate validation vulnerability in OkHttp can be mitigated by updating to the fixed versions. It is crucial to keep the dependencies up to date to ensure the security of the application. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for com.squareup.okhttp3:okhttp →

Share this vulnerability

FAQ

OkHttp is an open-source HTTP client for Java applications that simplifies network communication.

Certificate pinning is a security mechanism that ensures the client only accepts specific certificates when establishing a secure connection.

The vulnerability allows man-in-the-middle attackers to bypass certificate pinning and intercept the communication between the client and the server, potentially leading to unauthorized access or data manipulation.

No, only versions before 2.7.4 for OkHttp 2.x and versions before 3.1.2 for OkHttp 3.x are affected. It is recommended to update to the fixed versions.

No, updating to the fixed versions of OkHttp is the only known solution to address this vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for com.squareup.okhttp3:okhttp.

How To Fix

Latest published version: 5.5.1 as of 22 Oct 2026

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 2.7.4 2.7.4
  • >= 3.0.0, < 3.1.2 3.1.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback