652 points · by appwiz · 7y ago · 270 comments
There it wasn’t entirely uncommon that when you sent a malformed sms-deliver PDU (e.g. text message) to the phone and crashed parser that tried to decode it, it took also the phone down before it could ack the message back to SMSC. Which of course meant that as soon as phone was turned on and it registered to network, that same message was redelivered (crashing it again) for as far as the network was concerned, it was never received by the mobile. Until the time that message either expired in the SMSC in few days, or you switched you sim to a non-vulnerable mobile to receive the message. Good times.
But you could also write the same code into any IRC chat room and anyone running that AV would get booted.
Just post in the general chat area.
“Hey, to speed up Yahoo Games, press alt-f4.”
I learned that you could evade their swear word filters in your screen name by using ASCII codes.
So I looked up a table. Beep didn’t work, but NULL would boot everyone on your contact list out.
https://media.ccc.de/v/27c3-4060-en-attacking_mobile_phones
http://www.ngolde.de/sms/smsodeath_mulliner_golde_cansecwest...
Your "congress" is redundant because CCC=Chaos Communication Congress.
They were indeed hardened? Do tell.
I've suggested that the iPhone be hardened against rendering crashes, here on HN. The immediate reaction is to downvote me, then reply, "undefined behavior must crash the process." That's pretty glib and shortsighted, however. It took me just a few seconds to think of a solution.
Have one process write the messages in a log file. This process also supervises the second process. The 2nd process renders the messages. If the 2nd process keeps crashing on the same message, the 1st process marks that message as a problem, and the user can be prompted to send the hex dump of the message for diagnostic purposes. (So if it's spicy, they can say no.)
The fact that such a basic function of the iPhone can be remotely vanished, requiring a reboot, is a pretty glaring hole. What's even worse, is that highly paid SV programmers would shrug their shoulders so easily.
Guess what cell carriers did back then? Yes, they disabled multipart SMS
> There it wasn’t entirely uncommon that when you sent a malformed sms-deliver PDU (e.g. text message) to the phone and crashed parser that tried to decode it, it took also the phone down before it could ack the message back to SMSC.
By yesteryear do you mean the present and feature phones do you mean current android phones? Some models are still vulnerable to a text-of-death.
https://poetengineer.postach.io/post/deleting-the-text-of-de... not my blog, but the same problem happened with my mother in law's phone. The phone becomes unusable because of a stream of org.android.phone application has stopped messages and the only thing to do is use adb to delete all texts, until it comes in again. I was never able to pin down the exact problem.
Edit: Sorry, I didn't mean to come off as snarky, but I just wanted to 1) point out that there are still issues with decoding SMS and MMS messages, even in some modern phones and 2) provide a link to anyone who encounter the same issue as it was very frustrating for my MiL and very frustrating until I figured out I could just wipe all SMSes with adb.
iMessage really could have been something great (despite apple controlling CA) if they had just opened it up for more devices. Instead WhatsApp wiped the floor with them.
Messages are not encrypted to Apples keys they’re only encrypted to recipient device keys - there is no way for Apple to filter any content without removing the end to end encryption of iMessage, which Apple does not want to do - every bit of user content that Apple can decrypt increases the value in compromising Apple’s service infrastructure.
and in the process eavesdrop on everybody's messages? no thanks.
or...
"Apple can turn off imessage to users with OS < 12.3 until users update"
What do you suggest they do?
Architecture-wise some thought should be given to keeping iOS from being DoS'd by the crash/respawn of any service.
Also, looking at the "assuming it's a string" line from the problem description, Apple needs to make an investment look through the codebase for this same error in other guises.
That's what occurs to me off the top of my head anyway.
> For those with jailbroken iPhones, a community member has released the tweak BrickFix: https://www.reddit.com/r/jailbreak/comments/c9616j/release_b...
You shouldn't be able to crash the whole operating system (not just the display server, display driver, etc.) with an ordinary shader, even if it crashes the shader compiler or causes the GPU not to halt. It's not as though I wrote these shaders in an attempt to crash iOS.
Sure, you could patch the app to avoid sending what's known as bad data to the next layer but I'd argue that that's the wrong place to do it.
I’m not entirely sure how you’d go about updating the phone without booting into it, but I think it is possible, and that would be one way to avoid losing all your data due to the bug.
For testing purposes, there are three ways that I found to unbrick the device:
1) wipe the device with 'Find my iPhone'
2) put the device in recovery mode and update via iTunes (note that this will force an update to the latest version)
3) remove the SIM card and go out of Wifi range and wipe the device in the menu
You can lose data with a faulty hard drive if your backup is silently corrupted and you don’t realize it. That’s not a risk here, as long as before restoring from backup you upgrade the phone OS to patch the bug.
Also, you can lose data with a faulty hard drive if you have no backup.
Rooters especially will care about these points since they typically cannot restore from backups without upgrading the phone away from a rooted version, due to choices made by Apple in firmware.
Disclosing in advance is a bad policy, it will just incentive good behaving vendors that update fast to delay full description of their changelog for security reasons because you put their users at unnecessary risks.
That's why all disclosures come with window - if they don't, the companies aren't under any pressure to update their systems, the exploit start being used in the wild, etc. The window is not ideal, but it is better than no window.
And there isn't much point arguing over 30 vs 90 vs 120 vs 365 days. 90 is reasonable, enough for even the largest mainstream software companies to issue a patch release.
> Unrestricting, as this was fixed in the 12.3 update.
> Unrestricting, as this was fixed in the 12.3 update.
Why did your friend choose to send data over SMS? Why was AT&T upset at his project?
> The calling method then calls -[IMBalloonPluginDataSource _replaceHandleWithContactNameInString:] which calls im_handleIdentifiers on the 'NSString' which is really an NSNumber, which throws an exception as the selector does not exist in that class.
Looks like they need to move more of their stuff to Swift to reduce snarfles like this.
Stories like these (this isn't the first time that iOS/macOS could be crashed by chat messages), and the empty root password debacle, or all the GateKeeper bypasses, make me wonder if their engineers take their own WWDC security-related talks seriously.
Still, it's not so bad as the Windows XP-7 epoch, when eldritch nightmares walked the land.
Why do you think so?
Or does it happen even if you never use iMessage and have its notifications disabled?
You are speaking like an Apple fanboy. Days of XP are in the past and even Windows 7/Windows 2008 fairs better than Apple OSX and iOS. This is especially bad as apple sells a false sense of security when they fail to build even the basics correctly.
Their walled garden is paved with expensive ibricks.
Edit: Those who think I am speaking rubbish can refer this link. https://www.cvedetails.com/top-50-products.php
That listing groups together all OS X bugs back to 2002 under one heading, but splits up each Windows version into its own entity. So the numbers aren't really comparable.
As for mobile, does anybody remember hearing of any iOS cross-app malware ("viruses") in the decade since it launched? I think that's pretty amazing.
[0] https://www.google.com/search?q=windows+update+deleted+docum...
They were actively misleading peoplebby running advertisements claiming MACs don't get virueses[2].
[1] https://www.forbes.com/sites/daveywinder/2019/06/21/new-crit...
Comment 6 by p...@gmail.com on Fri, Jul 5, 2019, 3:27 AM PDT (3 days ago) Too late, already out in big news website...
For example, if I pull out my EPROM writer, de-solder the chips, and update them almost no device is truly "bricked" by this definition. The only exceptions would be burned update fuses or similar physical damage. Making the definition itself extremely niche, to the point of being synonymous with "physically damaged/destroyed."
I myself stick to the broader "technologically as useful as a brick" definition. Which a boot-looping iPhone absolutely fits. The fact there are ways to recover it is neither here nor there.
I generally call what you're describing a "Hard Brick." But even those are sometimes recoverable via as I said chip re-programming.
Physically replacing every single component, one by one, will lead to a recovery.
>I stand by words mean things.
They are an abstraction of thought to enable communication and external storage. A very leaky abstraction.
There are some implicit limits to what "bricked" means and those limits vary by individual.
bplist00ÔX$versionX$objectsY$archiverT$top † ¦U$nullÓ
WNS.keysZNS.objectsV$class¢
€€¢€€€RanVldtext¢ËqÒZ$classnameX$classes\NSDictionary¢XNSObject_NSKeyedArchiverÑTroot€#-27>DKS^ehjloqsux„‰”ª¶ÈËÐ Ò {
"$archiver" => "NSKeyedArchiver"
"$objects" => [
0 => "$null"
1 => {
"$class" => <CFKeyedArchiverUID 0x7fd45ec02d50 [0x7fff97761b10]>{value = 5}
"NS.keys" => [
0 => <CFKeyedArchiverUID 0x7fd45ec02c20 [0x7fff97761b10]>{value = 2}
1 => <CFKeyedArchiverUID 0x7fd45ec02c40 [0x7fff97761b10]>{value = 3}
]
"NS.objects" => [
0 => <CFKeyedArchiverUID 0x7fd45ec02cf0 [0x7fff97761b10]>{value = 4}
1 => <CFKeyedArchiverUID 0x7fd45ec02cf0 [0x7fff97761b10]>{value = 4}
]
}
2 => "an"
3 => "ldtext"
4 => 77777777
5 => {
"$classes" => [
0 => "NSDictionary"
1 => "NSObject"
]
"$classname" => "NSDictionary"
}
]
"$top" => {
"root" => <CFKeyedArchiverUID 0x7fd45ec02ff0 [0x7fff97761b10]>{value = 1}
}
"$version" => 100000
}Even to the EE, the cost of parts and time to repair may exceed the cost of replacement, much like a car in a relatively minor accident can still be considered "totaled" if the repair cost exceeds its value. "Bricked" may still not be the right term, but the difference is irrelevant at that point.
Another consideration is there's a big difference to a user if the fix requires erasing all data, as the work required (after fixing) is then the same as getting a replacement. At the least, this is the effort of applying updates, restoring backups, then dealing with all the fiddly things that didn't update/reinstall/restore properly. At worst, it's irreplaceable data loss (and a hard lesson in why backups are important).
I've never heard of a minor incident referred to as being "totalled", but rather a "write-off", since it's the insurance companies that are ultimately making that decision, not the repair service. Is that a regional thing?
Crash loop or hung on startup describes the state. It is by definition not bricked if it can be recovered.
There’s nothing bricked about this. There are no levels of brickedness.
(If you have JS disabled, you can click "View in Old UI" and then view source to see the content. I find that a bit ironic in the context of this specfic bug...)
You don't really need isolation if the code is so simple as to obviously contain no bugs (instead of containing no obvious bugs.)
Instead, we have a whole industry built upon encouraging the creation of things as complex as possible, and working around the problems caused by that by adding even more complexity, mainly because it means people have more to do.
http://countercomplex.blogspot.com/2014/08/the-resource-leak...
(No, downvotes from the complexity-brigade are not going to make me change my mind either.)
So you're kind of right, we wouldn't need isolation... if not for the fact modern mobiles exist.
But even then - people are creative. Software may be obviously bug free, hardware may be obviously bug free... then someone comes up with rowhammer and you're owned by pure physics. I'm not sure "obviously bug free" even exists.
What would?
The problem here seems to be that the code handling the incoming message is inexplicably running inside springboard rather than a separate process. :-/
There was a trend since iOS 6 to move backend/non-UI responsibilities away from SpringBoard. But in iOS 11 or 12 or so, more responsibilities started creeping back into SpringBoard. Maybe because of performance or memory consumption concerns, maybe it’s laziness avoiding having to set up a new daemon with appropriate dependencies and sandbox profile when the code can easily be plopped into SpringBoard, it’s not clear. As Natalie says in the report, on macOS this bug only causes DoS on a daemon. Worst case, iMessage stops working and your battery dies quicker. Being totally locked out of the device because SpringBoard is “boot looping” due to an existing fail-safe being excluded from the design seems awful.
On the subject, my Android phone stopped even presenting a keyboard on the lock screen or anywhere else, because the default keyboard is Gboard, and Gboard relies on Play Services, which was crashing inside Gboard. Like this iOS bug, the only known solution is to wipe the device and start over. At least I was still able to get into the device by connecting a USB keyboard. Sucks to know most would have no idea how to diagnose such an issue though, needlessly wiping their photos and all.
In this case. In general, however, Objective-C can often fall victim to attacks where poorly validated attacker data ends up causing RCE: see the entire reason for the existence of NSSecureCoding.
Like, repeatedly.
goto fail, Facetime surveillance, empty password grants root access, and now this.
As much as Apple touts privacy and security, this is not a great track record.
The more resources a company has, the less forgivable serious bugs like this are.
I need to keep reminding myself: Apple is a hardware company, not a software company.
Infinite resources do not easily translate to quality for many many reasons.
The main being: we’re just human, and we suck at managing large projects at scale.
I'll use URL to this bug in my next comment-holywars to prove this point.
Yes, it takes much less code to throw an exception in hope some code will catch it, but while compiler (not runtime) doesn't check it - this technique is not safe. So we should return errors, check them and handle - sometimes it means returning error further, but in some function we'll write code to handle this case without crashing the system (or, at least, it will shutdown everything gently, without panicking).
The "unrecognized selector sent to instance" exception is not thrown in the hope that someone will catch it. It's intended to be a fatal error reporting a precondition violation.
Especially important on methods called on launch, if a crash would cause a problem.
(Swift or other strongly typed language would help here.)
Have you tested every combination of state + error and made sure your app is robust for each situation?
2) Yes, it's not so difficult. Writing tests, for example, also takes time - it's not a reason to don't write tests.
I had to read that several times before I realized you weren't talking about computer device drivers and computer systems.