OpenSSL Alternative Chains Certificate Forgery (CVE-2015-1793) MITM Proxy
OpenSSL contained a logic error in certificate chain verification that let a man-in-the-middle present a crafted chain so the client treated a valid leaf certificate as a CA and accepted a forged certificate. An attacker who can intercept traffic could then impersonate the server and read or modify the session data.
github.com
Published on github.com
rootcaname = OpenSSL::X509::Name.parse('/C=US/O=Root Inc./CN=Root CA') rootcakey = OpenSSL::PKey::RSA.new(2048) rootcacert = OpenSSL::X509::Certificate.new rootcacert.issuer = OpenSSL::X509::Name.parse('/C=US/O=Root Inc./CN=Root CA') rootcacert.notafter = Time.now + 86400 rootcacert.notbefore = Time.now…
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 a logic error in OpenSSL's alternative certificate chain handling caused the client to accept a non-CA leaf certificate as an issuer, bypassing the intended trust checks.
Impact
An attacker who can intercept traffic could impersonate the server and capture the application data exchanged, though the text notes this requires an active man-in-the-middle position.
What the attacker needed
Active man-in-the-middle position; vulnerable OpenSSL client; crafted certificate chain
How it was found
- Generate a set of certificates: a root CA, an intermediate CA, a sub-intermediate CA, a valid leaf certificate for the target host, and a fake certificate signed by the leaf.
- Configure the Metasploit module with the sub-intermediate CA certificate, the leaf certificate and its key, and the target host.
- Run the module so it listens on port 443 and proxies connections to the real server.
- Connect a client to the proxy using the generated root certificates as the trust anchor.
- Observe that the client accepts the forged certificate chain and the session data is captured.
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 your browser connects to a secure site, it checks a chain of certificates to confirm the site is genuine. A bug in the OpenSSL library made that check too lenient, so someone sitting between you and the site could slip in a fake certificate and be trusted. They could then read or change what you send.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.