Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MacRumors

macrumors bot
Original poster
Apr 12, 2001
63,279
30,340



Following last week's disclosure of new iOS malware called XcodeGhost, which arose from malicious versions of Xcode hosted on third-party servers, Apple has outlined instructions for developers to ensure the version of Xcode they are using is valid.

XcodeGhost-Featured1.jpg

When downloading Xcode from the Mac App Store, or Apple's website so long as Gatekeeper is enabled, OS X automatically checks the app's code signature and validates it against Apple's code. If you must obtain Xcode elsewhere, follow these steps:
To verify the identity of your copy of Xcode run the following command in Terminal on a system with Gatekeeper enabled:
spctl --assess --verbose /Applications/Xcode.app

where /Applications/ is the directory where Xcode is installed. This tool performs the same checks that Gatekeeper uses to validate the code signatures of applications. The tool can take up to several minutes to complete the assessment for Xcode.

The tool should return the following result for a version of Xcode downloaded from the Mac App Store:
/Applications/Xcode.app: accepted
source=Mac App Store

and for a version downloaded from the Apple Developer web site, the result should read either
/Applications/Xcode.app: accepted
source=Apple

or

/Applications/Xcode.app: accepted
source=Apple System

Any result other than 'accepted' or any source other than 'Mac App Store', 'Apple System' or 'Apple' indicates that the application signature is not valid for Xcode. You should download a clean copy of Xcode and recompile your apps before submitting them for review.
Apple issued a statement in response to XcodeGhost over the weekend, noting that it has removed all infected apps it is aware of from the App Store and is working with developers to ensure they are using a legitimate version of Xcode.
"We've removed the apps from the App Store that we know have been created with this counterfeit software. We are working with the developers to make sure they're using the proper version of Xcode to rebuild their apps."
XcodeGhost affected dozens, and possibly hundreds, of App Store apps. iPhone, iPad and iPod touch users should read what you need to know about XcodeGhost to learn more about the malware and how to keep yourself protected.

Article Link: Apple Outlines Steps for Developers to Validate Xcode Following Malware Attack
 

Kissaragi

macrumors 68020
Nov 16, 2006
2,340
370
Good that apple are helping devs but how do we know as users that we are downloading safe apps in future?
 
  • Like
Reactions: macs4nw

Lennholm

macrumors 65816
Sep 4, 2010
1,003
210
I get /Applications/Xcode.app: a sealed resource is missing or invalid
What does that mean?
 

nagromme

macrumors G5
May 2, 2002
12,546
1,196
Band-Aid achieved. But it shouldn't be possible to do this in the first place--it's a security hole and one that could have been expected. Maybe have iTunes Connect only accept submissions from an unmodified Xcode? I'm not sure this is at all simple to implement, but I'm sure it's important to do so

Developers are to blame too--especially multi-person companies should know better. But the platform should still be protected from developers making mistakes--or being attacked in other as-yet-unknown ways that might make it possible to secretly modify their Xcode. After all, it's possible to choose to bypass the Mac's security features (like Gatekeeper), and some people have reasons to do so. Further checks from Apple's remote end are called for, I think.
 

jasnw

macrumors 65816
Nov 15, 2013
1,012
1,048
Seattle Area (NOT! Microsoft)
On a tangent, but a strongly related one, what's to keep whomever put the malicious Xcode out on Baidu in the first place from having a house stable of devs building malicious apps using their own Xcode? From what I've read, Apple was unable to catch these apps from being borked in the first place. I've long had a healthy skepticism about accessing any critical (financial, medical, etc) websites from a mobile device, now I'm positively paranoid about it.
 

Mascots

macrumors 68000
Sep 5, 2009
1,665
1,415
Funny because I was reading some things by Ken Thompson the other day.
 

AdeFowler

macrumors 68020
Aug 27, 2004
2,317
361
England
So Apple have removed all of the infected Apps from the app store.

My problem however, is that the version of Mercury browser that I have, was replaced by the version with IAPs. I really need to know if the version I'm using is infected. Needless to say I've contacted the developers but haven't heard from them yet.
 
  • Like
Reactions: S G

SmoMo

macrumors regular
Aug 20, 2011
218
21
"Following last week's disclosure of new iOS malware called XcodeGhost, which arose from malicious versions of Xcode hosted on third-party servers, Apple has outlined instructions for developers to ensure the version of Xcode they are using is valid."


Step 1: Download Xcode from Apple.com


Congratulations, you now have a genuine version of Xcode ;)

This will only work if you can trust that there is no-one between you and apple.com.
I think there maybe a certain degree of naivety in the explanation for why so many Chinese developers have ended up with a modified version of Xcode.
 

SmoMo

macrumors regular
Aug 20, 2011
218
21
On a tangent, but a strongly related one, what's to keep whomever put the malicious Xcode out on Baidu in the first place from having a house stable of devs building malicious apps using their own Xcode? From what I've read, Apple was unable to catch these apps from being borked in the first place. I've long had a healthy skepticism about accessing any critical (financial, medical, etc) websites from a mobile device, now I'm positively paranoid about it.

I think that this is much less of a problem because each Developer needs to create an Apple account, and this process involves some degree of identity checking from Apple

Secondly, if a single Developer submits multiple Apps, and a single one is found to be malicious then it is easy for Apple to instantly remove all Apps by this Developer.

Thirdly, I think we are seeing a list of roughly 50 Apps so far. What we don't know yet is how many Apps were submitted but didn't get through the Apple submission process.
If this is 50 out of 50,000 Apps then it is clear that the creators of the malicious code would not be able to develop and publish 50,000 Apps all by themselves.
 
  • Like
Reactions: Keane16

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
This is a tricky situation. A manual fix is not a good solution, not all devs will do this or care about it. They need something besides Xcode that validates itself, and can't rely on a web service doing this since data sent can be faked. I think a real solution is to add an OS-level check that ensures Xcode.app originated from Apple, and disallow any other app with that name from running otherwise.
 

Periastron

macrumors member
May 29, 2010
38
43
The Canadas
I get /Applications/Xcode.app: a sealed resource is missing or invalid
What does that mean?
It could mean a lot of things. There could be something missing from the application bundle, something that isn't supposed to be there, or something that has been altered in an unexpected way.

I got that message, but I had copied the MacOSX10.10.sdk from Xcode 6.4 into the SDKs directory inside Xcode 7. When I moved that SDK out of the Xcode 7 bundle, spctl reported the 'accepted' message.
 

JackANSI

macrumors 6502a
Feb 3, 2011
558
413
As hard as I am on Apple and their army of eyes-closed, head-nodding consumers, I find it interesting that the platform is secure enough that one of the attack vectors is to distribute a hacked copy of Xcode to sneak your malware in through the "front door".

That said there has to be some way of boiling down the Xcode app fingerprint down into secure signature that is submitted with the app to make this harder in the future.
 
  • Like
Reactions: V.K.

Thunderhawks

Suspended
Feb 17, 2009
4,057
2,118
Band-Aid achieved. But it shouldn't be possible to do this in the first place--it's a security hole and one that could have been expected. Maybe have iTunes Connect only accept submissions from an unmodified Xcode? I'm not sure this is at all simple to implement, but I'm sure it's important to do so

Developers are to blame too--especially multi-person companies should know better. But the platform should still be protected from developers making mistakes--or being attacked in other as-yet-unknown ways that might make it possible to secretly modify their Xcode. After all, it's possible to choose to bypass the Mac's security features (like Gatekeeper), and some people have reasons to do so. Further checks from Apple's remote end are called for, I think.

You will never be able to outsmart dumb people.
There will always be ways people will figure out to get around something that annoys them.

So, in that case developers were annoyed by the long download times and figured out to go to another site.

About the only thing bothersome here is how this passed Apples screening of apps. My guess is that if an app was okay the first time from a certain developer, s/he got a pass "as an update" and was not put through all the testing they normally do.

I'd also show a yellow card to developers who bypass Apples XCODE system and flash RED if they do it again and they would be out.
 

Macneck

macrumors regular
Oct 17, 2012
123
129
So Apple have removed all of the infected Apps from the app store.

How many millions iOS apps in the App Store? My problem are not the apps they already identified and supposedly removed... Something they did after some third party exposed the problem. Now I wonder if similar types of infections may have happened in hundreds of the millions of apps in the store. Is only good faith the solution Apple offers to this?
 
  • Like
Reactions: JackANSI
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.