Skip to main content

Xray core: Xray-core: Pinning a CA certificate via pinnedPeerCertSha256 can lead to the success of MITM attacks

0
High
Published: 10/02/2026 (10/02/2026, 22:35:51 UTC)
Source: GCVE Database
Product: github.com/xtls/xray-core

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.

CVSS v4.0

Attack Vector
Adjacent Network
Attack Complexity
High
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
High
Vuln. Integrity
High
Vuln. Availability
None
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:A/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

Affected software

Goghsa
github.com/xtls/xray-core
Affected versions
>=1.260113.0 <1.260327.1-0.20260710210335-64fada32b5b9

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 10/03/2026, 17:41:21 UTC

Technical Analysis

The vulnerability in Xray-core arises from improper TLS certificate verification when pinning a CA certificate via pinnedPeerCertSha256. If the ServerName field in the TLS configuration is empty, the certificate verification skips hostname validation, allowing an attacker who controls a leaf certificate issued by the pinned CA to impersonate any domain or IP address. This is due to the Go crypto/tls behavior where specifying pinnedPeerCertSha256 sets InsecureSkipVerify to true, disabling hostname checks unless ServerName is explicitly set. Certain code paths in Xray-core do not set ServerName, especially when the address is an IP, leaving the system vulnerable to MITM attacks.

Potential Impact

An attacker who can obtain a leaf certificate issued by the pinned CA can impersonate any server, including domains or IP addresses, to the client using Xray-core. This enables successful man-in-the-middle attacks, potentially allowing interception and manipulation of TLS-encrypted communications. The vulnerability affects scenarios where ServerName is not set and pinnedPeerCertSha256 is used, weakening TLS verification.

Mitigation Recommendations

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-5wf9-h793-w73c
Osv Schema Version
1.4.0
Ecosystems
["Go"]
Database Specific Severity
HIGH
Cvss Version
4.0

Threat ID: 6ac139b5a43b0b3b89d69d13

Added to database: 10/03/2026, 17:21:57 UTC

Last enriched: 10/03/2026, 17:41:21 UTC

Last updated: 10/04/2026, 02:51:38 UTC

Views: 8

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses