Live data from Hacker News

Hertzbleed Attack

hertzbleed.com

131–140 of 406 posts

Re: Hertzbleed Attack

#131

Earlier quoted context omitted.

Essentially, a computational time salt.

There are a dozen names for it. In the intelligence world, if you know that the enemy is listening on an unencrypted communications pipe, but you cannot afford to stop using that pipe, you throw random junk down the pipe until they cannot tell real from fake.

Excellent point.

In this case, the name used here is masking, referring to what is called data masking, and the reference was to adding noise. There are other operations(as you point out) that could also be used (substitution, shuffling, etc.).

Re: Hertzbleed Attack

#132

Why do we never get proactive defense against this sort of thing? As with speculative execution, caching, out-of-order execution, dispatching instructions to multiple ALUs depending on availability, etc, it was clear from the get-go that in principle the timing can depend on the payload so in principle it can be a problem for crypto. The need for constant time should have first class support on the language/compiler…

Until consumers demand this as a requirement, it won't happen. Almost everyone would rather have a compiler/language/OS/ISA/CPU that's finishes faster some of the time, rather than one that finishes at the same time all the time. It would just appear (especially in benchmarks) to be slower for no apparent benefit. Maybe we can introduce a new set of instructions that are guaranteed to be constant time, but good luck…

And for this particular attack, constant time isn't even enough! You would need either constant power, or limit the frequency when running secure code (which again reduces performance).

Re: Hertzbleed Attack

#133
post #68

Ok, I See how this works in theory. But until I see an exploit that uses this method in real life to extract keys (or maybe any memory content) from a server running real life workloads, I am extremely skeptical. How much samples are needed to get anything useful? And wouldn't the time required to acquire these samples be longer than the time required to detect the attack (or even all keys to be shifted)?

> How much samples are needed to get anything useful?

There is proof-of-concept code for reproducing. I don't think sample count is a big concern.

That said, I believe the real caveat lies in the "workload must run for long enough to trigger frequency scaling" part. Usual crypto primitives are just too fast on our processors, which is likely why they picked SIKE to demo the attack.

Re: Hertzbleed Attack

#134
post #125

Earlier quoted context omitted.

You'd just need to put the script on any webpage the user might access and leave open, such as Google, or Facebook, or whatever. The attack isn't specific to JavaScript, so really you could put this in a desktop app too, think Slack, Spotify, etc. Any app or website that you know the target user is likely to open. CDNs are also a great target. We evaluated on 100 websites as a proof of concept, but we also included e…

I’m a little confused about your attack vector - how feasible would you reckon it is to place such a malicious script on the largest public websites in existence, versus just getting the victim to install a Trojan? The latter could just literally monitor the user. I’m not saying your paper is technically wrong, just practically infeasible. Right now, you’ve chosen very specific websites. Have you explored if there is…

I don't think any of these side channels are really easy to pull off without the technical capabilities of a nation state or something similar. I personally think embedding a malicious script in a CDN (e.g. https://blog.ryotak.me/post/cdnjs-remote-code-execution-en/) that serves a script for a large website, or something similar (https://blog.igorescobar.com/2016/08/21/ive-the-chance-to-tr...), is more realistic than getting the victim to install your program -- I would imagine sensitive individuals are very concerned about installing arbitrary software.

We did get a comment about this in our rebuttal but didn't end up including it in our final paper -- we found that we distinguished sites with the same frameworks (such as react, angular, and jquery) at the same accuracy at sites that used different frameworks.

We didn't do much research into content/non-homepage paths but it's a good area for future research. I would suspect it'll still do pretty well.

And yes, we concluded that the source came from interrupts (in Table 3 of our paper you can see we ran an experiment with frequency scaling turned off), which does make me question the practicality of hertzbleed. I wouldn't doubt it can be exploited somehow though.

Re: Hertzbleed Attack

#135

So I take it when they say "constant time" for things like SIKE, they aren't sleeping for X milliseconds, but are just using some operation that is thought to be effectively constant time, hence this vulnerability? What is the countermeasure for this? Are crypto systems that always wait a full second using system timers, for example, immune to this sort of thing, or is it still detectable even in those circumstances?

>Are crypto systems that always wait a full second using system timers, for example, immune to this sort of thing

No. Such a crypto system would still leak information via the amount of power it consumes, which might change the frequency of the cpu, which could be measured by an attacker through the other processes of the computer.

Re: Hertzbleed Attack

#136

Why do we never get proactive defense against this sort of thing? As with speculative execution, caching, out-of-order execution, dispatching instructions to multiple ALUs depending on availability, etc, it was clear from the get-go that in principle the timing can depend on the payload so in principle it can be a problem for crypto. The need for constant time should have first class support on the language/compiler…

> Why do we never get proactive defense ... The need for constant time should have...

We got proactive constant time on a lot of cryptographic operations.

The problem is, it's not constant power.. and DFS provides a window by which you can make remote power measurements.

Re: Hertzbleed Attack

#137
post #66

Earlier quoted context omitted.

There's so much variation (read, noise) intrinsic to response times for network requests to be satisfied on most cloud hosts anyway that I'm very skeptical about any practical attacks being made in the short term.

For one request, yes. For statistical analysis of many requests, no. People keep extracting secrets from very noisy and weak signals.

In lab conditions, yes. In this case:

"Our attack is practical; an unoptimized version recovers the full key from a CIRCL server in 36 hours and from a PQCrypto-SIDH server in 89 hours ... The target server and the attacker are both connected to the same network, and we measure an average round-trip time of 688 µs between the two machines."

Note that:

• The server in this case does absolutely nothing except use the cryptographic library. Would it work on a real server that actually does something useful with the requests? We don't know, the paper doesn't try that.

• We aren't told if it works if other people are using the server simultaneously.

• They show the attack against obscure post-quantum algorithms nobody actually uses (as far as I know). Why not RSA or ECDSA or something more standard? Presumably they don't have a technique that works on those, as otherwise it'd have been a big upgrade to their paper.

• What about if you aren't running your attack physically right next to your target? Is I'm not hugely surprised Intel has limited themselves to issuing guidance. This paper continues a trend that's emerged since the first Meltdown/Spectre breaks in 2018 in which attacks become ever more convoluted, theoretical and unlikely to work outside of a lab yet they're all presented as equally important by the academics who develop them. I used to follow this area of research quite closely but eventually got sick of it. Way too many papers had some bizarre caveat buried deep in the paper, e.g. eventually I noticed that a lot of attacks on Intel SGX that claimed to leak cryptographic keys turned out to be using an extremely specific version of GnuTLS. I got curious why that might be and discovered that it was absolutely ancient, dating from many years before the papers were written. They were using it because that version had no hardening against side channel attacks of any kind whatsoever. Was that a realistic assumption to make for these attack papers? Probably not, but to notice this sort of trick you had to read well beyond the headlines.

I also remember some years ago, Google researchers got worried people weren't taking Spectre seriously enough, so they released a demo that claimed it would show a Spectre attack in action inside the browser. I was keen to see this because so many posited attacks seemed to rely on extremely specific situatons that didn't seem particularly plausible in the real world. I visited it in Chrome on macOS, i.e. one of the most predictable hardware and software environments the developers could have, and it didn't work. Checked reddit, it was filling up with people saying it didn't work for them either.

In the ~5 years since these attacks came out and started being patched in software and hardware, have there been any real world attackers found using them? Maybe but I don't remember hearing about any. State sponsored attackers seem to be sticking with more conventional techniques, which probably says a lot.

Re: Hertzbleed Attack

#138

I don't get it. Is this only a problem for platforms that can read the current CPU frequency? Does this mean platforms such as JavaScript in the browser are unable to exploit this? Ditto for WebAssembly? If you don't give it the CPU frequency and don't give it the ability to make a syscall for it, then its unaffected? Is the longer term fix then to make reading of any compute metrics a privileged operation?

The attackers do not read the CPU frequency, they estimate it based on the latency of the replies to their queries.

The attack works only for certain combinations of CPUs and cryptographic algorithms that contain a mixture of instructions that cause a CPU to lower its clock frequency, with instructions that allow the CPU to raise its clock frequency.

For such combinations, algorithms that are supposed to be executed in constant time are actually executed in a variable time, creating a side-channel.

As a response to Hertzbleed, Intel has published a guide for those who write cryptographic libraries, about how to mitigate this vulnerability:

https://www.intel.com/content/www/us/en/developer/articles/t...

The main problem that creates this vulnerabilty is that the CPU vendors publish very little information about their turbo algorithms, so, unless you make your own measurements, it is very difficult for a software writer to predict at which clock frequency will be executed a certain segment of a program, and what should be done to avoid changes in the clock frequency.

Re: Hertzbleed Attack

#139
Would it help to slighty reduce the granularity of the frequency adjustment? Just enough to make the analysis infeasible? It doesn't have to be all or nothing. We had a similar issue with browsers restricting access to high-precision timers in JavaScript.

Re: Hertzbleed Attack

#140
post #116
post #68

Ok, I See how this works in theory. But until I see an exploit that uses this method in real life to extract keys (or maybe any memory content) from a server running real life workloads, I am extremely skeptical. How much samples are needed to get anything useful? And wouldn't the time required to acquire these samples be longer than the time required to detect the attack (or even all keys to be shifted)?

> time required to detect the attack Personally I haven't seen much of this done in the real world.

Not trying to be disrespectful and it is true curiosity, what is your role to have to deal with this type of attacks (as much as can be disclosed) and could you please quantify “much”?
Post reply on HN