Skip to content
Crypto Write-up Intermediate

Xray-core concealed a certificate verification bypass vulnerability

The certificate pinning option in Xray-core, pinnedPeerCertSha256, could be bypassed because the pinning check accepted a leaf certificate inserted anywhere in the chain. A man-in-the-middle attacker could therefore present a forged chain and have it accepted, defeating the only remaining certificate check once regular verification was always skipped.

github.com

Published on github.com

Popular proxy software Xray-core covered up a certification verification bypass vulnerability for half a year#672

The author, on github.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the pinning logic searched the whole certificate chain for a matching leaf certificate instead of requiring the pinned certificate to be the actual end-entity certificate, so an attacker-supplied certificate placed elsewhere in the chain satisfied the check.

Impact

Because regular certificate verification was always skipped when the option was enabled, a successful bypass left no certificate checking at all, allowing a man-in-the-middle attack; the text says the first fix was incomplete and bypass was still possible in some circumstances.

What the attacker needed

Victim uses pinnedPeerCertSha256; attacker can intercept the connection

The fix

The maintainers silently changed the pinning code the same day and released a new version, but the reporter later found the fix incomplete and filed a security advisory.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

When a program connects to a server, it normally checks a certificate to confirm the server is genuine. Xray-core added a second check that compares the server's certificate against a known fingerprint, but that check could be fooled by slipping a matching certificate into the wrong position in the chain. Someone sitting between the user and the server could then impersonate the server and read or alter the traffic.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.