github.com/xtls/xray-core · Xray core: Xray-core: Pinning a CA certificate via pinnedPeerCertSha256 can lead to the success of MITM attacks
Affects github.com/xtls/xray-coreSource GCVE Database
CVSS 7.6 High : upgrade to 1.260327.1-0.20260710210335-64fada32b5b9 soon.
Data as of 3 Oct 2026, 17:41 UTC
- Patch
- Available – fixed in 1.260327.1-0.20260710210335-64fada32b5b9
CVSS:4.0/AV:A/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:NWhat to do
Upgrade github.com/xtls/xray-core to 1.260327.1-0.20260710210335-64fada32b5b9.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| Gogithub.com/xtls/xray-core | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A patch is available for this vulnerability. Users should upgrade to a fixed version of Xray-core to ensure ServerName is properly set in all TLS configurations, especially when using pinnedPeerCertSha256. Until patched, users should explicitly specify ServerName when configuring TLS to avoid empty ServerName values. Review usage of pinnedPeerCertSha256 and avoid relying solely on CA pinning without hostname verification.
Description
Xray-core has a vulnerability where pinning a CA certificate using pinnedPeerCertSha256 can enable man-in-the-middle (MITM) attacks if the ServerName configuration is empty. This occurs because the TLS verification does not check the hostname against the certificate when ServerName is missing and InsecureSkipVerify is true. In some code paths, ServerName is not set when using IP addresses or certain dialers, allowing an attacker to issue a leaf certificate from the pinned CA and hijack connections.
References
- github.com/XTLS/Xray-core/security/advisories/GHSA-5wf9-h793-w73c (opens in a new tab)
- github.com/XTLS/Xray-core/pull/6472 (opens in a new tab)
- github.com/XTLS/Xray-core/commit/64fada32b5b9e6ae064a038fa0e4e2b766499bd5 (opens in a new tab)
- github.com/XTLS/Xray-core (opens in a new tab)
- github.com/XTLS/Xray-core/releases/tag/v26.7.11 (opens in a new tab)