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.