Live data from Hacker News

Validating Your Version of Xcode

developer.apple.com

11–20 of 101 posts

Re: Validating Your Version of Xcode

#11
post #8

Am I understanding this correctly: the devs who downloaded Xcode from an unknown source disabled gatekeeper to get it to run? That's unbelievably stupid dev behavior, if true.

They downloaded Xcode from somewhere besides Apple. How much more clue do you need about their stupidity.

Re: Validating Your Version of Xcode

#12
post #6
post #2

So, the next Trojan version of Xcode also needs to replace or corrupt spctl. I should look at it (on iPad currently), but it seems like the right combination of a custom Certificate Authority added to the keychain and signing your malicious Xcode with a certificate signed by the CA would help. Maybe also change the quarantine metadata on the file?

One should of course verify its integrity BEFORE installing it and letting it replace spctl. The real question is whether the spctl tool displays "Apple" in case of a valid (relative to generic CAs) certificate issued to "Apple". Hopefully that's not the case. Another risk is a specifically designed executable capable of compromising spctl.

On machines with Gatekeeper enabled you won't be able to open the application without it verifying the signature. Devs would have to on purpose remove that protection to run this bad version of Xcode, and after that it is practically game over.

Re: Validating Your Version of Xcode

#13
post #8

Am I understanding this correctly: the devs who downloaded Xcode from an unknown source disabled gatekeeper to get it to run? That's unbelievably stupid dev behavior, if true.

I don't think having Gatekeeper disabled is a very big deal. It's one of the first things I disable on a new Mac. I've never had it stop an actual piece of malware, and it triggers false positives on practically everything.

That said, I have no idea why anybody would download XCode from a third party...

Re: Validating Your Version of Xcode

#14
post #3
post #2

So, the next Trojan version of Xcode also needs to replace or corrupt spctl. I should look at it (on iPad currently), but it seems like the right combination of a custom Certificate Authority added to the keychain and signing your malicious Xcode with a certificate signed by the CA would help. Maybe also change the quarantine metadata on the file?

> seems like the right combination of a custom Certificate Authority added to the keychain and signing your malicious Xcode with a certificate signed by the CA would help nope. Gatekeeper only accepts certificates issued by Apple. The trojan would have to patch gatekeeper itself which will be difficult once people upgrade to 10.11 and keep the System Integrity Protection enabled. Even with all the bad feelings about…

I think this Tech Note says otherwise. It talks about Enterprise being able to manage code signing outside of Apple, and I believe it says with admin privileges a user can mark a CA as valid for code signing. I think code signing is voodoo for most developers, and therefore believe you could fool most of them into accepting the change if an appropriately worded dialog preceded it.

https://developer.apple.com/library/mac/technotes/tn2206/_in...

Re: Validating Your Version of Xcode

#15
post #8

Am I understanding this correctly: the devs who downloaded Xcode from an unknown source disabled gatekeeper to get it to run? That's unbelievably stupid dev behavior, if true.

I don't think having Gatekeeper disabled is a very big deal. It's one of the first things I disable on a new Mac. I've never had it stop an actual piece of malware, and it triggers false positives on practically everything. That said, I have no idea why anybody would download XCode from a third party...

> That said, I have no idea why anybody would download XCode from a third party...

Easily explainable really. Went to [their favorite search engine], searched for "Xcode download" and clicked the first result which may not be from Apple (or an advertising).

Re: Validating Your Version of Xcode

#16
post #8

Am I understanding this correctly: the devs who downloaded Xcode from an unknown source disabled gatekeeper to get it to run? That's unbelievably stupid dev behavior, if true.

I don't think having Gatekeeper disabled is a very big deal. It's one of the first things I disable on a new Mac. I've never had it stop an actual piece of malware, and it triggers false positives on practically everything. That said, I have no idea why anybody would download XCode from a third party...

Apparently downloads from Apple in China are very slow. So it's common practice to get it from a p2p network instead. I can totally understand it, but wouldn't do it myself (I think)

Re: Validating Your Version of Xcode

#17
post #8

Am I understanding this correctly: the devs who downloaded Xcode from an unknown source disabled gatekeeper to get it to run? That's unbelievably stupid dev behavior, if true.

Disabling gatekeeper is not uncommon, and was really common early on as many applications were not signed yet.

Downloading Xcode from a third party, now that's stupid.

Re: Validating Your Version of Xcode

#18
post #8

Am I understanding this correctly: the devs who downloaded Xcode from an unknown source disabled gatekeeper to get it to run? That's unbelievably stupid dev behavior, if true.

This was done in China and happened with the Chinese version of the App Store. In all honesty, like many things on the Chinese web it's likely difficult to find these resources.

Baidu isn't a very effective search engine and there are tons of people trying to get their mitts on user data including the government themselves.

Re: Validating Your Version of Xcode

#19
post #5
post #2

So, the next Trojan version of Xcode also needs to replace or corrupt spctl. I should look at it (on iPad currently), but it seems like the right combination of a custom Certificate Authority added to the keychain and signing your malicious Xcode with a certificate signed by the CA would help. Maybe also change the quarantine metadata on the file?

I can't remember if Xcode asks for admin privileges or not when you install it... ...mind you, I guess that doesn't matter. If I unknowingly had a hacked version and it prompted me for my password at install, I would enter it.

It does — it requires root to agree to the XCode license:

https://stackoverflow.com/questions/26197347/agreeing-to-the...

This seems to even be required to run things like the stock git or gcc, which I've always wondered how that isn't a violation of the GPL.

Re: Validating Your Version of Xcode

#20
post #8

Am I understanding this correctly: the devs who downloaded Xcode from an unknown source disabled gatekeeper to get it to run? That's unbelievably stupid dev behavior, if true.

If you're living in the land of gray-market computers/software, you'll never have gatekeeper installed to begin with. It's likely that the devs had disabled gatekeeper for other reasons - to run versions of local software also unsigned by Apple for lack of a (paid) Official Apple Developer Account.
Post reply on HN