Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MacRumors

macrumors bot
Original poster
Apr 12, 2001
63,558
30,889


An unpatchable vulnerability has been discovered in Apple's M-series chips that allows attackers to extract secret encryption keys from Macs under certain conditions, according to a newly published academic research paper (via ArsTechnica).

m1-vs-m2-air-feature-toned-down.jpg

Named "GoFetch," the type of cyber attack described involves Data Memory-Dependent Prefetchers (DMPs), which try to predict what data the computer will need next and retrieve it in advance. This is meant to make processing faster, but it can unintentionally reveal information about what the computer is doing.

The paper finds that DMPs, especially the ones in Apple's processors, pose a significant threat to the security provided by constant-time programming models, which are used to write programs so that they take the same amount of time to run, no matter what data they're dealing with.

The constant-time programming model is meant to protect against side-channel attacks, or types of attacks where someone can gain sensitive information from a computer system without directly accessing it (by observing certain patterns, for example). The idea is that if all operations take the same amount of time, there's less for an attacker to observe and exploit.

However, the paper finds that DMPs, particularly in Apple silicon, can leak information even if the program is designed not to reveal any patterns in how it accesses memory. The new research finds that the DMPs can sometimes confuse memory content, which causes it to treat the data as an address to perform memory access, which goes against the constant-time model.

The authors present GoFetch as a new type of attack that can exploit this vulnerability in DMPs to extract encryption keys from secure software. The attack works against some popular encryption algorithms that are thought to be resistant to side-channel attacks, including both traditional (e.g. OpenSSL Diffie-Hellman Key Exchange, Go RSA decryption) and post-quantum (e.g. CRYSTALS-Kyber and CRYSTALS-Dilithium) cryptographic methods.

In an email to ArsTechnica, the authors explained:
Prefetchers usually look at addresses of accessed data (ignoring values of accessed data) and try to guess future addresses that might be useful. The DMP is different in this sense as in addition to addresses it also uses the data values in order to make predictions (predict addresses to go to and prefetch). In particular, if a data value "looks like" a pointer, it will be treated as an "address" (where in fact it's actually not!) and the data from this "address" will be brought to the cache. The arrival of this address into the cache is visible, leaking over cache side channels.

Our attack exploits this fact. We cannot leak encryption keys directly, but what we can do is manipulate intermediate data inside the encryption algorithm to look like a pointer via a chosen input attack. The DMP then sees that the data value "looks like" an address, and brings the data from this "address" into the cache, which leaks the "address." We don't care about the data value being prefetched, but the fact that the intermediate data looked like an address is visible via a cache channel and is sufficient to reveal the secret key over time.
In summary, the paper shows that the DMP feature in Apple silicon CPUs could be used to bypass security measures in cryptography software that were thought to protect against such leaks, potentially allowing attackers to access sensitive information, such as a 2048-bit RSA key, in some cases in less than an hour.

According to the authors, the flaw in Apple's chips cannot be patched directly. Instead, the attack vector can only be reduced by building defenses into third-party cryptographic software that could result in an extreme performance degradation when executing the cryptographic operations, particularly on the earlier M1 and M2 chips. The DMP on the M3, Apple's latest chip, has a special bit that developers can invoke to disable it, but the researchers aren't yet sure what kind of penalty will occur when this performance optimization is turned off.

As ArsTechnica notes, this isn't the first time researchers have identified threats in Apple DMPs. Research documented in 2022 discovered one such threat in both the M1 and Apple's A14 Bionic chip for iPhones, which resulted in the "Augury" attack. However, this attack was ultimately unable to extract the sensitive data when constant-time practices were used.
"GoFetch shows that the DMP is significantly more aggressive than previously thought and thus poses a much greater security risk," the researchers claim on their website. "Specifically, we find that any value loaded from memory is a candidate for being dereferenced (literally!). This allows us to sidestep many of Augury's limitations and demonstrate end-to-end attacks on real constant-time code."
DMP-style attacks are not common, and the researchers informed Apple of the vulnerability in December 2023. Users concerned about the vulnerability are advised to check for GoFetch mitigation updates that become available in future macOS updates for any of the encryption protocols known to be vulnerable. Apple representatives declined to comment on the record when ArsTechnica asked about the paper.

Article Link: Apple Silicon Vulnerability Allows Hackers to Extract Encryption Keys
 
Last edited:

vegetassj4

macrumors 68000
Oct 16, 2014
1,681
9,171
"...and post-quantum (e.g. CRYSTALS-Kyber and CRYSTALS-Dilithium) cryptographic methods."

--------


Kirk vs Luke, who would win? or would they both toast the hot green chick, and have a shot of Bacta and Romulan Ale?

oooh...or maybe Evil Alternate Dimension Kirk vs Darth Vader? The possibilities are endless.

Crave42.jpg
vx260.jpg
 
Last edited:

phenste

macrumors 6502a
Sep 16, 2012
646
1,783
hmm…sounds like a pretty major yikes for Apple Silicon. we’ll have to see how this pans out in the long run, especially if I’m reading this article properly (halfway through my morning coffee) and the issue can’t exactly be patched…

looking forward to M4! 🤠
 

danieldk

macrumors member
Aug 28, 2009
48
301
This kind of vulnerability is bad - future hardware revisions should solve it and mitigations should be put into place. However, glossing over the paper, this currently does not seem like a big threat to most users:

Emulating realistic attack scenarios, we assume that ct-swap runs in a victim process, separate from the attacker’s address space. We assume a simple but common protocol between victim and attacker, where the victim takes input from the attacker to populate the ct-swap’s a and b arrays and then executes ct-swap.

So, it assumes that not only has the attacker has a process running on a victim's machine, but that it can also feed input directly to the victim process. However, if a malicious actor already has a local process running with user privileges, there are so many possible attack vectors, that it's also often game over before this vulnerability. If you only install trusted software, you should be pretty safe.

What made Meltdown/Spectre so devastating on Intel CPUs is that they allowed snooping information without communication with the victim process and that e.g. Linux is used on many multi-tenant machines. So there is ample opportunity to eavesdrop on other people's machines.

It's a bit sad that Ars did not qualify the research further, because if you read the headline and article, it's as if the sky is falling on Apple Silicon CPUs. But (not surprisingly) it's not.
 

hacky

Suspended
Jul 14, 2022
642
2,207
Genuine question. Does this “exploit“ actually have an effect on users? Or this for specific individuals?
Yes it does. Literally any private key to the encrypted data can be extracted with this method.


This is an theoretical risk only for 99% of users. It would be like hackers winning the lottery in order to make use of the exploit.
This is not true. The exploit is very real and usable. It affects every Apple Silicon user. Please don't spread lies.
 

seek3r

macrumors 68020
Aug 16, 2010
2,248
3,203
Wonder how long Apple has known about this? I think we can safely assume based on past experience that Apple did nothing, hoping the public would never know.
Given that there seems to be possible mitigations in the M3s I dont think that’s accurate, it’s not like they can fix already deployed silicon, but they added some ways of turning off affected functions in newer chips. We’ll see some os level mitigations for this on M1 and M2 I’m sure, though it may cause performance hits

I do wonder if this will mean they sunset M1s and M2s earlier than we might expect though

And look, it’s not all that uncommon for side channel attacks to crop up in CPUs, I dont see any malice or even really incompetence here, this stuff is hard and accounting for every failure scenario that can lead to an exploit is nearly impossible
 

danieldk

macrumors member
Aug 28, 2009
48
301
Wonder how long Apple has known about this? I think we can safely assume based on past experience that Apple did nothing, hoping the public would never know.

Sorry, this does not make much sense at all. What past experience? Apple actively patches many security vulnerabilities. This issue was reported to Apple on December 5 (according to the gofetch website), but it's nearly always the case that there is a non-disclosure period for vulnerabilities. This allows vendors to put mitigations in place for vulnerabilities. It's very likely that Apple already put some mitigations in 17.4.1 if they could (we don't know, because the security notes are not released yet, probably not until macOS 14.4.1 is also out).
 

Steve121178

macrumors 603
Apr 13, 2010
6,403
6,969
Bedfordshire, UK
That's actually pretty bad. I hoped Apple Silicon would escape HW exploits and here we go.

SW patches will harm the performance.
The performance of my old work Dell PC's were murdered with the firmware/software/BIOS updates to fix the Intel vulnerabilities. It was incredible how bad the performance drop was. It felt like at least 30% on older dual core chips (4th-6th gen).
 

Stenik

macrumors member
Apr 18, 2020
77
132
hmm…sounds like a pretty major yikes for Apple Silicon. we’ll have to see how this pans out in the long run, especially if I’m reading this article properly (halfway through my morning coffee) and the issue can’t exactly be patched…

looking forward to M4! 🤠
Apple might now decide to switch from Silicon to Intel processors :)
 

danieldk

macrumors member
Aug 28, 2009
48
301
From Macworld this morning:
[...]
DMP-based attacks aren’t common, and they require a hacker to have physical access to a Mac. So, the best way to prevent an attack is you secure your user account on your Mac with a strong password, and do not let people you don’t know use your Mac. For more information on Mac security, read “;How to know if your Mac has been hacked” and “How secure is your Mac?” Also consider running an antivirus program on your Mac.

By the way, MacWorld is incorrect here. It does not require physical access. A malicious actor needs to be able to run a process in your machine. This can also be accomplished by tricking the user to install malware, planting malware through vulnerabilities in programs that read untrusted data (web browser, iMessage, etc.).

If you don't install random software from the internet, you should be pretty safe.
 

neuropsychguy

macrumors 68020
Sep 29, 2008
2,387
5,692
Yes it does. Literally any private key to the encrypted data can be extracted with this method.



This is not true. The exploit is very real and usable. It affects every Apple Silicon user. Please don't spread lies.
Attackers have to: 1. have physical access to the machines and either your account password or an account on the computer to exploit this or 2. otherwise get access to the computer. It looks like it could be done via installed software, although that potential method of attack needs to be confirmed as viable in the “real world”.

Given these constraints, this is going to be an issue for how many people? I’m not minimizing the risk. I’m merely indicating that security vulnerabilities “affect” everyone but only have negative effects on a minority of users. In those cases they can be devastating, but catastrophizing about this is not warranted. Apple will figure out a way to address it.
 
Last edited:

hacky

Suspended
Jul 14, 2022
642
2,207
From Macworld this morning:

How to protect yourself from GoFetch​

DMP vulnerabilities aren’t new–in 2022, university researchers revealed Augury, the initial introduction to the DMP exploit that, at the time, wasn’t a serious risk. However it appears that with GoFetch, Apple has yet to address the issue, possibly due to the performance issues.

DMP-based attacks aren’t common, and they require a hacker to have physical access to a Mac. So, the best way to prevent an attack is you secure your user account on your Mac with a strong password, and do not let people you don’t know use your Mac. For more information on Mac security, read “;How to know if your Mac has been hacked” and “How secure is your Mac?” Also consider running an antivirus program on your Mac.
This is not completely true.

It does not require physical access to a Mac. This attack can be executed just with remote access.

Check the details here: https://gofetch.fail/
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.