Square OkHttp can accept the wrong certificate
In verifyHostName of OkHostnameVerifier.java, there is a possible way to accept a certificate for the wrong domain due to improperly used crypto. This could lead to remote information disclosure with no additional execution privileges needed. User interaction is not needed for exploitation. Product: AndroidVersions: Android-8.1 Android-9 Android-10 Android-11 Android ID: A-171980069
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Java / Kotlin (Maven) | com.squareup.okhttp3:okhttp | < 4.9.2 | 4.9.2 |
References
- https://nvd.nist.gov/vuln/detail/CVE-2021-0341
- https://github.com/square/okhttp/issues/6724
- https://github.com/square/okhttp/pull/6741
- https://github.com/square/okhttp/commit/f574ea2f5259d9040f264ddeb582fb1ce563f10c
- https://github.com/square/okhttp
- https://source.android.com/security/bulletin/2021-02-01
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N- Weakness (CWE)
CWE-295- Platform
- Java / Kotlin (Maven)
- Package
com.squareup.okhttp3:okhttp- Disclosed
- 24.05.2022
- Updated
- 11.10.2026 13:19
Sources and licenses
OSV / GitHub Advisory Database - GHSA-3cqm-mf7h-prrj - CC BY 4.0
Vulnerability history: com.squareup.okhttp3:okhttp
All published vulnerabilities of this package (Java / Kotlin (Maven)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 2
- First → latest
- 05.2022 05.2022
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- High 1
- Medium 1
Disclosures per year
- 2022: 2
- 2023: 0
- 2024: 0
- 2025: 0
- 2026: 0
-
Square OkHttp can accept the wrong certificate this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.