News for hackers. Stuff that matters.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by pseudo0 on Thursday September 07, 2023 @04:43PM (#37425298)
Here we go again... NSO Group has a long history of 0-click, 0-days against iMessage, and just a few months ago Kaspersky caught a different zero day iMessage exploit targeting their staff.

If Apple repeatedly fails at securing their devices from an attack vector that has been demonstrated over, and over, and over... no wonder China is banning government officials from using their devices.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by goffer on Thursday September 07, 2023 @05:40PM (#37425985)
China not worried about 0-clicks on Apple. They are worried about US-Apple collusion with iOS software.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by davisr on Thursday September 07, 2023 @05:43PM (#37426022)
How on Earth do you not see how those are related?
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by lxgr on Thursday September 07, 2023 @06:54PM (#37426768)
Who needs zero-days if you control the entire software (client and server side) and hardware ecosystem?
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by internetter on Thursday September 07, 2023 @08:18PM (#37427574)
It's impossible to create a backdoor that can only be used by the intended party
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by alphabetting on Thursday September 07, 2023 @07:25PM (#37427070)
Funny because at the same time US govt is worried about China-Apple relationship
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by jbverschoor on Friday September 08, 2023 @04:40PM (#37439105)
I think they're more concerned that Apple is moving parts of manufacturing out of China.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by l33t7332273 on Thursday September 07, 2023 @04:56PM (#37425458)
>no wonder China is banning government officials from using their devices.

Do you actually think security is the reason they are being banned? I think the reasons are far more political than technical.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by pyinstallwoes on Thursday September 07, 2023 @05:19PM (#37425760)
Technology is political.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by CatWChainsaw on Thursday September 07, 2023 @05:30PM (#37425885)
Hard truth for people to hear, here. So many insist that all technology is neutral.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by pmontra on Thursday September 07, 2023 @06:00PM (#37426189)
To foster your point, I quote a comment from another post on HN now

> And the whole reason for the hydrogen burning [by SLS' engines] was to keep the space shuttle contractors jobs. Once again it's not a technical reason but a pork barrel one.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by bawolff on Thursday September 07, 2023 @07:52PM (#37427339)
All things are political and technology is a thing.

That doesn't mean you can't analyze if a specific technical decision was made primarily on technical grounds/merit or if it is mostly a political one without a technical basis.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by pbhjpbhj on Thursday September 07, 2023 @06:10PM (#37426302)
Same reason USA have forced Huawei to be banned around the place.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by m3kw9 on Thursday September 07, 2023 @06:17PM (#37426378)
Sometimes even if they wanted to ban purely for security reasons, it would be blocked because it could trigger political repercussions, or seen as a offensive move by the opposition country
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by postalrat on Thursday September 07, 2023 @07:01PM (#37426856)
I just assume the weaknesses were made to be exploited by the US and other governments.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by cheese_van on Thursday September 07, 2023 @07:29PM (#37427118)
>I think the reasons are far more political than technical.

You may be right but sometimes the local optics track better when a political reason is given and the local authorities might also expect better compliance with political reasoning. Similarly, "We are getting pwned," never tracks well. There are solid reasons, long ago, why China stopped using Nortel.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by walterbell on Thursday September 07, 2023 @07:38PM (#37427201)
> There are solid reasons, long ago, why China stopped using Nortel.

Such as?

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by pseudo0 on Thursday September 07, 2023 @07:47PM (#37427301)
The two issues are intertwined, and from their perspective the real risk is likely relying on a US company during a time when US/China relations are quite tense. But Apple repeatedly having 0-click 0-day iMessage exploits being used in the wild certainly doesn't help. At a minimum it's a very good justification for them to move to a domestic solution like Huawei and HarmonyOS.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by zshrc on Thursday September 07, 2023 @04:52PM (#37425405)
Please... Androids no better. At least Apple will have it patched within the year of discovery. Can't say the same for other Android vendors.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by Gigachad on Thursday September 07, 2023 @05:26PM (#37425837)
Android is moving away from C and towards more secure languages. From one of their recent blog posts, the majority of code written for android is now in memory safe languages.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by nielsbot on Thursday September 07, 2023 @05:38PM (#37425963)
Apple also has memory-safer languages it is moving to:

Swift: A memory-safer systems programming language: https://www.swift.org

Firebloom: A memory-safer C variant: https://support.apple.com/en-il/guide/security/sec30d8d9ec1/...

Not sure what the answer is for existing memory-unsafe code.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by ctz on Thursday September 07, 2023 @05:47PM (#37426060)
> Not sure what the answer is for existing memory-unsafe code.

It's an engineering approach that involves writing "A buffer overflow issue was addressed with improved memory handling" an awful lot. Hopefully one day they will finish improving the memory handling!

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by saagarjha on Thursday September 07, 2023 @08:00PM (#37427414)
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by berbec on Thursday September 07, 2023 @05:38PM (#37425955)
Is the programming language likely the issue here?
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by carstenhag on Thursday September 07, 2023 @05:51PM (#37426097)
Well, theoretically all can be secure (in regards to buffer overflows etc). Some just forbid to shoot you in the arm. And head.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by tialaramex on Thursday September 07, 2023 @06:13PM (#37426339)
Of course, it's not necessary to use a language where "Give control of your phone to remote attackers" is one of the possibilities at all.

General purpose languages, whether that's something like C or Rust or even Javascript are not the appropriate tool. Turing Completeness is a bad idea from a security point of view, not a wonderful feature.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by Gigachad on Thursday September 07, 2023 @06:22PM (#37426426)
Yes, almost all of these major exploits are memory safety related and would be mostly impossible in a memory safe language.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by btilly on Thursday September 07, 2023 @06:25PM (#37426463)
That's like asking whether it is the lack of a seatbelt that was the issue after sometime died in a car crash.

Well, of course the real issue was the car crash. But wearing a seatbelt would have sure helped!

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by tialaramex on Thursday September 07, 2023 @05:51PM (#37426099)
And for this problem specifically Android can use WUFFS. WUFFS is a special purpose language for Wrangling Untrusted File Formats Safetly. Trading away generality (the ability to write a program which say, sends email) gets them complete safety and excellent performance.

In Rust we can't trivially write a bounds miss by mistake. But in WUFFS we just can't write a bounds miss at all. Like, that's not a thing in WUFFS, it doesn't compile. You can write your own bounds checks and show WUFFS that works, or you can write code which clearly can't have a bounds miss with no checks, that works too. But you can't just "forget" or "screw up" those won't compile.

This would be frustrating in a general purpose language. WUFFS doesn't have a "Hello, World" program because it lacks both strings and the idea of outputing to the screen. But WUFFS isn't a general purpose language, however it's the correct way to write the code that takes image files we got from some dubious source and processes them.

When Apple announced they wanted to provide proper security for vulnerable iPhone users, this is what that would look like coming from a company which actually cared about security. What you got is what it looks like from a company which prioritised marketing.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by saagarjha on Thursday September 07, 2023 @08:02PM (#37427430)
Would any of your comment change if I told you the bug was in a Google image parser that they currently also ship to production?
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by teaearlgraycold on Thursday September 07, 2023 @06:02PM (#37426208)
Google at large is slowly banning use of non memory safe languages. Android in particular is doing well at adopting Rust.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by teawrecks on Thursday September 07, 2023 @05:41PM (#37426000)
Interesting how your response makes it seem like the person you're responding to mentioned android at all.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by acdha on Thursday September 07, 2023 @05:45PM (#37426041)
I think it’s safe to assume that most people know that’s the only other common choice.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by kernal on Thursday September 07, 2023 @05:54PM (#37426126)
>Please... Androids no better.

The Pixel is.

>At least Apple will have it patched within the year of discovery. Can't say the same for other Android vendors.

And the Pixel would have the patch released quicker.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by chaxor on Thursday September 07, 2023 @06:49PM (#37426722)
The pixel is decent if using graphene is. Not sure if any system is good by default. Apple fans think their defaults are somehow more private or secure, mostly due to marketing.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by kernal on Thursday September 07, 2023 @08:33PM (#37427706)
Decent? From a security perspective it's superior to the iPhone. As for Graphene, unless you've personally vetted the code I don't see how it can be trusted. And I won't even go into the drama that OS comes with.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by paravirtualized on Thursday September 07, 2023 @09:44PM (#37428242)
> unless you've personally vetted the code I don't see how it can be trusted.

As opposed to proprietary Google code that cannot be vetted?

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by kernal on Saturday September 09, 2023 @06:39PM (#37451019)
What about the proprietary binary blobs that Graphene is reliant on? Who vetted those?
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by paravirtualized on Friday September 15, 2023 @04:52AM (#37520248)
I think that we both can agree that less = better, so I don't see your point.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by imchillyb on Thursday September 07, 2023 @10:44PM (#37428601)
Pixel is not an OS, is not Android. Pixel is a series of hardware that make up less than five percent of the android hardware market.

One device series does not offer a glimpse of the market.

Op’s point stands.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by kernal on Saturday September 09, 2023 @06:47PM (#37451070)
>Pixel is not an OS

Then what do you call the custom OS that ships on the Pixel? Of course it's a custom built OS that's designed to work with the custom hardware on the Pixel.

>One device series does not offer a glimpse of the market.

Security is defined by the marriage of software and hardware. The reason the Pixel is so secure is because of this. The OP made a blanket statement which did not apply to the Android ecosystem.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by ok123456 on Thursday September 07, 2023 @05:58PM (#37426169)
On Android you can disable automatic link preview and downloading of MMS messages. You can also swap out the application that handles text messages entirely.

This eliminates this whole class of attack.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by ajross on Thursday September 07, 2023 @07:17PM (#37426996)
Also the application that handles text message is itself sandboxed and limited to a fixed set of permissions (to be fair, that include messaging other humans, so an exploit would still be very bad, just not "remote root" bad).

That's the part that is still unclear with this BLASTPASS business. Surely iOS isn't running the messaging app as a device root, right? There's some other presumably-unpatched privilege elevation attack going on?

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by saagarjha on Thursday September 07, 2023 @08:02PM (#37427438)
Yes. The ImageIO vulnerability just allows for an initial foothold.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by ChrisMarshallNY on Thursday September 07, 2023 @06:29PM (#37426503)
I have friends with Android phones that are running 5-year-old operating systems.

I have one friend that absolutely refuses to update his 7-year-old Samsung.

I got the fix on my phones (including my 8), iPads and Watch, today.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by indymike on Thursday September 07, 2023 @07:27PM (#37427099)
> Androids no better.

That does not make the situation right for Apple.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by fomine3 on Thursday September 07, 2023 @08:12PM (#37427523)
You can just avoid crappy Android vendors. 1 year is low bar.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by npteljes on Thursday September 07, 2023 @05:25PM (#37425822)
>no wonder China is banning government officials from using their devices

A totalitarian regime can have a different, plausible reason: no sufficient control over said devices.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by Obscurity4340 on Friday September 08, 2023 @07:05PM (#37440381)
iPhones can be provisioned with pretty extensive profiles/MDM so I doubt that part. They probably see all the zero-days and decide game respects game. Just not secure enough for such an incredibly insular power structure as theirs, even without the US connections.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by npteljes on Saturday September 09, 2023 @04:46AM (#37443414)
>decide game respects game

Elaborating on this, the US banning Huawei doesn't help either.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by Obscurity4340 on Saturday September 09, 2023 @12:07PM (#37446949)
I don't get why they wouldn't already insist on Huwawei and HarmonyOS unless this is more of an Inner Party issue where all the high-ups use iPhone intentionally because its more private than Huawei

I wonder what phone Z has been using all this time...

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by kylemh on Thursday September 07, 2023 @04:51PM (#37425394)
sure, that's why China is banning gov't officials from using their devices...
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by NegativeK on Thursday September 07, 2023 @05:03PM (#37425563)
If you show me software that's immune to advanced 0-days, I'll show you software that isn't usable.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by ketralnis on Thursday September 07, 2023 @05:13PM (#37425670)
That's needlessly defeatist and "it's so bad out there there's no point in trying" is a thought terminating cliché.

We can and should improve development practises, mitigate vulnerabities (ASLR, WAFs, etc), isolate systems from each other, and model threats in a way that we know where and how to do those things. It's not easy but just moaning "everything sucks" isn't how to fix it.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by otterley on Thursday September 07, 2023 @05:22PM (#37425778)
Apple, Google, etc. have whole teams of talented people dedicated to doing exactly these types of things, and they undoubtedly help prevent many vulnerabilities from escaping the labs. Yet vulnerabilities are still created and exploited despite their best efforts. As long as software is created by imperfect humans, it will reflect the imperfections of its creators.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by mensetmanusman on Thursday September 07, 2023 @06:31PM (#37426526)
Not only humans, the math says it’s not knowable whether any open ended hardware/software is inherently safe.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by sudosysgen on Thursday September 07, 2023 @07:01PM (#37426859)
It's not knowable for any, but it is knowable for some. You just have to build systems that are in the some and are inherently safe. Difficult, not impossible.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by PradeetPatel on Thursday September 07, 2023 @07:13PM (#37426962)
Difficult often implies additional resourcing and development related costs.

Something that many companies are not willing to invest in since it will have a negative impact on the shareholder values.

Often risks are accepted, and cybersecurity insurance is used to mitigate those risks.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by sudosysgen on Thursday September 07, 2023 @08:20PM (#37427592)
I agree, I just wanted to clarify that isn't mathematically impossible to make provably secure systems. It's just hard enough that it's not often done.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by 2OEH8eoCRo0 on Thursday September 07, 2023 @08:08PM (#37427490)
This is my take as well. If Apple and Google can't do it then what hope does anyone else have? The current paradigm is insecure and broken.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by kaba0 on Thursday September 07, 2023 @05:28PM (#37425862)
As sibling commenter wrote: they do exactly that. But the same way we fail to see all the cases prevented by vaccines, you only see when their work fail to work in the rare case.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by hot_gril on Thursday September 07, 2023 @05:19PM (#37425747)
Or just slow. If you don't care about optimization and run things in really inefficient sandboxes, security becomes a lot easier.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by Dylan16807 on Thursday September 07, 2023 @07:25PM (#37427071)
How fast does iMessage image decoding need to be?

And I mean this extremely rhetorically. The software launched along with the iPhone 4S. Going by geekbench, that CPU was 20-30 times weaker than a modern iPhone on a per-core basis.

I know the screens on the new phones are 5x bigger, but there is plenty of room for that sandbox.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by hot_gril on Thursday September 07, 2023 @07:26PM (#37427089)
I'm guessing it's a shared systemwide decoder that happens to be exploitable in Message, but idk.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by saagarjha on Thursday September 07, 2023 @08:08PM (#37427488)
That's correct, it's the WebP parser.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by tester756 on Thursday September 07, 2023 @06:07PM (#37426268)
It's hard to give examples because "advanced 0-days" may mean everything

but somehow our society still moved everything to digital world and hasn't collapsed yet

meanwhile there are definitely shitton of highly motivated people trying to break systems

so, it is somehow possible to writer *safer* systems

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by irundebian on Thursday September 07, 2023 @06:14PM (#37426348)
Software written in Ada/SPARK.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by postalrat on Thursday September 07, 2023 @07:03PM (#37426871)
How can a 0-day exist if its not possible for that software?
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by Dylan16807 on Thursday September 07, 2023 @07:11PM (#37426945)
That depends entirely on what the software needs to do.

For image decoding in particular, you can put the software into an exceptionally restrictive sandbox, or use a language that builds in the same restrictions.

No I/O. No system calls. Just churn internally and fill a preallocated section of memory with RGBA.

The broader system will still have weaknesses, but it won't have this kind, and this kind keeps happening.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by vilunov on Thursday September 07, 2023 @07:56PM (#37427367)
What exactly is "an exceptionally restrictive sandbox"?

There are virtual machines such as JVM, V8, or even QEMU. These are sandboxes, which run either some special bytecode or native code with extreme performance drawbacks. Media decoders are performance- and energy-sensitive pieces of software in the end.

And media decoders actually ARE sandboxes of sorts. They are designed to interpret media formats, sometimes even Turing-complete bytecode in retrictive and isolated environments. And like any sandboxes, they too have bugs.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by Dylan16807 on Thursday September 07, 2023 @09:00PM (#37427910)
> JVM, V8, or even QEMU

> extreme performance drawbacks

That's just not true.

> And media decoders actually ARE sandboxes of sorts. They are designed to interpret media formats, sometimes even Turing-complete bytecode in retrictive and isolated environments. And like any sandboxes, they too have bugs.

It's pretty easy to sandbox a simple bytecode, but that's not the bulk of what a media decoder is doing. A plain old decoder is mostly not sandboxing what it does.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by saagarjha on Thursday September 07, 2023 @08:08PM (#37427484)
That's an awfully big preallocated array you have there. It would be pretty inefficient for that section of memory to be copied around, right? Let's map it into both processes. Also, image decoding is pretty hard, let's offload some of it to dedicated hardware. Of course, that hardware needs to have access to it mediated by the kernel. And the hardware needs to be able to access that shared memory, which was of course allocated correctly and the IOMMU setup was done correctly…

You see how even simple things are difficult to secure when they have to be implemented in practice?

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by Dylan16807 on Thursday September 07, 2023 @08:51PM (#37427842)
Mapping pure RGBA across processes is safe, but also a single extra copy is not a big performance impact in the first place for an image decoder.

Configuring the IOMMU is one of the easiest parts of doing it in hardware. That's not going to make things "difficult to secure". And allocating the chunk of memory is trivial.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by saagarjha on Friday September 08, 2023 @02:59AM (#37430400)
I think disagree with every single point you brought up, having seeing exploits that involve all of them.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by Dylan16807 on Friday September 08, 2023 @03:14AM (#37430512)
If you've seen an exploit caused by a big pre-allocated array of untrusted RGBA data, please explain how.

(If you mean they put evil data through it and then used a separate exploit to run it, that's not a vulnerability, that's just "data transfer exists".)

And you seeing someone screw up an IOMMU doesn't disqualify it from being one of the easiest parts of a hardware decoder.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by saagarjha on Friday September 08, 2023 @01:28PM (#37436624)
Code to calculate size of preallocated array is incorrect. Size ends up too small or underflows.

Buffer is reused across calls. Buffer is actually mapped across processes and thus page-aligned. Code to check how much space is needed checks number of pages versus actual number of bytes, and fails to clear leftover data correctly.

Code receives RGBA buffer but expects some other encoding. Accidentally reads out of bounds as a result.

You can definitely say “oh these are stupid and I wouldn’t screw this up” but people do and that’s what really matters.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by Dylan16807 on Friday September 08, 2023 @01:39PM (#37436787)
> Code to calculate size of preallocated array is incorrect. Size ends up too small or underflows.

If you go outside the array you copied/mapped out of the sandbox, then that doesn't let the attacker code escape the sandbox, you just put some of your own data onto the screen.

If you mean the sandbox isn't given enough memory, then that will make the sandbox exit when it hits unmapped addresses.

And how did you screw up length x width x 4?

> Buffer is reused across calls. Buffer is actually mapped across processes and thus page-aligned. Code to check how much space is needed checks number of pages versus actual number of bytes, and fails to clear leftover data correctly.

The sandboxed process doesn't have any way to exfiltrate data. At most it can display it back to you, which is not really any worse than innocent code which could also send back the leftover data.

> Code receives RGBA buffer but expects some other encoding. Accidentally reads out of bounds as a result.

Reads out of bounds and does what with it? That doesn't sound like a vulnerability to me. It might crash, but that will be the same between innocent code in the sandbox and malicious code in the sandbox.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by Hackbraten on Friday September 08, 2023 @02:20PM (#37437332)
> And how did you screw up length x width x 4?

There’s a million ways to screw that up. People botch SCM merges. People are hungover. People are distracted. People are tired. People are heartbroken. People are going through divorces. People have parents dying. People forget numbers. People make copy-paste mistakes. All the time.

> The sandboxed process doesn't have any way to exfiltrate data.

You can abuse it to gain a (known-page-offset) write primitive in the other, non-sandboxed process to which the buffer is also mapped.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by Dylan16807 on Friday September 08, 2023 @06:22PM (#37440064)
> People make copy-paste mistakes. All the time.

But if you do that every image looks wrong and it's vanishingly unlikely to get into a release.

> You can abuse it to gain a (known-page-offset) write primitive in the other, non-sandboxed process to which the buffer is also mapped.

There's no reason to have the memory mapped into both processes at once, and you can't exploit the bytes you write without a real vulnerability.

Since it's a one-shot write into the buffer, if your intent is using it as an exploit step then you might as well encode an actual image with your exploit-assisting bytes.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by Hackbraten on Friday September 08, 2023 @10:49PM (#37441746)
> But if you do that every image looks wrong and it's vanishingly unlikely to get into a release.

The code doesn't have to be wrong for every input. It may be wrong just for pathological cases that don't occur in the field unless specifically crafted.

> Since it's a one-shot write into the buffer, if your intent is using it as an exploit step then you might as well encode an actual image with your exploit-assisting bytes.

The assumption was that the code tries to clean up the buffer immediately after use.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by Dylan16807 on Saturday September 09, 2023 @12:00AM (#37442169)
> The code doesn't have to be wrong for every input. It may be wrong just for pathological cases that don't occur in the field unless specifically crafted.

I could argue this more but it doesn't matter, that was just a little tangent, getting the size wrong will not let anything out of the sandbox.

> The assumption was that the code tries to clean up the buffer immediately after use.

Cleaning up would be removing the mmap. How are you going to exploit that? Your scenario is not very clear.

I think you're going for a situation where the sandboxed process can write to data in the host process outside the buffer? In a general sense I can imagine ways for that scenario to occur, but I can't figure out how you could get there via mmapping a buffer badly. A buffer mmap won't overlap anything else. If the mmap is too small then either process could read past the end, but would only see its own data (or a page fault).

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by Hackbraten on Saturday September 09, 2023 @03:02AM (#37442920)
> Cleaning up would be removing the mmap. How are you going to exploit that? Your scenario is not very clear.

If a buffer is going to be reused across calls, then cleaning after use is not the same thing as unmapping. One example for cleaning up a buffer after use would be zeroing.

If there's a bug in the calculation for the amount of zeroing needed, then leftover attacker-controlled data can bleed back from the sandboxed into the unsandboxed process and survive beyond the current transaction (because the code failed to zero the buffer correctly after use).

In other words, the attacker can now write arbitrary data into the unsandboxed process's memory at a semi-known location (known page offset) inside the mapped buffer. That data may not be very useful on its own, because it's still confined to the mmapped buffer. But it's now relatively well protected from reuse (until the next decoding task arrives).

That's plenty of time to do shenanigans. For example, you can combine it with an (unrelated) stack buffer overflow that may exist in the unsandboxed process, harmless on its own but more powerful if combined with an attacker-controlled gadget in a known location.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by Dylan16807 on Saturday September 09, 2023 @03:37AM (#37443117)
It's hard to see why the buffer wouldn't be per image. There's no reason to reuse that.

> In other words, the attacker can now write arbitrary data into the unsandboxed process's memory at a semi-known location (known page offset) inside the mapped buffer.

But what is the arbitrary data going to be?

1. If it's gadgets with known lower bits, then you could put that into a plain-old image file, no decoder exploits needed. Also this requires the second dumb mistake of the coder going out of their way to mark the buffer as executable.

2. If it's data you want to exfiltrate, you could just gather that after you trigger your unrelated exploit. This is only useful if everything aligns to drop the private data you want in that specific section of memory, and then the buffer is reused, and then the private data is removed from everywhere else, and then you run an unrelated exploit to actually give you control. This is exceptionally niche.

> harmless on its own

Ha.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by Hackbraten on Saturday September 09, 2023 @06:09AM (#37443792)
> It's hard to see why the buffer wouldn't be per image. There's no reason to reuse that.

Premature optimization is a thing. Most software developers are prone to it in one way or another. They may just assume a performance gain, design accordingly and move on. They may be working under a deadline tight enough so they never even consider checking their assumptions.

Or maybe the developer has actually run the experiment and found that reusing the buffer does yield a few percent of extra performance.

> But what is the arbitrary data going to be?

An internal struct whose purpose is to control the behavior of some unrelated aspect in the unsandboxed process. The struct contains a couple of pointers and, if attacker-controlled, ends up giving them an arbitrary process memory read/write primitive.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by Dylan16807 on Saturday September 09, 2023 @06:49AM (#37443946)
> An internal struct[...]

It sounds like you picked option 1 then, which means you don't need to take control of the sandbox. "Create an image that put arbitrary bytes into the buffer that stores its decoded form." simplifies to just "Create an image." There is no vulnerability here. This is just image display happening in a normal way. It's something to keep an eye on but not important itself. You have to add a vulnerability to get a vulnerability.

The original problem of preventing image decoding exploits has been solved in this hypothetical.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by Hackbraten on Saturday September 09, 2023 @07:08AM (#37444046)
> you don't need to take control of the sandbox

Your original request was: “If you've seen an exploit caused by a big pre-allocated array of untrusted RGBA data, please explain how.”

> It's something to keep an eye on but not important itself. You have to add a vulnerability to get a vulnerability.

Which is exactly how exploit chains work.

A single vulnerability usually doesn’t achieve something dangerous on its own. But remove it from the chain and you lose your exploit.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by Dylan16807 on Saturday September 09, 2023 @10:18AM (#37445733)
> Your original request was: “If you've seen an exploit caused by a big pre-allocated array of untrusted RGBA data, please explain how.”

I asked that in a context of whether you can contain vulnerabilities in a sandbox. If something doesn't even require a vulnerability, then it doesn't fit.

Also please note the words "caused by". A few helper bytes sitting somewhere are not the cause.

> Which is exactly how exploit chains work.

> A single vulnerability usually doesn’t achieve something dangerous on its own. But remove it from the chain and you lose your exploit.

Being part of an exploit chain doesn't by itself make something qualify as a vulnerability. (Consider arbitrary gadgets already in the program. You can't remove all bytes.) And I've never seen "you can send it bytes" described as a vulnerability before. Not even if you know the bytes will be stored at the start of a page!

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by darkclouds on Thursday September 07, 2023 @05:27PM (#37425857)
A few years ago kaspersky caught something that had to be removed by their rescue ISO. That ISO was blocked from downloading its updates and their UK support team couldn’t resolve the issue so never got to find out what it was, but it doesn’t look good there was a block preventing it from working.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by deepfriedrice on Thursday September 07, 2023 @06:11PM (#37426308)
The article references Lockdown mode [0] which appears to be Apple's solution for this (and other) class of zero days.

[0] https://support.apple.com/en-ca/HT212650

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by tialaramex on Thursday September 07, 2023 @06:33PM (#37426540)
Lockdown mode means you're able to use less stuff. In this case the "pass" feature doesn't exist in Lockdown mode and that's the attack target AIUI. So, if most people don't use it (because less stuff works) then it can be "successful" statistically because maybe the attackers aren't targeting the stuff you're allowed to use and you don't get exploited.

But this isn't a stable solution really. If Lockdown is popularized, NSO obviously will attack the things which are available in Lockdown. Apple shows no sign of only allowing it in Lockdown once it's actually safe - instead they've just arbitrarily decided what to allow and what not to allow.

Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by Closi on Thursday September 07, 2023 @06:51PM (#37426745)
Lockdown mode massively reduces the attack surface, which would make it far harder to find an exploit.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by jdright on Thursday September 07, 2023 @06:57PM (#37426804)
Not entirely true because NSO (or their clients) have very specific target requeriments. If they want to target another Jamal Khashoggi and lockdown mode is used, they have their incentive to buy and create the demand for any 0day that they can then re-sell to their lovelly clients. No need statistics for this, the incentive is purely greed.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by fh9302 on Thursday September 07, 2023 @07:05PM (#37426888)
The downsides of using Lockdown Mode are minimal and well worth if you are an at-risk target. It's about reducing the attack surface and potentially getting notified if nation state actors try to attack your phone.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by saagarjha on Thursday September 07, 2023 @08:03PM (#37427445)
The list is not arbitrary, but generally based on remote attack surface.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by sobriquet9 on Thursday September 07, 2023 @08:15PM (#37427558)
Of all the apps that I ran, only one banking app has failed in Lockdown mode. Everything else works just fine.
Re:NSO Group iPhone Zero-Click, Zero-Day Exploit Captured in... by ssss11 on Thursday September 07, 2023 @06:47PM (#37426700)
Hahha what? True banned them because they’re American.

There may be some zero days that NSO has exploited but it’s nothing like the cluster that is Android.