ArticleslgStudy

computer science

XcodeGhost

XcodeGhost is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand XcodeGhost rather than just read about it. In short: XcodeGhost (and variant XcodeGhost S) are modified versions of Apple's Xcode development environment that are considered malware. The software first gained widespread attention in September 2015, when a number of apps originating from China harbored the malicious code.

XcodeGhost — main illustration
XcodeGhost — illustration

Key takeaways

  • XcodeGhost belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect XcodeGhost to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of XcodeGhost from memory before moving on to harder problems.

Reference excerpt

XcodeGhost (and variant XcodeGhost S) are modified versions of Apple's Xcode development environment that are considered malware. The software first gained widespread attention in September 2015, when a number of apps originating from China harbored the malicious code. It was thought to be the "first large-scale attack on Apple's App Store", according to the BBC. The problems were first identified by researchers at Alibaba, a leading e-commerce firm in China. Over 4000 apps are infected, according to FireEye, far more than the 25 initially acknowledged by Apple, including apps from authors outside China. Security firm Palo Alto Networks surmised that because network speeds were slower in China, developers in the country looked for local copies of the Apple Xcode development environment, and encountered altered versions that had been posted on domestic web sites. This opened the door for the malware to be inserted into high profile apps used on iOS devices. Even two months after the initial reports, security firm FireEye reported that hundreds of enterprises were still using infected apps and that XcodeGhost remained "a persistent security risk". The firm also identified a new variant of the malware and dubbed it XcodeGhost S; among the apps that were infected were the popular messaging app WeChat and a Netease app Music 163.

Discovery On September 16, 2015, a Chinese iOS developer mentioned on the social network Sina Weibo that malware in Xcode injects third party code into apps compiled with it. Alibaba researchers then published detailed information on the malware and called it XcodeGhost. On September 17, 2015, Palo Alto Networks published several reports on the malware.

Operation

Propagation Because of the slow download speed from Apple servers, Chinese iOS developers would download Xcode from third party websites, such as Baidu Yun (now called Baidu WangPan), a cloud storage service hosted by Baidu, or get copies from co-workers. Attackers took advantage of this situation by distributing compromised versions on such file hosting websites. Palo Alto Networks suspects that the malware was available in March 2015.

Attack vector

Origins

The attacker used a compiler backdoor attack. The novelty of this attack is the modification of the Xcode compiler. According to documents leaked by Edward Snowden, CIA security researchers from Sandia National Laboratories claimed that they "had created a modified version of Apple’s proprietary software development tool, Xcode, which could sneak surveillance backdoors into any apps or programs created using the tool."

Modified files Known versions of XcodeGhost add extra files to the original Xcode application:

Core service framework on iOS, iOS simulator and macOS platforms IDEBundleInjection framework added on iOS, iOS simulator and macOS platforms XcodeGhost also modified the linker to link the malicious files into the compiled app. This step is reported on the compiling log but not on the Xcode IDE. Both iOS and macOS apps are vulnerable to XcodeGhost.

Deployment XcodeGhost compromised the CoreServices layer, which contains highly used features and frameworks used by the app. When a developer compiles their application with a compromised version of Xcode, the malicious CoreServices are automatically integrated into the app without the developer's knowledge. Then the malicious files will add extra code in UIWindow class and UIDevice class. The UIWindow class is "an object that manages and coordinates the views an app displays on a device screen". The UIDevice class provides a singleton instance representing the current device. From this instance the attacker can obtain information about the device such as assigned name, device model, and operating-system name and version.

Behavior on infected devices

Remote control security risks XcodeGhost can be remotely controlled via commands sent by an attacker from a Command and control server through HTTP. This data is encrypted using the DES algorithm in ECB mode. Not only is this encryption mode known to be weak, the encryption keys can also be found using reverse engineering. An attacker could perform a man in the middle attack and transmit fake HTTP traffic to the device (to open a dialog box or open specific app for example).

Stealing user device information When the infected app is launched, either by using an iPhone or the simulator inside Xcode, XcodeGhost will automatically collect device information such as:

Current time Current infected app's name The app's bundle identifier Current device's name and type Current system's language and country Current device's UUID Network type Then the malware will encrypt those data and send it to a command and control server. The server differs from version to version of XcodeGhost; Palo Alto Networks was able to find three server URLs:

http://init.crash-analytics.com http://init.icloud-diagnostics.com http://init.icloud-analysis.com The last domain was also used in the iOS malware KeyRaider.

Read and write from clipboard XcodeGhost is also able, each time an infected app is launched, to store the data written in the iOS clipboard. The malware is also able to modify this data. This can be particularly dangerous if the user uses a password management app.

Hijack opening specific URLs XcodeGhost is also able to open specific URLs when the infected app is launched. Since Apple iOS and macOS work with Inter-App Communication URL mechanism (e.g., 'whatsapp://', 'Facebook://', 'iTunes://'), the attacker can open any apps installed on the compromised phone or computer, in the case of an infected macOS application. Such a mechanism could be harmful to password management apps or even used to facilitate phishing attacks.

Infected apps Among all the Chinese apps, IMs app, banking apps, mobile carrier's app, maps, stock trading apps, SNS apps and games were infected. Popular apps used all over the world were also infected such as WeChat, a popular instant messaging app, CamScanner, an app to scan document using the smartphone camera or WinZip. Pangu Team claimed that they counted 3,418 infected apps. Fox-it, a Netherlands-based security company, reports that it found thousands of malicious traffic sources outside China.

Removal

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with XcodeGhost

Start with the simplest possible case. Write down what XcodeGhost claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to XcodeGhost before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about XcodeGhost ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of XcodeGhost

In research
XcodeGhost appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses XcodeGhost in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
XcodeGhost is common in secondary-school and first-year university syllabi. It links to neighbouring topics Compilers, IOS malware, Malware toolkits, so understanding it makes those chapters shorter.
In everyday life
Look for XcodeGhost outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “XcodeGhost” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study XcodeGhost in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what XcodeGhost means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain XcodeGhost out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is XcodeGhost in simple terms?

XcodeGhost (and variant XcodeGhost S) are modified versions of Apple's Xcode development environment that are considered malware. The software first gained widespread attention in September 2015, when a number of apps originating from China harbored the malicious code.

Why does XcodeGhost matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study XcodeGhost?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on XcodeGhost.

Tags

  • Compilers
  • IOS malware
  • Malware toolkits
  • Mobile malware
  • Software development
  • Trojan horses

Keep exploring