# CVE-2026-120665: ECH Server Name Verification Bypass after HelloRetryRequest

> An attacker who can forge DNS responses can impersonate servers to OpenSSL ECH clients, redirecting their traffic and accepting attacker certificates.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Harmful if only installed:** No
- **Needs a specific call:** Yes (`SSL_set1_dnsname`, `SSL_set1_host`, `X509_VERIFY_PARAM_set1_host`)
- **Fix available:** Yes
- **Published:** 1 Dec 2026
- **Updated:** 1 Dec 2026
- **Also known as:** GHSA-qv5w-cr2g-2wfg, UBUNTU-CVE-2026-120665

## What is CVE-2026-120665?

CVE-2026-120665 is a security feature bypass vulnerability in OpenSSL, published on 1 Dec 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Issue summary: A TLS client using Encrypted Client Hello (ECH) can be made to
accept a certificate for a domain chosen by an attacker as valid for the
server name the application requested.

Impact summary: An attacker who can forge DNS responses to a client can
impersonate any server the client connects to using ECH. The client then sends
its application data to the attacker and accepts the attacker's responses as
coming from the requested server.

CWE: CWE-295: Improper Certificate Validation

Description: When ECH is rejected, a client verifies the server's certificate
against the public name in the ECH configuration, so that it can obtain a
corrected configuration, and then aborts the handshake. The server's first
message decides whether ECH was accepted. If that message is a
HelloRetryRequest which rejects ECH, the OpenSSL client switches certificate
verification to the public name but does not treat the rejection as final. A
following ServerHello which signals ECH acceptance then causes the client to
complete the handshake and report ECH success, while the certificate is still
checked against the public name instead of the name the application set with
SSL_set1_dnsname(), SSL_set1_host() or X509_VERIFY_PARAM_set1_host().

ECH configurations are normally obtained from DNS HTTPS records, which are not
authenticated unless DNSSEC is used. An attacker who can forge those records
can give the client an ECH configuration for which it holds the private key,
with a public name for a domain it controls and holds a valid certificate
for. The same forged DNS responses can direct the client to connect to the
attacker's own server. That server can then send a HelloRetryRequest that
rejects ECH followed by a ServerHello that accepts it, and the client will
accept its certificate as authenticating the requested server. The same
applies to a client-facing server in a split-mode ECH deployment, which holds
the ECH private key and a certificate for the public name but must not be able
to impersonate the backend servers.

Only TLS clients that are configured to use ECH are affected. Clients that
send only GREASE ECH and servers are not affected. ECH support was added in
OpenSSL 4.0, it must be explicitly configured by the application, and the
attacker must be able to forge DNS responses to the client or otherwise supply
it with an ECH configuration. For these reasons this issue was assessed as
Moderate severity.

FIPS impact: no
No FIPS modules are affected by this issue as the affected code is outside
the OpenSSL FIPS module boundary.

Weakness: CWE-295 (Improper Certificate Validation)

## Which versions are affected by CVE-2026-120665?

An affected version is only exploitable if your software calls SSL_set1_dnsname, SSL_set1_host or X509_VERIFY_PARAM_set1_host. Many projects that include it are not exposed.


## How do I fix CVE-2026-120665?

No fix published yet.

## Is CVE-2026-120665 being exploited?

There is no known exploitation of CVE-2026-120665 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-120665 and fix it if it is affected.

What it is: CVE-2026-120665 is a security feature bypass vulnerability in OpenSSL, published on 1 Dec 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-120665 in the wild and no public exploit code.
Exposure: An affected version is only exploitable if your software calls SSL_set1_dnsname, SSL_set1_host or X509_VERIFY_PARAM_set1_host. Many projects that include it are not exposed.

Affected product: OpenSSL. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
   If an affected version is present, also search the code for calls to SSL_set1_dnsname, SSL_set1_host or X509_VERIFY_PARAM_set1_host and report whether any exist.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-120665/ (Markdown: https://insights.sbomify.com/CVE-2026-120665/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-120665
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-120665
- OSV: https://osv.dev/vulnerability/CVE-2026-120665

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-120665/
Summaries are generated and may contain mistakes; the official description above is the record.
