Skip to content
Crypto Advisory Intermediate CVE-2020-24392

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.

agustingianni Follow

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.

agustingianni, on GitHub Security Lab

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

  1. Add a fake DNS entry mapping the Twitter stream hostname to localhost.
  2. Create a self-signed certificate.
  3. Start a TLS server on port 443 using that certificate.
  4. Write a small Ruby client using the twitter-stream library.
  5. 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.

More by agustingianni

View all

24 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

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.