Gildas Avoine and Loïc Ferreira 151
AlFardan and Paterson [
PA12
] describe a padding oracle attack against DTLS [
RM06
]
and targeting actual implementations even though TLS implementations have been patched
in order to thwart the padding oracle attacks.
4
Their attack is made easier because a
DTLS session is not stopped when a cryptographic error occurs. On the other hand, in
such a case, the invalid packet is silently discarded and no error message is sent. In order
to circumvent this drawback, they perform a timing attack (using a kind of keep-alive
command) and amplify the response time difference thanks to a batch of numerous packets
which all either have valid or invalid padding and hence all contribute to an accumulated
timing difference in the same way.
Afterwards, the padding oracle attack has been applied to various network and applica-
tion protocols, and schemes such as IPsec [
PY04
,
YPM05
,
DP07
,
DP10
], SSL 3
.
0 [
MDK14
],
EMV [
DLP
+
12
], ASP.NET [
DR11
], XML [
JS11
,
JSS12
,
KMSS15
], JavaServer Faces
CAPTCHA, Ruby on Rails framework, and OWASP Enterprise Security API Toolk-
its [
RD10
]. In addition, Rizzo and Duong [
RD10
] describe how to turn a padding oracle
into an encryption oracle
5
, under the condition that the encryption key is invariant (at
least it does not change throughout several messages decryption, in particular it is not
renewed in case of a cryptographic error).
Using the same kind of technique as [
PA12
], AlFardan and Paterson [
AP13
] use another
side-channel to perform attacks targeting DTLS (practical) and TLS (almost practical).
Their timing attack, called “Lucky 13”, relies on the number of inner compression function
iterations made during the
HMAC
computation when verifying a message authentication
tag. The attack remains possible despite the fact that the targeted cryptographic libraries
implement the recommended countermeasure. Indeed the recommended mitigation consists,
when the padding data is invalid, in performing a
MAC
verification on the decrypted data
as if there were no padding data. This leaves a small timing channel that can be exploited
(based on the discrepancy when the padding data is valid and when one assumes there is
no padding data).
Using a variant of Lucky 13, Albrecht and Paterson [
AP16
] succeed in attacking the
Amazon’ s2n implementation of SSL/TLS [
Sch15
,
AWS
], overcoming the countermeasures
implemented in the cryptographic library.
Irazoqui, İnci, Eisenbarth, and Sunar [
AIES15
] show that it is still possible to apply
the Lucky 13 attack in a cloud setting even if the recommended mitigations against the
attack are implemented. They consider co-located virtual machines which are able to know
if a dummy function (used to equalize the processing time) is called or not.
Paterson and Watson [
PW08
] provide a formal security treatment of the
CBC
mode
encryption with padding in the chosen plaintext setting. They show that a padding method
that has no invalid padded message achieves immunity against padding oracle attacks when
the underlying block cipher is modeled as a pseudo-random permutation family. Paterson
and Watson [
PW12
] also extend existing security models for authenticated encryption
of Bellare and Namprempre [
BN08
] to incorporate padding oracle attacks in the chosen
ciphertext setting.
Moreover the attack presented in 1998 by Bleichenbacher [
Ble98
] against the PKCS #1
v1
.
5 RSA encryption scheme in SSL can retrospectively be seen as a padding oracle or, more
generally, a “format oracle” attack. This attack aims at retrieving the “premaster secret”
negotiated by a client and a server, and used to compute the session keys. This adaptive
ciphertext attack uses the specific plaintext format in order to gradually narrow the interval
the plaintext belongs to until one possible value remains. In order to know if his guess is cor-
rect, Bleichenbacher exploits an error code sent by the server when the decrypted message
does not correspond to a valid format. Bleichenbacher attack has been followed by subse-
4
As noted in [
PA12
], the explanation could lie in the fact that DTLS provides no error messages in
case of a cryptographic error, neither does the secure tunnel end. Thereby a remaining timing channel
could have been seen as not usable in order to build a padding oracle.
5
The underlying algorithm provides encryption only, not authenticated encryption.