top | item 28250340

macOS 11’s hidden security improvements

235 points| ingve | 4 years ago |blog.malwarebytes.com | reply

145 comments

order
[+] bangonkeyboard|4 years ago|reply
Very hidden. The 11.5.2 patch from last week had no release notes (https://eclecticlight.co/2021/08/15/last-week-on-my-mac-trus...), and Apple replied to inquiries with "No further details on the Big Sur 11.5.2 update will be released" (https://twitter.com/ClassicII_MrMac/status/14256327792624312...).
[+] tgsovlerkhgsel|4 years ago|reply
IIRC it didn't just have no release notes, it explicitly claimed not to contain security patches.

Although I may be misremembering or may have been misled by an ambiguous message. https://support.apple.com/en-us/HT201222 lists it as being a security update but "This update has no published CVE entries." (emphasis mine) implying some nasty but embargoed security issue.

[+] peakaboo|4 years ago|reply
Both Microsoft and Apple are treating users like they don't care now. And probably 99.99999% of the users don't.

Today you have to run Linux to control your computer yourself.

[+] busymom0|4 years ago|reply
I am an iOS and MacOS developer and have gotten my updates rejected for my release notes not being descriptive enough of what it changes. Yet Apple regularly gives exceptions to the big guys like Facebook, Uber etc apps and now themselves. Apple’s developer guidelines specifically warn developers to not put vague release notes but the rules often get partially applied.
[+] kccqzy|4 years ago|reply
Interesting tidbit about Chrome using POSIX_SPAWN_NP_CSM_ALL now. But I would point out that according to the open-source Chromium code base, these CPU security mitigation APIs offer process-wide protection rather than thread-based protection (commit message at https://source.chromium.org/chromium/chromium/src/+/46e23c81... )

Some more digging shows that Chrome started using a weaker version of CSM, TCSM (thread CSM I assume) two years ago in NaCl: https://source.chromium.org/chromium/_/chromium/native_clien...

Firefox of course uses TCSM too: https://hg.mozilla.org/mozilla-central/rev/cd1ccb74af7c And so does Safari: https://trac.webkit.org/changeset/244233/webkit

I hope this at least somewhat assuages the fears of people who prefer Firefox or Safari over Chrome.

[+] user3939382|4 years ago|reply
The security improvement I want is that when I run ‘ps ax’ on a fresh install, I have reduced attack surface instead of dozens of random daemons hardwired into launchd like the one for classrooms(??), iCloud and photo sharing even when those features are disabled, etc.
[+] musicale|4 years ago|reply
This is a big issue - on Windows you can set services to not start up unless they are needed, and you can turn them off so they don't run at all.

On macOS, the launchd configuration seems to be hard-wired and protected by SIP; there's no easy way to disable random daemons for features like remote student device management - something that most users would not need or want. And as you note even if you disable the associated feature (e.g. in Preferences) its daemon can still run.

It's always annoying when you're not doing anything but your laptop heats up and turns on the fans because some stupid daemon has woken up and decided to re-scan the same files (such as game updates) for the 100th time.

Not to mention photoanalysisd, which burns large amounts of CPU for days/weeks and runs even if you disable the intrusive and obnoxious holiday events/memories features in Photos.

[+] walterbell|4 years ago|reply
Can those daemons be deleted/renamed?
[+] uniqueuid|4 years ago|reply
I'd be interested to hear from someone with deep security knowledge:

Some people have dismissed OpenBSD's mitigations as overhyped (i.e. - things like W^X are not the main problem, linux has long caught up, etc).

But now we see Apple adding precisely some of these mitigations.

Where does this leave such architectural countermeasures? Are there real gains from investing in such low-level things? Are they irrelevant in an age where many laptops still have ports that give direct DMA access, users are not savvy and sandboxes incomplete?

[+] saagarjha|4 years ago|reply
W^X is a good mitigation to prevent attackers from just spraying shellcode into a RWX heap. This is how most JIT engines used to be attacked, and many exploits continue to include WebAssembly just because Chrome will create a RWX arena for this. Many of the OpenBSD mitigations are actually a good idea, but some are fanciful junk. The posture that the team has towards pushing those latter ones is what generally makes people unhappy.

Also, do note that Apple silicon puts everything behind a DART (essentially an IOMMU). This is noted in the article:

> Device isolation was another M1-only feature, that uses the more powerful IOMMU of that platform to make sure hardware devices can only share memory with the operating system and not with each other. Cross-device memory sharing is a historical custom, based on a blind, unfounded trust in hardware.

[+] comex|4 years ago|reply
Which mitigations exactly?

macOS has enforced W^X in most cases for many years.

As for the two mitigations mentioned in the article:

NO_SMT seems to be equivalent to Linux's "core scheduling" feature, which landed recently [1]. This approach, involving disabling SMT (aka hyperthreading) for specific processes, is different from OpenBSD's more brute-force approach of disabling SMT systemwide; there are pros and cons to both approaches.

As for the other one, forcing VERW to be executed on every return from the kernel, both Linux and OpenBSD chose the brute-force approach of doing this for all processes by default; both added this feature in 2019 as part of the coordinated disclosure of the MDS vulnerability class. Apple is instead doing it on a per-thread basis. Again, pros and cons.

[1] https://lwn.net/Articles/861251/

[+] fay59|4 years ago|reply
It’s clear that W^X isn’t “solving security”, but it’s not a bad idea just because it’s a low-hanging fruit. On Apple platforms, I think that it came to be as a natural consequence of the ability to toggle RX mappings to be RW without a syscall.

Almost all DMA-capable peripherals on Apple Silicon (including iDevices) are gated behind an IOMMU.

[+] comex|4 years ago|reply
Note that, although it was published recently, this article covers macOS 11 (Big Sur) which released last year, not macOS 12 (Monterey) which is in beta.
[+] saagarjha|4 years ago|reply
> I’ve not seen anybody mention the fact that the cryptographically sealed filesystem underlying SSV is internally code-named “Cryptex”.

Might as well mention it here: crytex is how you get code on the Security Research Device, rather than SSV.

[+] faster|4 years ago|reply
I was hoping the article would mention the recent "security improvement" that prevents daemons from using Bluetooth in Big Sur. I haven't seen anything from Apple (or anyone else) explaining how that improves security.
[+] sesuximo|4 years ago|reply
Kinda sad to think future generations of Mac users won’t be able to write self modifying assembly. I feel like that’s a fun learning experience
[+] masklinn|4 years ago|reply
That hasn't been a trivial option for a while, userland W^X (DEP) was implemented across the board >15 years ago.

TFA seems to be confused about what Apple did with the M1, macOS has had W^X enabled across the board (for userland) on all supported 64b architectures since 10.5 (10.4 only had stack W^X).

[+] no_time|4 years ago|reply
On the other hand it prevents companies from using BS like vmprotect.
[+] Toutouxc|4 years ago|reply
Couldn't you just use a VM for stuff like that?
[+] sillysaurusx|4 years ago|reply
> NO_SMT disables Simultaneous multithreading (SMT), the CPU feature better known under Intel’s trade name of “Hyper-Threading”. SMT allows a CPU core to execute two or more threads at the same time, for improved performance at the cost of contention for per-core resources, such as caches, TLBs etc.

> Letting multiple threads share invisible resources carries the risk of letting a malicious thread steal secrets from a “sibling” thread running on the same core—a risk that over the years has materialized into multiple attacks, like TLBleed, PortSmash, Fallout, ZombieLoad, RIDL. A straightforward mitigation for this entire family of attacks, past and future, is then to simply disable SMT, which is what NO_SMT does.

BAHAHA cperciva was right! It’s a decade later and people care now! Linus didn’t care at the time!

I’m on mobile otherwise I’d link to relevant refs, but it was an “I told you so” 10 years in the making. Maybe longer? When was cperciva’s cache stealing research?

[+] GekkePrutser|4 years ago|reply
Sounds good but a problem with Apple's latest releases are that a lot of its security features listen only to Apple and not to the user.

This doesn't concern most of the improvements mentioned in the article, those are purely technical improvements at a very low level. But the signed system volume for example (also mentioned), while a good idea, lacks a convenient way for the user to make changes to it. I'm not very happy leaving my security to a black box and just trusting the supplier implicitly. This is a supplier that introduced a "get root with blank password" bug and the "your password hint is your actual password" one. Sure, everyone makes mistakes, especially for that reason I'd want to have more access than they offer now.

macOS is becoming more and more like iOS, which is also way too closed in my opinion. More locks is always good but the user should have a key, not just the supplier.

[+] hdjjhhvvhga|4 years ago|reply
On the other hand, Linux is getting better and better. And with the prevalence of web apps, the main obstacle to running non (MS | Apple) systems is getting smaller. With Linux, you can adjust the level of security you need and you keep the key. Security improvements appear also in BSDs, especially OpenBSD, but honestly I wouldn't recommend people used to macOS to switch to OpenBSD (yet).
[+] azinman2|4 years ago|reply
You can always disable CSR/SIP generally. macOS is unlike iOS in that many security mitigations can be disabled. The fact that new M1 Macs let you side load a diff non-Apple in iOS should be the ultimate proof you need of this motivation to allow user control on Macs.
[+] nuker|4 years ago|reply
> signed system volume for example (also mentioned), while a good idea, lacks a convenient way for the user to make changes to it.

MacOS has no convenient way to know if changes are made by the user or malware. It is a feature, not a bug, for most users. Why would you need to change system volume anyway?

[+] goodpoint|4 years ago|reply
> its security features listen only to Apple and not to the user

That's the definition of backdoors.

[+] darwingr|4 years ago|reply
But can it ignore your firewall settings?
[+] azinman2|4 years ago|reply
My understanding is if you change firewall settings using PF let's you have total control, unlike network extensions.