CVE-2021-0341 — platform/external/okhttp
CVE-2021-0341 is a CWE-295 vulnerability in platform/external/okhttp. A fix is available for platform/external/okhttp — see the affected versions and patch details below.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
Real-World Exposure
platform/external/okhttp📦platform/libcore📦platform/external/okhttp📦platform/libcore📦platform/external/okhttp📦platform/libcore📦platform/external/okhttp📦platform/libcore+2 moreReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Android packages — download data is not available via public APIs for these ecosystems.
Description
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦Android | platform/external/okhttp | ≥ 8.0:0&&< 8.0:2021-02-01 | 8.0:2021-02-01 |
| 📦Android | platform/libcore | ≥ 8.0:0&&< 8.0:2021-02-01 | 8.0:2021-02-01 |
| 📦Android | platform/external/okhttp | ≥ 8.1:0&&< 8.1:2021-02-01 | 8.1:2021-02-01 |
| 📦Android | platform/libcore | ≥ 8.1:0&&< 8.1:2021-02-01 | 8.1:2021-02-01 |
| 📦Android | platform/external/okhttp | ≥ 9:0&&< 9:2021-02-01 | 9:2021-02-01 |
| 📦Android | platform/libcore | ≥ 9:0&&< 9:2021-02-01 | 9:2021-02-01 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for platform/external/okhttp, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update platform/external/okhttp to 8.0:2021-02-01 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-0341 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2021-0341 can be triaged on real exposure rather than presence alone.
Tailored to CVE-2021-0341. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat AMQ Streams 2.4.0 | okhttp | RHSA-2023:3223 |
| Red Hat Data Grid 8.4.2 | okhttp | RHSA-2023:2723 |
| Red Hat JBoss Enterprise Application Platform Expansion Pack | okhttp | RHSA-2023:0756 |
| Red Hat OpenShift Dev Spaces 3 Containers | devspaces/server-rhel8:3.16-14 | RHSA-2024:6667 |
| Red Hat Single Sign-On 7 | okhttp | RHSA-2023:2713 |
| Red Hat Single Sign-On 7.6 for RHEL 7 | rh-sso7-keycloak-0:18.0.7-1.redhat_00001.1.el7sso | RHSA-2023:2705 |
| Red Hat Single Sign-On 7.6 for RHEL 8 | rh-sso7-keycloak-0:18.0.7-1.redhat_00001.1.el8sso | RHSA-2023:2706 |
| Red Hat Single Sign-On 7.6 for RHEL 9 | rh-sso7-keycloak-0:18.0.7-1.redhat_00001.1.el9sso | RHSA-2023:2707 |
Frequently Asked Questions
Is CVE-2021-0341 in your dependencies?
O3 Security finds CVE-2021-0341 across Android dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.