GHSL-2020-097: Missing hostname validation in twitter-stream - CVE-2020-24392
The twitter-stream library uses eventmachine in a way that does not validate the hostname in the server's TLS certificate. An attacker who can intercept network traffic could impersonate the Twitter stream server and feed malicious data to the client.
Originally disclosed on GitHub Security Lab
Missing hostname validation allows an attacker to perform a monster in the middle attack against users of the library.
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
Likely the library does not verify that the hostname in the server's TLS certificate matches the host being connected to.
Impact
An attacker could assume the identity of a trusted server and introduce malicious data in an otherwise trusted place.
What the attacker needed
Attacker can intercept network traffic; victim uses the twitter-stream library
How it was found
- Add a fake DNS entry mapping the Twitter stream hostname to localhost.
- Create a self-signed certificate.
- Start a TLS server on port 443 using that certificate.
- Write a small Ruby client using the twitter-stream library.
- Run the client and observe it connects to the fake server without rejecting the certificate.
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 app connects to a secure website, it checks that the website's certificate matches the name it expects. This library skips that check, so an attacker on the network could pretend to be the real server and send fake data.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.