OpenWrt ustream-ssl certificate verification information leak vulnerability
The ustream-ssl library in OpenWrt fails to properly validate SSL certificates, allowing a man-in-the-middle attacker to present any certificate and read the client's initial request data. This affects versions 18.06.4 and 15.05.1 when using OpenSSL or mbed TLS backends.
Originally disclosed on Cisco Talos
An exploitable information leak vulnerability exists in the ustream-ssl library of OpenWrt, versions 18.06.4 and 15.05.1. When connecting to a remote server, the server’s SSL certificate is checked but no action is taken when the certificate is invalid.
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 report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The function __ustream_ssl_connect returns U_SSL_OK even when certificate verification fails, because ustream_ssl_verify_cert returns early without setting valid_cert to true.
Impact
An attacker could perform a man-in-the-middle attack to steal all data sent by the client during the first request.
What the attacker needed
Man-in-the-middle position; OpenWrt using OpenSSL or mbed TLS
The fix
The vendor patched the issue, likely by ensuring that U_SSL_OK is only returned when the certificate is valid.
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 report has not been written yet. The Original tab links to the source.
When your device connects to a secure website, it checks the website's certificate to make sure it's talking to the real site. In this case, the check happens but the device ignores the result, so an attacker who intercepts the connection can pretend to be the website and steal the first request you send.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.