Skip to content
Crypto Disclosed report Advanced CVE-2016-2107

Padding oracle in AES-NI CBC MAC check (CVE-2016-2107)

A padding oracle vulnerability in OpenSSL's AES-NI CBC MAC check allows a man-in-the-middle attacker to decrypt traffic when an AES CBC cipher is used and the server supports AES-NI. The flaw was introduced while fixing Lucky 13 and stems from not verifying that enough data exists for both MAC and padding bytes.

jurajsomorovsky Follow

Originally disclosed on HackerOne

Bounty$2,500 View original
  • Fixed in 12 days
  • Paid in 12 days
  • Disclosed after 12 days

Summary by the program

A MITM attacker can use a padding oracle attack to decrypt traffic when the connection uses an AES CBC cipher and the server support AES-NI.

This issue was introduced as part of the fix for Lucky 13 padding attack (CVE-2013-0169). The padding check was rewritten to be in constant time by making sure that always the same bytes are read and compared against either the MAC or padding bytes. But it no longer checked that there was enough data to have both the MAC and padding bytes.

OpenSSL 1.0.2 users should upgrade to 1.0.2h OpenSSL 1.0.1 users should upgrade to 1.0.1t

This issue was reported to OpenSSL on 13th of April 2016 by Juraj Somorovsky using TLS-Attacker. The fix was developed by Kurt Roeckx of the OpenSSL development team.

The report

Advisory: https://www.openssl.org/news/secadv/20160503.txt Writeup (Referencing a proof of concept): http://web-in-security.blogspot.de/2016/05/curious-padding-oracle-in-openssl-cve.html

The original report as published on HackerOne, by jurajsomorovsky. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 padding check was rewritten to be constant-time but failed to verify that the input contained enough data for both the MAC and padding bytes.

What the attacker needed

MITM position; AES CBC cipher; server supports AES-NI

The fix

The issue was fixed in OpenSSL 1.0.2h and 1.0.1t; users should upgrade.

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.

This is a flaw in OpenSSL, a widely used encryption library. When a server uses a particular encryption mode (AES CBC) and a hardware feature (AES-NI), an attacker who can intercept network traffic can send crafted messages and observe small differences in responses to gradually decrypt the traffic. The bug was introduced when developers tried to fix a similar issue but forgot to check that the data was long enough.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

More from Internet Bug Bounty

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.