Skip to content
Crypto Advisory Advanced

GHSL-2020-003, GHSL-2020-004, GHSL-2020-005: Person in the middle attack on openfortivpn clients

openfortivpn had three TLS certificate validation flaws: a NULL byte in the CommonName could trick the hostname check, a negative return from X509_check_host was treated as success, and an uninitialized buffer was passed to X509_check_host. An attacker able to perform a person-in-the-middle attack could spoof VPN servers and intercept traffic.

agustingianni Follow

Originally disclosed on GitHub Security Lab

Several security issues have been found in the way openfortivpn deals with TLS. These issues can lead to situations in which an attacker can perform a person-in-the-middle attack on clients.

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

The code used string comparison functions that stop at NULL bytes and misinterpreted return values from OpenSSL's hostname check, and also passed an uninitialized buffer.

Impact

An attacker able to get a crafted certificate from a CA could perform a person-in-the-middle attack against VPN clients.

What the attacker needed

Attacker can perform person-in-the-middle; attacker obtains crafted certificate from a CA; openfortivpn built with OpenSSL < 1.0.2 (for issue 1)

The fix

The issues were fixed by using proper hostname validation and correcting the API usage.

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 VPN client connects to a server, it checks the server's certificate to make sure it's talking to the right place. These bugs meant the check could be fooled, so an attacker in the middle of the connection could pretend to be the VPN server and read or change your traffic.

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.