RFC 7457
Summarizing Known Attacks on Transport Layer Security (TLS) and Datagram TLS (DTLS)
Summarizing Known Attacks on Transport Layer Security (TLS) and Datagram TLS (DTLS) π
okay bestie, this is RFC 7457 π It's Informational, not Standards Track, and it came out in February 2015 from the IETF. The authors are Y. Sheffer (Porticor), R. Holz (Technische Universitaet Muenchen), and P. Saint-Andre (&yet) π«Ά The ISSN is 2070-1721, and the header doesn't list anything it obsoletes or updates, so it isn't replacing or changing any other RFC πΈ
Abstract β¨
so over the last few years there have been a bunch of serious attacks on Transport Layer Security (TLS) π including ones on its most popular ciphers and modes of operation. this doc sums those attacks up, with the goal of motivating generic and protocol-specific recommendations for using TLS and Datagram TLS (DTLS) π¦
Status of This Memo π§
this one is not an Internet Standards Track spec. it's published just for info π
it's a product of the Internet Engineering Task Force (IETF) and it represents the consensus of the IETF community π₯ it got public review and was approved for publication by the Internet Engineering Steering Group (IESG). not every doc the IESG approves is a candidate for any level of Internet Standard, so check Section 2 of RFC 5741 if you're curious π
info about the current status of this doc, any errata, and how to send feedback is at http://www.rfc-editor.org/info/rfc7457 π
Copyright Notice π
Copyright (c) 2015 IETF Trust and the persons identified as the document authors. All rights reserved. π
this doc is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as they stand on the publication date. please actually read those, bestie, because they explain your rights and restrictions with respect to this doc π Code Components pulled out of this doc must include the Simplified BSD License text described in Section 4.e of the Trust Legal Provisions, and they come with no warranty, as described in the Simplified BSD License β
Table of Contents π§
1. Introduction ....................................................3
2. Attacks on TLS ..................................................3
2.1. SSL Stripping ..............................................3
2.2. STARTTLS Command Injection Attack (CVE-2011-0411) ..........4
2.3. BEAST (CVE-2011-3389) ......................................4
2.4. Padding Oracle Attacks .....................................4
2.5. Attacks on RC4 .............................................5
2.6. Compression Attacks: CRIME, TIME, and BREACH ...............5
2.7. Certificate and RSA-Related Attacks ........................5
2.8. Theft of RSA Private Keys ..................................6
2.9. Diffie-Hellman Parameters ..................................6
2.10. Renegotiation (CVE-2009-3555) .............................6
2.11. Triple Handshake (CVE-2014-1295) ..........................6
2.12. Virtual Host Confusion ....................................7
2.13. Denial of Service .........................................7
2.14. Implementation Issues .....................................7
2.15. Usability .................................................8
3. Applicability to DTLS ...........................................8
4. Security Considerations .........................................8
5. Informative References ..........................................8
Acknowledgements ..................................................13
Authors' Addresses ................................................13
1. Introduction πΈ
so over the last few years there have been several major attacks on TLS [RFC5246], including ones on its most commonly used ciphers and modes of operation π Section 2 has all the details, but the quick version is that both AES-CBC and RC4, which together cover most current usage, have been seriously attacked in the context of TLS π
this situation was one of the reasons the UTA working group got created. their job was to write generic and protocol-specific recommendations for using TLS and DTLS [RFC6347] π«Ά (unless Section 3 says otherwise, everything in this doc applies to DTLS too β¨)
there's an old saying, ironically attributed to the US National Security Agency (NSA): "Attacks always get better; they never get worse." π sadly, that saying is true, so any description of security attacks can only be a snapshot in time. this doc reflects what we know as of writing, and it seems likely that new attacks will be found in the future π₯
if you want a more detailed take on the attacks listed here, check out [Attacks-iSec] π₯
2. Attacks on TLS π₯
this section lists the attacks that motivated the current recommendations in [SECURE-TLS]. it is NOT meant to be a complete survey of TLS security, just to be clear π
there are widely deployed mitigations for some of the attacks below, but we believe their root causes need a more systematic fix, which we tried to develop in [SECURE-TLS] π§
when an attack has an identifier, we've included its Common Vulnerabilities and Exposures (CVE) ID. CVE [CVE] is a huge, industry-wide database of software vulnerabilities π
2.1. SSL Stripping π
some attacks try to remove Secure Socket Layer / Transport Layer Security (SSL/TLS) altogether by messing with unencrypted protocols that ask for TLS. specifically, they modify HTTP traffic and HTML pages as they pass over the wire π these are collectively called "SSL Stripping" (a form of the more generic "downgrade attack"), and Moxie Marlinspike first introduced them [SSL-Stripping] π for Web traffic, these only work if the client first reaches the Web server over HTTP. a commonly used fix is HTTP Strict Transport Security (HSTS) [RFC6797] β¨
2.2. STARTTLS Command Injection Attack (CVE-2011-0411) π
similarly, there are attacks on the switch from unprotected to TLS-protected traffic π¦ a bunch of IETF application protocols use an application-level command, usually STARTTLS, to upgrade a cleartext connection to TLS π«Ά
here's the problem: several STARTTLS implementations had a flaw where an application-layer input buffer kept commands that were pipelined with the STARTTLS command. so commands received before TLS negotiation got executed after TLS negotiation π± the fix is to require the application-level command input buffer to be empty before TLS negotiation starts π and note that this flaw lives in the application layer code and doesn't affect the TLS protocol directly π§
STARTTLS and similar mechanisms are vulnerable to downgrade attacks too: the attacker just removes the STARTTLS indication from the (unprotected) request π this can't be mitigated unless HSTS-like solutions get added π₯
2.3. BEAST (CVE-2011-3389) π
the BEAST attack [BEAST] takes advantage of issues in the TLS 1.0 implementation of Cipher Block Chaining (CBC), namely the predictable initialization vector π it uses that to decrypt parts of a packet, and specifically to decrypt HTTP cookies when HTTP runs over TLS πͺ
2.4. Padding Oracle Attacks π
because all current versions of TLS use MAC-then-encrypt, padding oracle attacks exist [Padding-Oracle] π a recent version is the Lucky Thirteen attack (CVE-2013-0169) [CBC-Attack], a timing side-channel attack that lets the attacker decrypt arbitrary ciphertext π
Lucky Thirteen can be mitigated by using authenticated encryption like AES-GCM [RFC5288], or encrypt-then-MAC [RFC7366], instead of the TLS default of MAC-then-encrypt β¨
an even newer padding oracle variant doesn't use timing info: it's the POODLE attack (CVE-2014-3566) [POODLE] on SSL 3.0 π this one has no known mitigation, bestie π
2.5. Attacks on RC4 π¦
the RC4 algorithm [RC4] has been used with TLS (and earlier with SSL) for years π°οΈ it has long been known to have a bunch of cryptographic weaknesses, e.g., [RC4-Attack-Pau], [RC4-Attack-Man], and [RC4-Attack-FMS] π₯ recent cryptanalysis [RC4-Attack-AlF] exploits biases in the RC4 keystream to recover repeatedly encrypted plaintexts π±
these recent results are on the verge of becoming practically exploitable. right now they need 2^26 sessions or 13x2^30 encryptions π so RC4 can no longer be seen as providing a sufficient level of security for TLS sessions π« for more details, check [CIPHER-SUITES] and the references it cites π
2.6. Compression Attacks: CRIME, TIME, and BREACH π
the CRIME attack [CRIME] (CVE-2012-4929) lets an active attacker decrypt ciphertext (specifically cookies) when TLS is used with TLS-level compression πͺ
the TIME attack [TIME] and the later BREACH attack [BREACH] (CVE-2013-3587, though the number has not been officially allocated) both make similar use of HTTP-level compression to decrypt secret data in the HTTP response π₯ we note that compressing the HTTP message body is way more common than compression at the TLS level π
the TIME attack can be mitigated by disabling TLS compression π we aren't aware of any TLS-protocol-level mitigations for BREACH, so application-level mitigations are needed (see [BREACH]) π for example, HTTP implementations that use Cross-Site Request Forgery (CSRF) tokens will need to randomize them π«Ά even the best practices and recommendations from [SECURE-TLS] aren't enough to stop this one π
2.7. Certificate and RSA-Related Attacks π₯
there have been several practical attacks on TLS when it's used with RSA certificates (the most common use case) π these include [Bleichenbacher98] and [Klima03] β¨ the Bleichenbacher attack has been mitigated in TLS 1.0, but the Klima attack, which relies on a version-check oracle, is only mitigated by TLS 1.1 π§
RSA certificates also often involve exploitable timing issues [Brumley03] (CVE-2003-0147), unless the implementation explicitly takes care to eliminate them β±οΈ
and a recent certificate fuzzing tool [Brubaker2014using] uncovered loads of vulnerabilities in different TLS libraries related to certificate validation π
2.8. Theft of RSA Private Keys π
when TLS is used with most non-Diffie-Hellman cipher suites, getting the server's private key is enough to decrypt any sessions (past and future) that were started with that server π± the popular Wireshark network sniffer uses this technique, for example, to inspect TLS-protected connections π¦
it's known that stolen (or otherwise obtained) private keys have been used as part of large-scale monitoring [RFC7258] of certain servers π
these attacks can be mitigated by protecting the private key better, e.g., with OS protections or dedicated hardware π even more effective is using cipher suites that offer "forward secrecy", the property where revealing a secret like a private key doesn't expose past or future sessions to a passive attacker π
2.9. Diffie-Hellman Parameters π
okay so TLS lets you define your own ephemeral Diffie-Hellman (DH) and Elliptic Curve Diffie-Hellman parameters in its key exchange modes π and this creates an attack described in [Cross-Protocol] π. using predefined DH groups, like the ones proposed in [FFDHE-TLS], would mitigate this attack π β¨
also, clients that don't properly verify the parameters they receive are exposed to man-in-the-middle (MITM) attacks π and the sad part is that the TLS protocol doesn't mandate this verification (see [RFC6989] for analogous information for IPsec) π
2.10. Renegotiation (CVE-2009-3555) πΈ
this one's a major attack on the TLS renegotiation mechanism, and it applies to all current versions of the protocol π© the attack itself and the TLS extension that fixes it are both described in [RFC5746] π«Ά
2.11. Triple Handshake (CVE-2014-1295) π¦
the triple handshake attack [BhargavanDFPS14] lets an attacker make two TLS connections share keying material π«£ and that opens the door to a whole multitude of attacks, like man-in-the-middle, breaking safe renegotiation, and breaking channel binding via TLS Exporter [RFC5705] or "tls-unique" [RFC5929] π₯ it's giving chaos, no cap
2.12. Virtual Host Confusion π§
a recent article [Delignat14] describes a security issue where SSLv3 fallback plus improper handling of session caches on the server side can be abused by an attacker to set up a malicious connection to a virtual host other than the one the server originally intended and approved π this one is especially serious in performance-critical environments, where sharing SSLv3 session caches is super common π
2.13. Denial of Service π
server CPU power has come a long way over the years, so TLS can now be turned on by default β¨ but the risk of malicious clients and coordinated groups of clients ("botnets") pulling off denial-of-service attacks is still very real π TLS also adds another vector for computational attacks, because a client can easily (with very little computational effort) force the server to expend relatively large computational work π and it's known that such attacks have actually been mounted, so this isn't hypothetical bestie π₯²
2.14. Implementation Issues π
even when the protocol is properly specified, that doesn't guarantee the security of implementations π€ there are very common issues that plague TLS implementations, and when TLS is integrated into higher-level protocols, TLS and its PKI-based authentication are sometimes the source of misunderstandings and implementation "shortcuts" π an extensive survey of these issues can be found in [Georgiev2012] π
- Implementations might omit validation of the server certificate altogether. For example, this is true of the default implementation of HTTP client libraries in Python 2 (e.g., CVE-2013-2191). π±
- Implementations might not validate the server identity. This validation typically amounts to matching the protocol-level server name with the certificate's Subject Alternative Name field. Note: this same information is often also found in the Common Name part of the Distinguished Name, and some validators incorrectly retrieve it from there instead of from the Subject Alternative Name. π«
- Implementations might validate the certificate chain incorrectly or not at all, or use an incorrect or outdated trust anchor list. ποΈ
an implementation attack of a different kind, one that exploits a simple coding mistake (a bounds check), is the Heartbleed attack (CVE-2014-0160) π©Έ it affected a wide swath of the Internet when it was discovered in April 2014, and honestly it's still iconic in the worst way π
2.15. Usability π
lots of TLS endpoints, like browsers and mail clients, let the user explicitly accept an invalid server certificate π this often shows up as a UI dialog (e.g., "do you accept this server?"), and users have been conditioned to say yes so the connection can go through π
this user behavior is used by (arguably legitimate) "SSL proxies" that decrypt and re-encrypt the TLS connection to enforce local security policy π§ it's also abused by attackers whose goal is to get access to the encrypted information πΏ
mitigation is complex and will probably involve a combination of protocol mechanisms (HSTS, certificate pinning [KEY-PINNING]) and very careful UI design β¨ it's a whole team effort, bestie π«Ά
3. Applicability to DTLS π¦
DTLS [RFC4347] [RFC6347] is an adaptation of TLS for UDP π‘
with respect to the attacks described in this document, DTLS 1.0 is equivalent to TLS 1.1 πΈ the only exception is RC4, which is disallowed in DTLS π« and DTLS 1.2 is equivalent to TLS 1.2 π
4. Security Considerations π¨
This is the serious part, so listen up π«’ this document describes protocol attacks in an informational manner, and in itself it does not have any security implications. Its companion documents, especially [SECURE-TLS], certainly do. ππ₯
5. Informative References β¨
okay bestie, this is the reading list π every source the spec leaned on, with all the details so you can go find them yourself. the whole thing stays in a code block so nothing gets scrambled π
[Attacks-iSec]
Sarkar, P. and S. Fitzgerald, "Attacks on SSL, a
comprehensive study of BEAST, CRIME, TIME, BREACH, Lucky13
and RC4 biases", August 2013,
<https://www.isecpartners.com/media/106031/
ssl_attacks_survey.pdf>.
[BEAST] Rizzo, J. and T. Duong, "Browser Exploit Against SSL/TLS",
2011, <http://packetstormsecurity.com/files/105499/
Browser-Exploit-Against-SSL-TLS.html>.
[BREACH] Prado, A., Harris, N., and Y. Gluck, "The BREACH Attack",
2013, <http://breachattack.com/>.
[BhargavanDFPS14]
Bhargavan, K., Delignat-Lavaud, A., Fournet, C., Pironti,
A., and P. Strub, "Triple handshakes and cookie cutters:
breaking and fixing authentication over tls", 2014,
<https://secure-resumption.com/tlsauth.pdf>.
[Bleichenbacher98]
Bleichenbacher, D., "Chosen Ciphertext Attacks Against
Protocols Based on the RSA Encryption Standard PKCS #1",
1998, <http://archiv.infsec.ethz.ch/education/fs08/secsem/
Bleichenbacher98.pdf>.
[Brubaker2014using]
Brubaker, C., Jana, S., Ray, B., Khurshid, S., and V.
Shmatikov, "Using Frankencerts for Automated Adversarial
Testing of Certificate Validation in SSL/TLS
Implementations", 2014,
<https://www.cs.utexas.edu/~shmat/shmat_oak14.pdf>.
[Brumley03]
Brumley, D. and D. Boneh, "Remote Timing Attacks are
Practical", 2003,
<http://crypto.stanford.edu/~dabo/papers/ssl-timing.pdf>.
[CBC-Attack]
AlFardan, N. and K. Paterson, "Lucky Thirteen: Breaking
the TLS and DTLS Record Protocols", IEEE Symposium on
Security and Privacy, 2013, <http://www.ieee-security.org/
TC/SP2013/papers/4977a526.pdf>.
[CIPHER-SUITES]
Popov, A., "Prohibiting RC4 Cipher Suites", Work in
Progress, draft-ietf-tls-prohibiting-rc4-01, October 2014.
[CRIME] Rizzo, J. and T. Duong, "The CRIME Attack", EKOparty
Security Conference, 2012.
[CVE] MITRE, "Common Vulnerabilities and Exposures",
<https://cve.mitre.org/>.
[Cross-Protocol]
Mavrogiannopoulos, N., Vercauteren, F., Velichkov, V., and
B. Preneel, "A cross-protocol attack on the TLS protocol",
Proceedings of the 2012 ACM Conference in Computer and
Communications Security, pages 62-72, 2012,
<http://doi.acm.org/10.1145/2382196.2382206>.
[Delignat14]
Delignat-Lavaud, A. and K. Bhargavan, "Virtual Host
Confusion: Weaknesses and Exploits", Black Hat 2014, 2014,
<https://bh.ht.vc/vhost_confusion.pdf>.
[FFDHE-TLS]
Gillmor, D., "Negotiated Finite Field Diffie-Hellman
Ephemeral Parameters for TLS", Work in Progress,
draft-ietf-tls-negotiated-ff-dhe-05, December 2014.
[Georgiev2012]
Georgiev, M., Iyengar, S., Jana, S., Anubhai, R., Boneh,
D., and V. Shmatikov, "The most dangerous code in the
world: validating SSL certificates in non-browser
software", Proceedings of the 2012 ACM conference on
Computer and Communications Security, pages 38-49, 2012,
<http://doi.acm.org/10.1145/2382196.2382204>.
[KEY-PINNING]
Evans, C., Palmer, C., and R. Sleevi, "Public Key Pinning
Extension for HTTP", Work in Progress,
draft-ietf-websec-key-pinning-21, October 2014.
[Klima03] Klima, V., Pokorny, O., and T. Rosa, "Attacking RSA-based
Sessions in SSL/TLS", 2003,
<https://eprint.iacr.org/2003/052.pdf>.
[POODLE] Moeller, B., Duong, T., and K. Kotowicz, "This POODLE
Bites: Exploiting the SSL 3.0 Fallback", September 2014,
<https://www.openssl.org/~bodo/ssl-poodle.pdf>.
[Padding-Oracle]
Vaudenay, S., "Security Flaws Induced by CBC Padding
Applications to SSL, IPSEC, WTLS...", EUROCRYPT 2002,
2002, <http://www.iacr.org/cryptodb/archive/2002/
EUROCRYPT/2850/2850.pdf>.
[RC4] Schneier, B., "Applied Cryptography: Protocols,
Algorithms, and Source Code in C", Second Edition, October
1996.
[RC4-Attack-AlF]
AlFardan, N., Bernstein, D., Paterson, K., Poettering, B.,
and J. Schuldt, "On the Security of RC4 in TLS", Usenix
Security Symposium 2013, August 2013,
<https://www.usenix.org/conference/usenixsecurity13/
security-rc4-tls>.
[RC4-Attack-FMS]
Fluhrer, S., Mantin, I., and A. Shamir, "Weaknesses in the
Key Scheduling Algorithm of RC4", Selected Areas in
Cryptography, August 2001,
<http://www.crypto.com/papers/others/rc4_ksaproc.pdf>.
[RC4-Attack-Man]
Mantin, I. and A. Shamir, "A Practical Attack on Broadcast
RC4", April 2001,
<http://saluc.engr.uconn.edu/refs/stream_cipher/
mantin01attackRC4.pdf>.
[RC4-Attack-Pau]
Paul, G. and S. Maitra, "Permutation After RC4 Key
Scheduling Reveals the Secret Key", August 2007,
<http://dblp.uni-trier.de/db/conf/sacrypt/
sacrypt2007.html#PaulM07>.
[RFC4347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer
Security", RFC 4347, April 2006,
<http://www.rfc-editor.org/info/rfc4347>.
[RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security
(TLS) Protocol Version 1.2", RFC 5246, August 2008,
<http://www.rfc-editor.org/info/rfc5246>.
[RFC5288] Salowey, J., Choudhury, A., and D. McGrew, "AES Galois
Counter Mode (GCM) Cipher Suites for TLS", RFC 5288,
August 2008, <http://www.rfc-editor.org/info/rfc5288>.
[RFC5705] Rescorla, E., "Keying Material Exporters for Transport
Layer Security (TLS)", RFC 5705, March 2010,
<http://www.rfc-editor.org/info/rfc5705>.
[RFC5746] Rescorla, E., Ray, M., Dispensa, S., and N. Oskov,
"Transport Layer Security (TLS) Renegotiation Indication
Extension", RFC 5746, February 2010,
<http://www.rfc-editor.org/info/rfc5746>.
[RFC5929] Altman, J., Williams, N., and L. Zhu, "Channel Bindings
for TLS", RFC 5929, July 2010,
<http://www.rfc-editor.org/info/rfc5929>.
[RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer
Security Version 1.2", RFC 6347, January 2012,
<http://www.rfc-editor.org/info/rfc6347>.
[RFC6797] Hodges, J., Jackson, C., and A. Barth, "HTTP Strict
Transport Security (HSTS)", RFC 6797, November 2012,
<http://www.rfc-editor.org/info/rfc6797>.
[RFC6989] Sheffer, Y. and S. Fluhrer, "Additional Diffie-Hellman
Tests for the Internet Key Exchange Protocol Version 2
(IKEv2)", RFC 6989, July 2013,
<http://www.rfc-editor.org/info/rfc6989>.
[RFC7258] Farrell, S. and H. Tschofenig, "Pervasive Monitoring Is an
Attack", BCP 188, RFC 7258, May 2014,
<http://www.rfc-editor.org/info/rfc7258>.
[RFC7366] Gutmann, P., "Encrypt-then-MAC for Transport Layer
Security (TLS) and Datagram Transport Layer Security
(DTLS)", RFC 7366, September 2014,
<http://www.rfc-editor.org/info/rfc7366>.
[SECURE-TLS]
Sheffer, Y., Holz, R., and P. Saint-Andre,
"Recommendations for Secure Use of TLS and DTLS", Work in
Progress, draft-ietf-uta-tls-bcp-08, December 2014.
[SSL-Stripping]
Marlinspike, M., "sslstrip", February 2009,
<http://www.thoughtcrime.org/software/sslstrip/>.
[TIME] Be'ery, T. and A. Shulman, "A Perfect CRIME? Only TIME
Will Tell", Black Hat Europe 2013, 2013,
<https://media.blackhat.com/eu-13/briefings/Beery/
bh-eu-13-a-perfect-crime-beery-wp.pdf>.
Acknowledgements π«Ά
the authors have a whole list of people to thank π Stephen Farrell, Simon Josefsson, John Mattsson, Yoav Nir, Kenny Paterson, Patrick Pelletier, Tom Ritter, Rich Salz, and Meral Shirazipour all gave feedback on this doc, and it's giving teamwork π
Andrei Popov wrote the text on RC4, Kohei Kasamatsu did the Lucky13 text, Ilari Liusvaara wrote the parts on attacks and on DTLS, Aaron Zauner handled virtual host confusion, and Chris Newman wrote the text on STARTTLS command injection β¨
Ralph Holz gratefully acknowledges the support of NICTA (National ICT of Australia) in preparing this document πΈ
During IESG review, Richard Barnes, Barry Leiba, and Kathleen Moriarty caught several issues that needed fixing, so big thanks to them π
The authors gratefully acknowledge the assistance of Leif Johansson and Orit Levin as the working group chairs and Pete Resnick as the sponsoring Area Director π
The document was prepared using the lyx2rfc tool, created by Nico Williams π
Authors' Addresses π¦
here's where to find the authors, bestie π
Yaron Sheffer
Porticor
29 HaHarash St.
Hod HaSharon 4501303
Israel
EMail: yaronf.ietf@gmail.com
Ralph Holz
Technische Universitaet Muenchen
Boltzmannstr. 3
Garching 85748
Germany
EMail: holz@net.in.tum.de
Peter Saint-Andre
&yet
EMail: peter@andyet.com
URI: https://andyet.com/
π¦ where this page comes from
- ietf: rfc7457 2015-02
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms