Improper Certificate Validation Affecting com.squareup.okhttp3:okhttp package, versions [,4.9.2)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
1.17% (77th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JAVA-COMSQUAREUPOKHTTP3-13961111
  • published14 Nov 2025
  • disclosed24 May 2022
  • creditJérémie Bresson

Introduced: 24 May 2022

CVE-2021-0341  (opens in a new tab)
CWE-295  (opens in a new tab)

How to fix?

Upgrade com.squareup.okhttp3:okhttp to version 4.9.2 or higher.

Overview

com.squareup.okhttp3:okhttp is a HTTP & HTTP/2 client for Android and Java applications

Affected versions of this package are vulnerable to Improper Certificate Validation via the verifyHostName function in OkHostnameVerifier.java. An attacker can gain unauthorized access to sensitive information by presenting a certificate for an incorrect domain, which is improperly accepted during cryptographic verification.

CVSS Base Scores

version 4.0
version 3.1