Code Released To Exploit Android App Signature Vulnerability
chicksdaddy writes with news of a Proof-of-Concept exploit for the recent Android APK signature vulnerability. From the article: "Pau Oliva Fora, a security researcher for the firm Via Forensics, published a small, proof of concept module on GitHub that exploits the flaw in the way Android verifies the authenticity of signed mobile applications. The flaw was first disclosed last week by Jeff Forristal, the Chief Technology Officer at Bluebox Security, ahead of a presentation at the Black Hat Briefings in August. ... The simple program leverages APKTool, an open source tool for reverse engineering Android applications — decompiling and then recompiling their contents. His script allows a user to select and then decompile a legitimate Android application and then recompile it, creating an altered, 'malicious' APK that will have the same, cryptographic signature as the original file. In an e-mail statement, Google said that a patch for Forristal's vulnerability was provided to Google's OEM and carrier partners in March, and that some (Samsung) have already shipping a patched version of Android to customers. However, that response hasn't been universal — a reflection of Android's fragmented install base."
This simplifies the generation of a hostile patch but, unless I'm mistaken, this still requires injecting the hostile patch into the Play Store via a trusted account or by convincing some sap to side load it.
Gee, 3rd party stores in China and Russia being completely lax on security matters? Go figure.
Their is a big difference between OS vendors' attitudes toward mobile devices and desktop/laptop computers. Many phones will never get - or even be able to run - the newer versions of Android that will have this flaw patched. Desktops & laptops get much longer support for their OS's.
Yes, I know some Apple computers can't run the latest and greatest anymore. That's due to a hardware architecture change that took place several years ago.
There's only one solution for a malicious APK.
We need a custom HOSTS file ...
From a previous AC comment:
APK's are signed with what amounts to the normal jar signing process. So either they have found a way to create a hash collision, or there's some other bug in the verification process that allows some unsigned code to be included in the file and executed.
Either way, you will still need to trick people into installing your version of the apk.
My guess is this: android just checks the first files matching in the jar/zip for the names, but installs the files found last in the jar(or vice versa, zip files can have multiples of the same filename).
http://threatpost.com/android-vulnerability-enables-malicious-updates-to-bypass-digital-signatures/
“Users need to be cognizant of the source of applications they’re installing and trustworthiness of the source of APKs if they’re not installing from Google Play,” Forristal said. “If you don’t know where the APK came from, it’s no different than grabbing .exes from the Net. Make sure you’re not using apps from untrusted sources and stick to Google Play; Google mentioned it has inoculated Google Play looking for applications using this bug and those should not appear in Google Play.”
So, if a dev signs his app, as a way of guarantee that nothing from his compiler to user's phone tangled with it...
What is to say nobody on Google's side wont modify it?
Why would it being on AppStore be any more credible (in light of everything) than just a dev publishing it somewhere together with the digital fingerprint on his website?
What am I missing?
Add your exploit code to an existing apk without removing the original items, creating a zip file with duplicate entries. The original files match the signature, the duplicates are executed after installing.
09F91102 no, 455FE104 nope, F190A1E8 uh-uh, 7A5F8A09 that's not it, C87294CE no. Ah! 452F6E403CDF10714E41DFAA257D313F.
to people who want to use the exploit to compromise your phone. It's not helpful to Android users or to legitimate developers.
If by "lurk in the shadows" you mean "write a little Python script for a Raspberry Pi tucked behind a chair at your local Starbucks", and by "with a complete set of compromised copies of everything in the Google PlayStore" you mean "have the script be able to inject malicious code dynamically into an any APK in a few milliseconds", and by "sniffing in hopes of intercepting someone's traffic" you mean "running a persistent ARP spoofing attack that routes all external traffic across the network through said RaPi 24/7", and by "quickly to insert a compromised copy of something midstream with a man-in-the-middle attack" you mean "implement basic automated intercepting proxy functionality such as is common in dozens of existing tools"... then yes.
I don't think you realize how easy this kind of thing would be. Computers are tiny, silent, wireless, innocuous, and cheap these days. They are more than capable of modifying a typical APK in flight without introducing a human-noteworthy amount of latency. They can gain a MitM position easily an hold it for as long as the network stays up.
Yeah, those who stick to their cellular networks for app downloading are better off (unless there's a femtocell on that network and the attacker has access to it...) but for a few hours of hacking and less than $50 per location counting WiFi adaptor, you could catch a lot of people using WiFi on their phones.
There's no place I could be, since I've found Serenity...
Google said that a patch for Forristal's vulnerability was provided to Google's OEM and carrier partners in March, and that some (Samsung) have already shipping a patched version of Android to customers. However, that response hasn't been universal — a reflection of Android's fragmented install base."
It's nice that Google's OEM and carrier parters are getting a patch but what's their mechanism for distributing the patch to the installed base of Donut, Eclair, Froyo, Gingerbread, Ice Cream Sandwich and Jelly Bean users in the field who would like their phones to not be infected with malware? And does it affect Kindles and other systems running on Android forks?
It seems that most Android manufacturers don't upgrade major versions for their phones (2.3 to 4.x).
That may make sense because the newer versions may relate to features or power the older phones don't have.
But do the manufs/Google at least offer minor upgrades (2.3.x) for security/backport purposes?
It seems that Google offering a patch which would only go into new Samsung phones is about useless.
I'm not a lawyer, but I play one on the Internet. Blog
What it means is that I can go to the app developer's web site to download the app. For example, if I want VLC, I'll go to VideoLAN to get VLC. The only way this signature vulnerability would affect me is if the app developer's web site is itself compromised.
One method is Google Play Services. I've noticed that even on a 2.2 device, the app formerly known as Android Market installed a new application called "Google Settings" and an .apk file handler called "Verify and Install". Apparently app verification, introduced alongside Android 4.2, is some subset of the "bouncer" that Google uses to reject applications exhibiting the most common malicious behaviors, and Google could easily update it to reject .apk files that include two files with the same name.
If you're thinking about how this could be exploited by tricking people into downloading a malicious app, you're thinking about it the wrong way. The greatest danger of this exploit is that it could be used to access the "private" data of any device you have access to. Android will not allow you to install a new version of an app over adb (think USB console) unless the signatures match. To install a malicious version of an app, you'd normally have to uninstall the old version, deleting its data with it. But using this exploit, you could install a version of the app that would reveal the data. So now a stolen phone is not just a stolen phone; its potentially a stolen identity.
You're correct - a custom hosts file can block that out, no questions asked. "You can't get burned if you can't touch the flame" so-to-speak! Yes - You also can load even load up a custom hosts file on Android os bearing smartphones you know, using adb (Android Debugging Bridge) & its "pull" command - easily.
I'd recommend using a smaller 'optimized' hosts file and yes producers of them DO put those out!
("Optmized" meaning carrying more current infestors vs. older ones that might be using "FastFlux" or Dynamic DNS faults, since they're larger & space on Android's not exactly 'bountiful' imo, but less line entry records overall from over time).
* You end up with the same list of benefits I enumerate in the link below (where my custom hosts file import/normalize-depuplicate/sort/create program is) - & I do, as-per-my-usual, challenge ANY "naysayers" to disprove my points on custom hosts files' value to end users in better added speed, security, reliability, & yes, even anonymity to an extent as well Nobody can, or ever does - it is, clearly impossible: It's not my fault these naysayer trolls, usually by ac posts, are easy to outthink! It's too easy to do, every single time for me. Their trollish reactions though? They're even funnier - "just when trolls thought they 'know it all', along comes me to school them", lol!
APK
P.S.=> However, since you're modded "funny"? Then, I can be a lot funnier & challenge you to disprove the enumerated list of points regarding the good benefits custom hosts files give end users of them in added speed, security, reliability, & even anonymity(to an extent vs. dns request logs + dnsbl's) in the link below :
http://start64.com/index.php?option=com_content&view=article&id=5851:apk-hosts-file-engine-64bit-version&catid=26:64bit-security-software&Itemid=74
... apk
My "latest schooling" of Ash-Fox on DNS servers vs. Hosts files (which the latter gets you past the former's security shortcomings) -> http://news.slashdot.org/comments.pl?sid=3929071&cid=44223687
* :)
That serves as a "prime example" of what I meant by "naysayer trolls" - especially when that dolt came in saying "I got the better of you APK" essentially - so much for that!
Well, that link above shows the truth of that, & it wasn't he who ended up on top... I did!
(On several grounds (including more power consumption, resources usages of all types, & more (like DNS faults listed there that yes, custom hosts files overcome, easily!))).
So, thus - As usual, I've just GOTTA say it, as-is-per-my-inimitable style: This? This was just "too, Too, TOO EASY - just '2ez'" & always is, vs. those coming in saying they 'schooled me' & I just re-annihilate them as I did in the link above!)
APK
P.S.=> Funnier still? I submitted a story on AdBlock everyone online is putting up (Especially since AdBlock doesn't do a 10th of what custom hosts files can adding more speed, security, reliability, & even anonymity to an extent for users of them) to this site yesterday - guess what?
It got REJECTED (gosh, doing an "NSA 'damage control'" suppression of information or what, morons? Too obvious!):
http://slashdot.org/submission/2783319/adblock-getting-paid-by-google-to-allow-their-ads
Not only was it rejected, but it was REMOVED from the submissions page even though it's valid...
Please - lmao: Can you "Open SORES" idiots be any more transparently STUPID or what? Your 'suggestion' to use AdBlock here, nigh constant, FAILS vs. my points (and, you all know it - especially since the makers of AdBlock "souled-out" they way they have)
... apk
HTTP can be cached easily
Resources served over HTTPS, such as style sheets, scripts, and images, can be cached just as easily by the client as resources served over HTTP. Yes, I'm aware that some web browsers disregard far-future Expires dates and exclude from disk cache so as not to leak HTTPS resources to other applications that can access the same file system. On the other side of a connection, the server can and ideally does cache portions of dynamic pages that seldom change. For example, some of the modules on Phil's Hobby Shop are generated once every 20 minutes or so, and the site map is updated about once a day.
But neither of those is particularly applicable to downloads of a large (multiple megabytes), relatively static resource such as an APK file. The server's operator can choose to let a CDN close to the client cache large downloads so that the packets making up the download doesn't have to go through quite as many transit links. Or by "caching" are you referring specifically to a transparent proxy operated by the client's ISP?
and doesn't require processing overhead for the encryption
Are you referring to the client side of the connection or the server side? On the client slide, mobile devices have been able to decrypt in real time since at least the release of the original iPhone. If you're referring to a battery life hit, I imagine that a lot of users spend more megabytes browsing Facebook than downloading or updating applications, and Facebook already has to be encrypted in order not to leak the user's session cookie to users of Firesheep. And if your server's CPU can encrypt as fast as its network interface can shoot out packets, there's little noticeable overhead. TLS might be expensive when you're rapidly handshaking to create new connections, but there aren't quite as many new connections when bulk-encrypting APK file downloads sized in the multiple megabytes.
Please see my detailed reply to smash.
It's kind of interesting to me how what we've seen with the rise of the app store model has largely mirrored what we've seen in the "real world" post-9/11. It hasn't quite been simultaneous, but pretty close.
What I mean is that a lot of people love the app store model and always say how it's "safer". Especially when talking about Apple, you have a gatekeeper checking on the safety of apps, to at least some degree. They ensure what gets through won't hurt you (in theory... but, to be fair, they do pretty well in practice too).
However, there's a cost: at least some decrease in "freedom". Not just anyone can throw an app out to the world of iOS users. If Apple doesn't like your app for any reason, you don't get to distribute to (most) iOS users. Sure, there's jailbreaking and Cydia and all of that, but let's be honest: that's a pretty small percentage of more technically-oriented users. For *most* iOS users, your app doesn't exist if Apple doesn't want it to.
The Android model is the opposite or course: there is virtually no barrier to entry. It's very easy to get into the Play store whether your app is "safe" or not. Oh, they're doing some checks now, but at the end of the day I think even us Android fans acknowledge that it's still more or less a wild west environment. And that says nothing of side-loading either: if you don't get in the store, or don't want to, no big deal, you can still distribute directly to users. Flipping a setting in options isn't the same as jailbreaking so you aren't limited to just "technical" users.
Post-9/11, people seem to be willing to give up some degree of freedom for safety (whether that safety is just perceived or not is a whole other discussion). No, not everyone of course, and yes, there's limits to what people will accept. But, aren't we seeing those bounds pushed more and more every day? Hasn't Snowden showed us that a large chunk of the American population is more than happy to give up privacy to at least *feel* safer?
It's no different in the app world. Lots of people swear by the closed, "walled garden" approach of Apple. They claim it's safer and the quality is better. Well, the former is fairly easy to show, the later is highly subjective, but what's obvious in either case is that there's a decrease in freedom. You may see the tradeoff as worth it. That's your call. People love Apple whether I do or not and I'm not going to try and convince them they're wrong. There's pluses and minuses to both approaches. But at the end of the day, Apple is, at least in part, deciding what you can and can't install on you device.
It's just interesting to me how people in both situations seem so willing to say "eh, make me safer, or at least make me THINK I'm safer, and you can have some measure of control over what I do". How that's acceptable to ANY American in either case is beyond me frankly and I think it shows that our societal values have eroded tremendously. Sure, yes, Apple controlling what apps I can install on my phone is VASTLY different from the TSA patting me down to ensure I don't bring a bomb on a plane. I dare say nobody's life is at stake because Apple decides I used the word cock one too many times in my app. But the fundamental concept is the same: safety in exchange for freedom.
But, underneath both is the same warped thinking: someone else is better suited to keeping you safe than YOU are. It's someone else' responsibility to keep you safe. Someone else can make decisions for you because you are unable or unwilling to do so. Yes, I'm saying you're opinion on the walled garden app store model vs. the Android "wild west" approach informs your take on society at large and what you are willing to let any government do to you. If you're in the Apple camp then you're probably perfectly willing to let the government trample your liberties in exchange for possibly less chance of being killed. The mentality of both is the same. If, on the other hand, you're willing to be responsible for yourself and control your own destiny, the Android approach is probably better-suited to you.
(of course, we'll have a similar discussion about how Google is a data whore above all others and what THAT means, but that's for another day)
If a pion (n-) collides with a proton in the woods & noone is there to hear it, does lamdba decay into the source pa
Furthermore, without any red flags from say, invalid digital certs
Are you talking about an invalid APK signature or an invalid SSL certificate? Because even if the APK signature is successfully forged, forging an HTTPS download would require the attacker to either A. compromise the developer's web server or B. both forge an SSL certificate and MITM the user's Internet connection. I will admit that this is easier with Android 4.x, whose SSL stack supports Server Name Indication, than with Android 2.x, which supports only clear HTTP for sites using name-based virtual hosting.
unless your device has had this flaw patched.
Which is why even 2.x devices are getting "Verify and Install", as I mentioned earlier.
I am, & better than most online, because of this http://start64.com/index.php?option=com_content&view=article&id=5851:apk-hosts-file-engine-64bit-version&catid=26:64bit-security-software&Itemid=74
* Take a read there, especially the enumerated list of benefits you get in added speed, security, reliability, & even anonymity to an extent - you'll know WHY I said what I just did in response to you.
APK
P.S.=> HOWEVER: If you're just being a sarcastic trolls with some trite little phrase (meme b.s., comes & goes like the wind)? Then, as the Chinese say, iirc, to you in reply?? "May you live in interesting times" & as the southeners in the U.S. like to put it "Bless your heart!"... apk