Another crypto downgrade attack: Logjam
If more evidence was needed that deliberately weakening cryptographic algorithms based on politics is likely to go astray, the new Logjam attack against TLS seems to provide it. All of that evidence probably won't stop politicians (and others) from further attempts to cripple crypto, sadly, but it may at least provide some guidance to those who must implement those decisions down the road. In the meantime, though, there is yet another attack against the encryption used by the web and other internet protocols.
Downgrade attack
There are two related pieces to Logjam. The first is a crypto downgrade attack (somewhat akin to the FREAK attack) that, once again, abuses the export-strength ciphers that were mandated by the US government and are often still supported for backward compatibility. In this case, though, the attack is against Diffie-Hellman (DH) key exchange, rather than the RSA keys targeted by FREAK. Also unlike FREAK, the Logjam crypto downgrade attack uses a flaw in the TLS protocol instead of exploiting a bug in some TLS implementations.
The basic problem that Logjam exploits is that the message a server sends for key exchange can be undetectably replaced with a weaker variant. The message that uses a DH key that has been restricted to using prime numbers of at most 512 bits for political reasons (i.e. DHE_EXPORT ciphers) and one that uses the non-export variety can't be distinguished by clients. So a properly functioning server that supports, but does not prefer, DHE_EXPORT ciphers will send a key exchange message using a 1024-bit (or larger) DH group (i.e. one that has been derived from a 1024-bit prime). A man in the middle can intercept that message and rewrite it using the server's 512-bit group without alerting the client that anything has changed.
It turns out that the vast majority of servers that support DHE_EXPORT also use the same 512-bit prime number. The Logjam paper [PDF] shows that 82% of DHE_EXPORT-supporting web servers used a prime that had been distributed with the Apache web server for a number of years. It also reports that nearly 5% of the 14.3 million HTTPS web sites supported DHE_EXPORT, so roughly 4% of the net is using that one prime number. This practice was not seen as a problem, as the paper notes:
In order to exploit the downgrade to DHE_EXPORT, an attacker needs to be able to calculate discrete logarithms in near real-time. It is a nearly impossible math problem, but one that is made vastly easier with access to the prime number of interest. Using that, the man in the middle can precompute values that allow it to extract the session key from the key exchange. Once that is obtained, the man in the middle can pretend to be the server with impunity; the client will be none the wiser.
On a system with four six-core Xeon processors, the researchers' proof of concept was able to crack the session key in an average of 90 seconds. That may seem like a long time for users to wait for the browser to connect to the server—and it is, at least for interactive sessions. There are a number of techniques described in the paper to work around that delay.
To
start with, non-interactive uses, such as curl or Git, are often
unattended so they have long timeouts and "we could hijack their
connections without much difficulty
". There is a TLS warning
alert mechanism that can be used to reset the browsers' handshake timers.
The delay still might be noticed by the user, however, so the attacker
might choose to compromise a request for some background resource that
won't delay the page display.
There is also the fact that many TLS implementations cache their ephemeral
key and reuse it multiple times; that allows the calculation to be done once
and to be used again and again.
Beyond that, more optimization or more powerful systems could potentially
reduce the average time to crack the key substantially.
Diffie-Hellman and state-level attackers
The second piece of the Logjam report looks at how vulnerable the DH key
exchange is to attack when there is no downgrade ability. Once again,
various protocols
often use (or even specify) the same prime numbers everywhere. The paper
specifically mentions SSH, TLS, and Internet Key
Exchange (IKE) which is used by IPsec.
Currently, 768-bit DH groups are
fairly widespread and the paper estimates that precomputing the values
needed would require around 36,000 core-years, which is "within
reach by computing power available to academics
". Once that
precomputation is done, doing a single 768-bit discrete log computation is
on the order of two core-days.
Perhaps even more eye-opening, though, is that 1024-bit DH groups are estimated to be crackable by state-level attackers (i.e. governments and their ilk). Precomputation is on the order of 45 million core-years, which is an enormous effort, but could be reduced with specialized hardware. Once that was done, the discrete log calculations could be done in roughly 30 core-days. That estimate leads to a possible answer to a question that has been asked frequently in the crypto community:
Documents leaked by Snowden indicate that the NSA has been passively decrypting virtual private network (VPN) traffic. The paper concludes that the documented information is consistent with an attack against the 1024-bit DH group used by IKE. That doesn't mean it is the mechanism used by the NSA, but it could be.
That leads the authors of the paper (David Adrian, Karthikeyan Bhargavan, Zakir Durumeric, Pierrick Gaudry, Matthew Green, J. Alex Halderman, Nadia Heninger, Drew Springall, Emmanuel Thomé, Luke Valenta, Benjamin VanderSloot, Eric Wustrow, Santiago Zanella-Béguelin, and Paul Zimmermann) to a number of recommendations. Disabling DHE_EXPORT ciphers, and configuring the other DHE ciphers to use groups of 2048 bits or larger, head that list. Browsers and other clients should require groups of at least 1024 bits to avoid the downgrade attack but still interoperate with servers that have not been upgraded.
Avoiding fixed-prime groups is another recommendation, as is transitioning to elliptic curve DH (ECDH), which does not provide as much of an advantage for precomputation. The parameters for ECDH still need to be worked out—those recommended by the US government are viewed with suspicion due to NSA influence on their choice.
The last two recommendations are admonishments to politicians and the
crypto community respectively. First: "In combination with FREAK,
our attacks warn of the long-term
debilitating effects of deliberately weakening cryptography.
" But
there is also lots of room for better communication by the crypto
community:
For those wanting to check their status, the Logjam web site will warn if their browser is susceptible to the attack (i.e. if it will accept DH groups with less than 1024 bits). Another page provides tools to test servers and information on how to upgrade those that are found to have an inadequate DH group size (i.e. less than 2048). For example, the LWN.net server needs an upgrade to its DH group, which we will be taking care of soon.
This research is quite timely, interesting, and important, though it may not require a "drop everything" response—at least for sites that don't support DHE_EXPORT. For those that believe their traffic may be targeted by state-level attackers, however, prudence would seem to indicate a faster response. At this point, after the information leaked by Snowden and others, these kinds of attacks seem a little less surprising—we have known that secret services were decrypting lots of this data for some time. Now, at least, we may know some of the "how" as well.
Index entries for this article | |
---|---|
Security | Transport Layer Security (TLS) |
Security | Vulnerabilities/Crypto downgrade |
Posted May 21, 2015 7:24 UTC (Thu)
by nmav (guest, #34036)
[Link] (1 responses)
Posted May 21, 2015 7:43 UTC (Thu)
by nmav (guest, #34036)
[Link]
Posted May 21, 2015 9:10 UTC (Thu)
by inganman (guest, #8234)
[Link]
There is a option "smtpd_tls_dh512_param_file" that "should use with export-grade EDH ciphers" ( http://www.postfix.org/postconf.5.html )
Posted May 21, 2015 14:34 UTC (Thu)
by cesarb (subscriber, #6266)
[Link]
Posted May 21, 2015 14:48 UTC (Thu)
by cesarb (subscriber, #6266)
[Link] (5 responses)
How much should we worry about SSH?
From my quick look at the "ssh -v" output, it seems to require at least a 1024-bit DH group when not using the newer elliptic curves. From what I have read, the DH group used comes from /etc/ssh/moduli, which doesn't seem to be regenerated on install at least on Ubuntu (I already found two machines with identical /etc/ssh/moduli files on a quick look). Would a state-level attacker have done the required precomputation for the /etc/ssh/moduli found in common Linux distributions?
Posted May 22, 2015 14:33 UTC (Fri)
by robbe (guest, #16131)
[Link]
Posted May 22, 2015 14:59 UTC (Fri)
by tialaramex (subscriber, #21167)
[Link] (3 responses)
Regenerating the values should be done very carefully, or else not at all, since erroneous inputs destroy the security of DH entirely. Switching towards Elliptic Curves may be a better choice.
Posted May 22, 2015 21:04 UTC (Fri)
by wahern (subscriber, #37304)
[Link] (2 responses)
In other words, just use OpenSSL to generate new DH parameters and move on to improving the rest of your software and infrastructure.
Posted May 24, 2015 9:35 UTC (Sun)
by reubenhwk (guest, #75803)
[Link] (1 responses)
Posted May 27, 2015 17:40 UTC (Wed)
by flussence (guest, #85566)
[Link]
Posted May 21, 2015 18:43 UTC (Thu)
by dowdle (subscriber, #659)
[Link] (1 responses)
Summary, RHEL6 (as of 6.6) and 7 are not vulnerable but...
"Red Hat Enterprise Linux 5 does support the export-grade cipher suite in its default cipher list. Red Hat does not plan to change the default cipher list in Red Hat Enterprise Linux 5."
I have left a comment to that and am curious what folks think about that response.
Posted May 21, 2015 20:36 UTC (Thu)
by Cyberax (✭ supporter ✭, #52523)
[Link]
Posted May 21, 2015 23:32 UTC (Thu)
by gerdesj (subscriber, #5446)
[Link] (1 responses)
Some handy hints:
As ever, the above are no substitute for research but they will get you on the right track.
I note that my browser has picked TLS 1.0 on this site which PCI DSS 1.3 has deprecated as not strong enough for those concerned by such things and must be gone by June next year for new systems. See: https://www.pcisecuritystandards.org/documents/Migrating_... (PDF)
Cheers
Posted May 22, 2015 15:08 UTC (Fri)
by robbe (guest, #16131)
[Link]
Keeping SSL3 around /may/ be useful to cater to those poor souls still chained to IE on XP... Wikimedia clocks these in at 0.3% of requests, can't imagine that the percentage is higher around here. corbet is certainly aware of the numbers.
Posted May 22, 2015 14:49 UTC (Fri)
by robbe (guest, #16131)
[Link] (4 responses)
Do they mean that a typical academic can commandeer a cluster of 500+ nodes for a year?
I am aware that a significant number of universities house a monster like that, but is "available to academics" really the right expression to use?
Posted May 22, 2015 16:40 UTC (Fri)
by Cyberax (✭ supporter ✭, #52523)
[Link] (3 responses)
Posted May 22, 2015 20:51 UTC (Fri)
by cesarb (subscriber, #6266)
[Link] (2 responses)
An attacker is not necessarily going to buy all these CPU-hours with their own money. Unlike academics, attackers are not expected to be honest. They are going to hijack Amazon accounts and use them for the computation. The only cost for these attackers would then be an opportunity cost: would breaking the DH key be worth more than the Bitcoins they could get with the same hijacked computing power?
Posted May 23, 2015 14:18 UTC (Sat)
by ncm (guest, #165)
[Link] (1 responses)
We read of botnets being taken over and "shut down" by law enforcement, but without any independent verification. They could as easily have been repurposed for spooks' occasional convenience.
Posted May 24, 2015 20:38 UTC (Sun)
by robbe (guest, #16131)
[Link]
If the authors would have written "within reach of medium to large criminal organisations" I wouldn't have batted an eye. You can also replace "criminal" with "operating outside the law" if you want to include rather than imply spooks.
Posted May 27, 2015 0:38 UTC (Wed)
by ras (subscriber, #33059)
[Link]
Of course not. They are like kids.
No matter how often you tell them if they play with matches they have to be burnt several times before the lesson it learnt. And when after many teary lessons you start to relax because the job is done, along comes the next generation. It never ends.
As I get older, I find I have less and less the patience for it. Fortunately mothers do, otherwise our species would be here today. Unfortunately, most mothers don't understand the importance of good crypto. So there is a never-ending task of training the pollies. I don't have the patience for that either. Thank god for the EFF.
Another crypto downgrade attack: Logjam
Another crypto downgrade attack: Logjam
Postfix?
Another crypto downgrade attack: Logjam
And what about SSH?
And what about SSH?
And what about SSH?
And what about SSH?
And what about SSH?
And what about SSH?
Red Hat's Logjam Knowledgebase article
Red Hat's Logjam Knowledgebase article
Another crypto downgrade attack: Logjam
* Test the results and some great articles: https://www.ssllabs.com/ssltest/
* Mozilla's conf generator: https://mozilla.github.io/server-side-tls/ssl-config-gene...
* For those that have to play with something odd: https://www.nartac.com/Products/IISCrypto/
Jon
Another crypto downgrade attack: Logjam
Another crypto downgrade attack: Logjam
> would require around 36,000 core-years, which is "within
> reach by computing power available to academics"
Another crypto downgrade attack: Logjam
Another crypto downgrade attack: Logjam
Another crypto downgrade attack: Logjam
Another crypto downgrade attack: Logjam
Children