Google, Xiaomi, and Huawei affected by zero-day flaw that unlocks root access
thenextweb.com
thenextweb.com
1. Over two years ago, this was apparently detected automatically by the syzkaller kernel fuzzer, and automatically reported on its public mailing list. [1]
2. Over a year and a half ago, it was apparently fixed in the upstream kernel. [2]
3. It was apparently never merged back to various "stable" kernels, leading to the recent CVE. [3]
So you might read that and think "Ok, probably a rare mistake"...
...but instead:
4. This is apparently a _super_ common sequence of events, with kernel vulnerabilities getting lost in the shuffle, or otherwise not backported to "stable" kernels for a variety of reasons like the patch no cleanly longer applies.
Dmitry Vyukov (original author of syzkaller fuzzer that found this 2 years ago) gave a very interesting talk on how frequently this happens a couple weeks ago at the Linux Maintainer's Summit, along with some discussion of how to change kernel dev processes to try to dramatically improve things:
slides: https://linuxplumbersconf.org/event/4/contributions/554/atta...
video: https://youtu.be/a2Nv-KJyqPk?t=5239
---
[1] https://twitter.com/dvyukov/status/1180195777680986113
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux...
[3] https://mobile.twitter.com/grsecurity/status/118005953923380...
- https://syzkaller.appspot.com/linux-4.14 - https://syzkaller.appspot.com/linux-4.19
As far as I know, no one is doing anything with the syzbot bugs against stable kernels directly, since no company using Linux is paying anyone to do it as their job. But some are getting fixed; e.g., some get reported against mainline too, then fixed and backported.
A weekly report with some easy to understand graphs would probably convince more people to work on these bugs.
It's bad enough that syzbot finds fifty serious bugs per hour, but I'll relay a personal anecdote. Earlier this year I wagered a colleague that I could open up the source of the 4.10 kernel (the one that was once current in Ubuntu 16) and find an obvious defect in less than an hour. It actually only took me about 15 minutes, to find a deadlock in the squashfs that was triggered by kmalloc failure and an error path via goto, which of course nobody should ever use. And while I'm reading it I'm just thinking to myself that this is the worst program I've ever seen and it would never pass a code review at my workplace, but it's out there right now running on billions of computers.
Well written code is the best code. Some well written code uses goto. Some not well written code doesn't use goto
Different ballgame from the subject of Dijkstra's manifesto.
Go, which is also known for its terrible error-handling.
Great.
This is the sense in which the Linux kernel uses goto.
I hate that people keep peddling this nonsense because they wrote a little C and read a headline about “goto considered harmful”, which is a gross oversimplification and a BAD piece of “wisdom” that for some reason won’t die. This is how serious handling in C is done. Please stop repeating this tired trope.
Oh man, can I put that on a t-shirt?
The problem is there are so many of those.
I'm amazed the GRSecurity people have managed to do it for so long. Even if merging their stuff mainline legitimately wasn't practical, I've seen plenty of snark and dismissiveness from the Linux team towards them and others. And GRSEC does actively bring in CVEs into their kernel patches all the time and get paid via sponsors to do so.
I'm sure going through old CVEs is a great way to find "zero days" and/or relapses after old patches. Or even just following the work GRSec does there's probably plenty of stuff for a highly motivated company like NSO to exploit.
https://www.theverge.com/2016/4/14/11434926/blackberry-encry...
Also AFAIK Blackberry only provided a hardened kernel with a single device in 2015 called Priv. I haven't heard anything from them since... maybe someone could correct me here.
Can you give some reference for that claim?
If you want more, literally google “baseband attack host processor memory” or “baseband exploits DMA” or “baseband exploits memory”.
The fact you use the word "prioritize security" is indeed telling. Security is just one aspect of a system. There is no particular reason for Linux to prioritize it above everything else, no matter what twitter infosec drama queens believe.
Obviously the fact that infosec people are quite often insufferable does not help their case.
If I were an average consumer, I would care much more about my device being secure, than having real time audio.
If you were, you would behave like one, i.e. not care that much (if at all) about security. What you are saying is "I do care about my device being secure".
Perhaps, the average person would be more upset/notice if they were negatively impacted as the result of a security issue, than if some feature, e.g. real time audio were missing, which I'm sure no one would even notice.
It's not even a choice between better security and real-time audio, since the average consumer doesn't even know about that unless specifically called out by marketing. For phones it's about what looks better, both physically and digitally. It's about how the emojis look, how good the pictures the camera takes look (or how good you're told they look), and how responsive and smooth the screen movements are.
The average consumer goes off what they can immediately see and what they're told by marketing, and by what they feel social pressure to buy. The discerning technical expert goes off marketing (but a different set of claims), and a bit more of a discerning eye, and while far more knowledgeable than the average consumer, is still mostly driven by hearsay.
The number of people with enough knowledge to actually make a real data driven choice is probably much less than 0.0001% of people, and that's far from average. I'm not one of them, but I can look at the systems often affected, make some assumptions about how many people know enough about them to speak usefully on risks they actually have, and do some napkin statistics to know almost nobody else is either, even here.
It's easy to call out the average consumer, but truthfully, the last time you bought a phone or computer, how deeply did you analyze the actual security considerations to do with the different aspects of the system, and how much did you rely on what some site told you, trusted recommendations, what you already preferred, and your hunch was which was better? How many millions of lines of code are involved in these systems now? How could you, or any of us actually do anything other than that?
Linux distributions make up the majority of public web and database servers and approximately none of the real-time audio players, is that not a “particular reason” to prioritise security over real-time audio?
If you're system gets p0wned there is hardly any audio to play.
macOS, iOS and Windows security improvements, while being the musicians choice for real time audio, show it is possible to put security first, while offering a good audio stack.
This falls pretty much on Google and people in charge of the backports
Hence these issues, arguably.
But isn't the issue that Android didn't merge it? Linux patched it.
Why even post this, when it has nothing to do the with the case GP & OP described? It's misleading at best.
The failure here is in the way Google has set its Android development process. They keep a separate "stable" kernel, and manually select certain patches to backport to. In process they skip all kinds of patches - performance, features, and yes, security ones. Given that only selected patches are backported, the process is best described as insecure by default. It was Google's decision to favor stable API over security here.
This is compounded by the fact other Android phone vendors are pretty slow at releasing OS upgrade - and tend to stop releasing them altogether shortly after the phone's no longer manufactured.
The mainline kernel, as released by the Linux core team is up to date with security. Hold to account people that decided to skip patches as a matter of course, resulting in the insecure by default process.
I think it's still the won't layer. Google may be able to put some pressure to change things, but it's describe the issue as "the failure is in the way SOC manufacturers have set their kernel porting process". You often get chips which work with one version and a dump of specific drivers. Beyond pressuring the company to upstream their changes, or writing clean room versions, I don't see many solutions.
To me, the particulars of this exact case are not as interesting as the fact that the entire Linux patching and backporting of security issues seems _very_ fragile, with things frequently getting "lost" for mundane reasons, and a key part of the "why" it is so fragile is due to many of the core Linux development processes.
This particular CVE is apparently one small example that happened to catch some headlines out of _thousands_ of similar problems.
That talk linked above by Dmitry Vyukov is worthwhile for getting a sense of the magnitude of the problem.
Now why that fix never made it in most vendor kernels (besides a few like the one in the Pixel 3 that is based on 4.9) is a good question. But at the same time there is the reality, that everyone focusing on the upstream LTS kernel would have never gotten the fix.
The other half of the problem is the companies that actually use these garbage dump forks and build products on top of them.
For me, getting the SoCs and chips we use running on latest upstream kernels was a high priority in platform bringup.
I only used SoC vedors' garbage dump SDKs for quick testing & some reference. And chip vendors' drivers I ported straight to upstream git version.
Of course this isn't how it goes in companies where "shit to market" is top priority.
Was there a Project Zero blog post before those comments went public that I missed?
[1] https://bugs.chromium.org/p/project-zero/issues/detail?id=19...
Because if this wasn't announced on their blog I'm going to have to say that this particular case would not be an apples to apples comparison.
Here was the Project Zero blog post on Apple's exploit, for comparison.
https://googleprojectzero.blogspot.com/2019/08/a-very-deep-d...
[1] https://bugs.chromium.org/p/project-zero/issues/detail?id=14...
[2] https://bugs.chromium.org/p/project-zero/issues/detail?id=17...
[3] https://bugs.chromium.org/p/project-zero/issues/detail?id=19...
However, I do think some of the motive is to take a bit of shine off Apple - meaning it's partly a marketing campaign.
This one gets a bug tracker entry.
When Project Zero posts a lengthy analysis with lots of scurious claims about the victims of the exploit, the window of exploitation, and narrative about the poor development practices that led to it, then call it even.
If it follows the traditional pattern, they'll write a post blaming some external party. No, seriously, when people point out all of the "Android" faults they've found invariably it is some variation of "but it isn't really Google's fault....".
Project Zero is brilliant, full of brilliant people, and is a remarkable effort, but when your paycheque is signed off by someone, it is human nature that you're really going to pussyfoot with them.
For now. A comment from the reporter on the bug tracker entry:
>A more detailed explanation of this bug and the methodology to identify it will be written up in a forthcoming blog post when I find the time.
Apple has started multiple keynotes by talking about Android security issues. Pointing fingers and ridiculing Google, Samsung and others.
Then a few weeks later, a Google keynote would demo something on an iPad and praise its beautiful hi-def screen.
I have _never_ heard Google officially talk crap about Apple.
Historically, they didn’t directly identify other vendors, but strongly implied it so it was obvious to most without directly saying names. This has changed a bit recently and I feel isn’t a good thing.
> I have _never_ heard Google officially talk crap about Apple.
No offense, but then you aren’t paying attention. There are examples given directly in this thread already.
Will there be a large analysis how frequently this was exploited and so forth? How about a public Google blog post around this?
A minor windows exploit is found, and they publish "Windows Exploitation Tricks". An iOS exploit is found and they do a six part "very deep dive into iOS Exploit chains".
Now, they find a bad Android exploit and they don't publish anything.
int fd, epfd;
struct epoll_event event = { .events = EPOLLIN };
fd = open("/dev/binder0", O_RDONLY);
epfd = epoll_create(1000);
epoll_ctl(epfd, EPOLL_CTL_ADD, fd, &event);
ioctl(fd, BINDER_THREAD_EXIT, NULL);It's unfortunate that Google chose to use a custom IPC system, binder, for Android, instead of changing Android's design to better fit Linux. If binder was in use outside Android, I expect this bug would have been caught long ago and certainly would have been backported to stable.
I just had a look at binder.c and the ref counting and locking in general looks like a nightmare to maintain. This reminds me of how much I hate resource management in C.
You mean a security model that misses the fact that the kernel cannot be updated and relies on a "sanboxing" solution that doesn't bother limiting kernel attack surface. No, I don't think they even had a security model in mind, a threat model or anything beyond random ad hoc ideas. And if they did some thinking, they would not have chosen SELinux either, as it's not a decent solution to anything, it's more like a solution to "we must to do something, this is something, we must do this".
Managed languages userspace, drivers implemented in Java or C++ in their own process with IPC to the kernel (since project Treble), whitelist of allowed native calls beyond the rather thin set of native libraries, to touch IO beyond own APK install dir or TCP/IP, native code needs to go through managed layer, several security critical processes are deployed in production with FORTIFY and sanitizers turned on.
ChromeOS turns the notch even higher by running Crostini on its own Rust implemented hypervisor and Go written userspace syscalls wrapper (gVisor).
Maybe. I'd argue "extremely".
It does suck, for instance, that Discord as a Flatpak can only access a fixed subset of $HOME directories. But it can't scan your machine's processes like ordinary Discord can (to report the game you're playing), which is a privacy gain. The security (and portability) advantages of sandboxing/containerizing apps may outweigh the hassle of the workarounds/memory inefficiency.
Meanwhile, with unfettered access, you have things like: https://www.thegamer.com/civilization-6-steam-eula-change-sp...
>"We may combine the information with your personal information and across other computers or devices that you may use"
They also mentioned "photo", which there's no obvious way to collect. I remember someone joking, "What, do they go through your directories, looking for a picture of you?!"
So maybe, instead of trying to somehow make it safe to run untrusted software on our machines, we should focus on making sure all the code that runs on our machines is trusted - not in the sense of "proved correct", but in the sense of "written without malicious intent". If you regard Discord scanning your processes as an unacceptable invasion of privacy, and it bothers you that there's no way to turn that off, perhaps avoiding Discord is a better solution than trying to sandbox it.
Using a separate computer for each counterparty would be more secure, but again not very convenient.
For programmers and experts no.
But if it was toggle-able, I would toggle "sandbox everything, don't let anything not secure run, only allow trusted apps" in a heartbeat for work machines, my parents, and so on...
So many iPhone users knowingly refuse to upgrade to newer versions of the operating system just so they can keep their jailbreak.
People do that all the time with desktop computers.
[1] https://developer.sony.com/develop/open-devices/
[2] https://www.xda-developers.com/asus-zenfone-6-custom-rom-twr...
But the general problem isn't whether it is possible for someone to buy an unlocked phone, but rather that it is possible to "buy" a phone and have it turn out to be non-unlockable. The general case is important so that users who run up against manufacturer shenanigans can straightforwardly route around them, and also simply preventing the pileup of more unusable planned obsolescence ewaste.
Is there a well-researched theory that considers a "breaking point" in this pattern? Where we either a) accept that all data is at risk of being exposed or b) develop fundamental security patterns to privatize our data or c) something else?
> Due to evidence of in the wild exploit, we are now de-restricting this bug 7 days after reporting to Android.
Why is this a good idea?
"Actively exploited" by at least law enforcement. It’s sheer folly to presume that if one motivated group has already discovered this that nonetheless somehow others won’t have as well.
> No longer occurring on linux-next, probably fixed by the following commit:
> #syz fix: ANDROID: binder: remove waitqueue when thread exits.
https://groups.google.com/forum/#!msg/syzkaller-bugs/QyXdgUh...
See for example:
https://mobile.twitter.com/grsecurity/status/118005953923380...
We don't know, because we don't know who bought it and how widespread they deployed it.
It also seems like you could discover the bug from public sources - it had been created and fixed in the kernel. Apparently at the time not registered as a security issue, but review could discover the link and check for Android's not having the fix.
In the case of Android, "just tell the vendor" is also kind of awkward: There's dozens, if not hundreds of those. If there's an active threat, it's kind of hard to justify not to inform all of them, but could you trust an embargo over so many parties?
Amnesty International has specifically criticized NSO specifically regarding UAE activist Ahmed Mansoor. He is currently serving 10 years in jail. UN human rights experts considered his arrest and imprisonment "a direct attack on the legitimate work of human rights defenders". He was monitored by the UAE using NSO technologies.
Amnesty International have also complained that they have been targeted with NSO Group technology - specifically Pegasus. They're currently launching a legal case in Israel to restrict their export license.
A separate case claims that NSO Group used Pegasus to help the Saudis spy on Khashoggi, who was brutally murdered in the Saudi embassy.
I don't think we need to argue about the bad guys in this case.
Sources: https://www.amnesty.org/en/latest/news/2019/09/nso-spyware-h...
https://www.amnesty.org/en/latest/news/2019/05/israel-amnest...
https://www.nytimes.com/2018/12/02/world/middleeast/saudi-kh...
I'd say the upsides outweigh the downsides.
It’s also probably not a terribly great assumption that no one else has independently discovered this vulnerability that’s already been independently discovered twice. Caution suggests we should assume this is in the wild and act accordingly.
I guess it informs us what not to do at the very least. Given the track record, I'm not very optimistic of the vendors pushing a patch very soon (if ever). This keeps us informed at least.
They can easily give that^ information without exposing details of the bug though?
The recommendation that other browsers are inherently protected doesn’t make sense. Any app with an rce bug could be a vehicle to exploit this Android bug.
Unpopular opinion but this is why I prefer walled garden apple for my family then alternative.
Saying "doesn't have the ability to install apps from other sources" is the same as saying "doesn't give you the choice to install apps from other sources" -- it's removing a choice.
If you don't want to install apps that aren't approved by Apple then... don't. You could choose not to even if your ability to choose was not restricted.
Not from the marketplace.
If you care about this so much, you can go over to Android. I personally like the way Apple handles their platform with an iron grip and is part of the reason I buy their products.
I consider the tight control a feature and I'm glad this philosophy of computing is available in the marketplace.
I think people underestimate this view.
Buying a hypothetical Apple device and never flicking on the sideloading switch would still give you that. Whereas the person who generally prefers the security engineering, design choices and/or integration of iOS but wants some exceptions is now told "If you care about this so much, you can go over to Android.".
Until someone (my abusive spouse? someone with a narrowly scoped zero-day and physical access to my phone?) abuses the existence of this functionality in ways that compromise my security.
> Whereas the person who generally prefers the security engineering, design choices and/or integration of iOS but wants some exceptions is now told "If you care about this so much, you can go over to Android.".
I agree with you here. It would be great if Apple offered two classes of iPhone, one where such a switch was present and one where unsigned code was prevented from executing by hardware.
You don't even need two classes of phone, just a setting to allow unsigned code which requires a factory reset to change.
Nobody can compromise the data on your phone with unsigned code if switching to unsigned code requires erasing the phone, and you're going to notice immediately if your phone has been wiped, which is no worse for you than someone with physical access smashing it with a hammer and replacing it with another phone.
> You could choose not to even if your ability to choose was not restricted.
Choosing not to install apps that aren't approved by Apple is not the same thing as choosing to use a device where apps that are not approved by Apple cannot be installed. That is the entire point.
How can someone (perhaps yourself?) be in favor of expanding choice and also opposed to to the existence of this choice?
The issue isn't that an iPhone on which you can't install apps not approved by Apple exists, it's that an iPhone (i.e. Apple hardware running iOS) on which you can install apps not approved by Apple doesn't exist, so that choice is missing from the market. In order for it to be a choice it is necessary for both alternatives to be available.
Fair, and ideally both options would exist. But an Android phone is a close approximation of an unlocked iPhone, while there is no other close approximation of a locked iPhone. Pushing the security stance of iPhone to align more closely with Android is a homogenization of the landscape and a reduction in the diversity of options.
And of course, "untrusted sources" is not the same as "all side-loading". I use sources to sideload from that I trust more than the average app developer.
https://www.pcmag.com/news/363357/google-irks-epic-games-by-...
You can install family link, which blocks that option. It's a good option for parents to keep tabs on their kids - it shows you location, and which apps are installed.
So, you have to sideload an app or from some other source. Is it unreasonable to say don't do that? How common is it anyway? I work with IT folks and only a few ever seem to load outside the Play store. Perhaps in other parts of the world it's more common...?
I'm not sure, but aren't Play Store submittals APKs anyways? Is additionally self-hosting them that much more complicated?
I've heard that developers often go Play Store exclusive, for fear that Google might block them. Is that true?
Similarly, Chrome is only mentioned because it's notable that it can be effective from inside its isolation if combined with a browser exploit. That likely applies to all browsers, but the article recommends to switch browsers.
I get most of my stuff from F-Droid and some software vendors provide APKs straight from their websites and whatever is Play Store exclusive, I simply don't use.
It was going really well, at least until recently, when here in Germany they started introducing mandatory apps for online banking, available (of course) only on Play Store or App Store.
I wouldn't even mind everyone's app-obsession if they'd at least always provide a store-free APK as well.
[1] https://f-droid.org/en/package/com.github.yeriomin.yalpstore...
Since it was a banking app, I got the APK of many different sites/programs and compared the hashes, and one of the programs had definitely tampered with the APK, but I can't remember which.
Since I left Aurora on my phone, they seemed to have passed on untouched APKs, but don't take my word for it.
EDIT: Also, this voids me of any "warranties" my bank would offer me, so I'm really not going down that path. Really, the only correct thing would be for the bank to offer the APK on their site, but I'd probably have to wait until the government forces this to happen (if ever).
Get the source to Aurora (or YALP) and find out how it downloads the APK from the play store. Now either build something which does what you want (e.g. feed it an identifier and it downloads an APK), simplify the existing code until only the required functionality is left or use Aurora as it is. You can feed it a Google account (if you have one) to log in to the play store or it can do so 'anonymously'.
Then there's f-Droid, the people that run without Google apps (alternate roms).
And then there's "Android TV" that has a "different" play store due to the TV profile being different - but allows sideloading of apps like zerotier(VPN) or chrome - that work fine on TVs - but unfortunately isn't flagged as supporting TV in the Manifest.
Please, give me instruction to root my Xiaomi Ido until they fixed it! (updates on my phone disabled for a while)
I'm slightly confused: Do they mean any app or a compromised app?
From my reading of this comment[1], it sounds like this vulnerability is such that if an attacker has vulnerability (1), this vulnerability can be used as vulnerability (2) and (3). It sounds like NSO group either had or has a separate vulnerability (1), possibly something from [2].
[1] https://bugs.chromium.org/p/project-zero/issues/detail?id=19...
[2] https://www.cvedetails.com/product/15031/Google-Chrome.html?...
The reality is, you don't need to "trust" the source in general, you just need to trust that the source is not malicious. If the source is untrusted but you have faith it is not malicious then you can rely on Android's built in permissions system to protect you from it exceeding the bounds of what you would like it to do.
This may sound very pedantic, but the whole existence of an app ecosystem that isn't controlled by the hegemony of the 2 or 3 big app stores depends on this nuance.
https://www.pcmag.com/news/363357/google-irks-epic-games-by-...
You could claim google has been irresponsible for publishing technical details about this flaw in epics installer too early but it still has nothing to do with Androids permission system.
“However, on Aug. 15, a Google researcher discovered a flaw with the installer, which can let a separate app on your phone hijack what the software actually downloads.”
So a separate app can hijack what another app does. That means the sandbox is broken.
If an app can trash your user data the permission system is useless.
I would agree that conflating external storage options with shared storage was a huge mistake which made developers somewhat unaware that this is something that is actually not sandboxed as anything else would have been. But i think nonetheless it is the responsibility of the developer to not just assume how stuff works and in this case it is quite obvious if you actually happen to ask yourself if something like this would be possible. This is especially true if you require novice users to install your app with delicate permissions as the ability to install other apps.
To be clear on this, they made the choice to use shared storage instead of using storage protected by androids sandboxing and permission systems. They probably made this choice without knowing that they are effectively allowing other apps access to files of their installer because shared storage has been conflated with external storage options but mainly because they did not evaluate the options they had and the implications of those carefully enough.
Apparently Android 10 improved this somehow (probably by making filesystem permissions work as usual).
There are things intentionally included and things intentionally excluded from the sandbox. App-specific data storage is part of the former, and external storage access is part of the latter (this changed with Android 10, anyhow).
Epic's installer used the external storage
No, it was able to download code and ask a Samsung app store system app to install it. This doesn't work on non-Samsung Android devices, and the exact same confused deputy problem can exist on iOS.