Malicious Xcode could spread via download manager Xunlei

What’s at stake?

We reported last week that popular Chinese iOS apps were compromised in an unprecedented malware attack. We discovered that the source of the infection was compromised copies of Xcode hosted on Baidu Pan. Apple has published an article urging developers to download Xcode directly from the Mac App Store, or from the Apple Developer website and validate signatures. We’ve now discovered that even if a developer uses a download link seemingly from Apple, he might still be possible to obtain a compromised copy of Xcode.

Please note that we do not have evidence that such attacks has happened. But it is an easy attack that anyone can implement.

How does it work?

This compromise happened because of Xunlei. Xunlei is the most popular download manager in China. Much of its popularity is due to the fact they can accelerate download speeds by pulling resources from other Xunlei users as well as cached copies on the Xunlei server. All of this, however, is invisible to users. Users can simply enter a regular http download address into Xunlei  download manager and the download will start. Chinese developers were using direct download addresses such as http://adcdownload.apple.com/Developer_Tools/Xcode_7/Xcode_7.dmg to download Xcode.

Because of Xunlei’s P2P and server cache, download speeds would be much faster than the Mac App Store. Downloading via Xunlei also means that developers do not need to be enrolled in the Apple developer program. Direct downloads of Xcode via the developer program cost $99. Because the URL belongs to Apple, users were tricked into thinking that the download link was authentic and hence the Xcode copy. But in actual fact, the file is not authentic because it comes from Xunlei’s P2P and server cache.

The way to “host” a compromised copy of Xcode on Apple’s server is to trick Xunlei locally and let the error propagate. For example, a malicious user can hijack adcdownload.apple.com locally via host file and download from a non-exsistant URL http://adcdownload.apple.com/xcode-fake-1.1.1.1.dmg. Xunlei will then correlate this URL with the file specified by the malicious user and provide this file to other innocent users.

This is what actually happens when you use Xunlei to download http://adcdownload.apple.com/xcode-fake-1.1.1.1.dmg

But if you look at the details of the download source, you can see that 0% of the download is from the original server (i.e adcdownload.apple.com) while the server cache accounts for 26% and P2P accounts for 3% of the download.

You can also see that attempts by Xunlei to connect to adcdownload.apple.com were redirected to https://developer.apple.com/unauthorized/  because Apple only allows users in the Apple developer program to access the page.

Malicious attackers can poison Xunlei with a URL similar to a real Apple Xcode URL and then post the fake URL on forums and download sites. Most Chinese users by default use Xunlei to download. In fact, they have to if they are not enrolled in the Apple developer program. Most will have a compromised copy of Xcode, seemingly downloaded from Apple.

 

What can developers do to prevent future attacks?

Our suggestions are exactly the same from our last blog post.

  • Always download Xcode from the official Mac App Store. For other developer tools, always download these from official sources.

  • Always check the digital signature of developer tools. It is irresponsible for developers to ignore signature warnings. Xcode clearly should have been signed by Apple; all other versions should have produced user warnings.

  • Separate your development system with your everyday system. Development systems should be used solely for development and not for browsing random sites. If physical separation presents too much of a problem for developers, at the very least, a dedicated user account for development should be used.

 

Xunlei users should be cautious

As demonstrated above, Xunlei cannot be trusted to download the correct file, even if the download link is HTTPS. Users should manually check hash after download or use the browser’s download function.

 

References:

https://v2ex.com/t/222553

 

Comments

More Blog Posts

Subscribe to our mailing list
Show content from Blog | Google+ | Twitter | All. Subscribe to our blog using RSS.

Tue, May 23, 2017

Is China establishing cyber sovereignty in the United States?

Last week Twitter came under attack from a DDoS attack orchestrated by the Chinese authorities. While such attacks are not uncommon for websites like Twitter, this one proved unusual. While the Chinese authorities use the Great Firewall to block harmful content from reaching its citizens, it now uses DDoS attacks to take down content that appears on websites beyond its borders. For the Chinese authorities, it is not simply good enough to “protect” the interests of Chinese citizens at home - in their view of cyber sovereignty, any content that might harm China’s interests must be removed, regardless of where the website is located.

And so last week the Chinese authorities determined that Twitter was the target. In particular, the authorities targeted the Twitter account for Guo Wengui (https://twitter.com/KwokMiles), the rebel billionaire who is slowly leaking information about corrupt Chinese government officials via his Twitter account and through his YouTube videos. Guo appeared to ramp up his whistle-blowing efforts last week and the Chinese authorities, in turn, ramped up theirs.

via https://twitter.com/KwokMiles/status/863689935798374401

Mon, Dec 12, 2016

China is the obstacle to Google’s plan to end internet censorship

It’s been three years since Eric Schmidt proclaimed that Google would chart a course to ending online censorship within ten years. Now is a great time to check on Google’s progress, reassess the landscape, benchmark Google’s efforts against others who share the same goal, postulate on the China strategy and offer suggestions on how they might effectively move forward.

flowers on google china plaque

Flowers left outside Google China’s headquarters after its announcement it might leave the country in 2010. Photo: Wikicommons.

What has Google accomplished since November 2013?

The first thing they have accomplished is an entire rebranding of both Google (now Alphabet) and Google Ideas (now Jigsaw). Throughout this blog post, reference is made to both new and old company names.

Google has started to develop two main tools which they believe can help in the fight against censorship. Jigsaw’s DDoS protection service, Project Shield, is effectively preventing censorship-inspired DDoS attacks and recently helped to repel an attack on Brian Krebs’ blog. The service is similar to other anti-DDoS services developed by internet freedom champions and for-profit services like Cloudflare.

Thu, Nov 24, 2016

Facebook: Please, not like this

Facebook is considering launching a censorship tool that would enable the world’s biggest social network to “enter” the China market. Sadly, nobody will be surprised by anything that Mark Zuckerberg decides to do in order to enter the China market. With such low expectations, Facebook is poised to usurp Apple as China’s favorite foreign intelligence gathering partner. If the company launches in China using this strategy they will also successfully erase any bargaining power that other media organizations may hold with the Chinese authorities.

Tue, Jul 05, 2016

GreatFire.org now testing VPN speed and stability in China

There is a commonly held belief in China that if you have a VPN that works then you should keep quiet about it. In terms of freedom of access to information, the problem with this approach is that access to knowledge suddenly is a secret. Today we are launching a project that we hope will destroy that model.

Our newest website, Circumvention Central (CC), aims to provide real-time information and data about circumvention solutions that work in China. Since 2011, we have been collecting data about blocked websites in China and now we will add data about the effectiveness of VPNs and other circumvention tools.

We are launching CC with four main objectives in mind.

Our first objective is to help to grow the number of Chinese who circumvent censorship restrictions in China. By sharing our information and data about these tools, we hope to show a wider audience which circumvention tools are working.

Our second objective is to improve the circumvention experience for users in China by bringing transparency to tool performance. We will measure these tools on speed (how quickly popular websites are loaded) and on stability (the extent to which popular websites load successfully).

Sat, May 07, 2016

The New York Times vs. The Chinese Authorities

Could the New York Times be setting the best path forward for news organizations in China?
Subscribe to our blog using RSS.

Comments

Great article. Thanks for sharing this. Hope you continue providing useful posts like this.

Happy Diwali 2015

I think reading the article on the web that is very useful especially in this website , its very interesting article because it can broaden my thanks :)solutions of prevention and treatment of diseases with herbs AgaricPro, Obat Penyakit Asam Urat and Obat Penyakit Hernia

I think reading the article on the web that is very useful especially in this website , its very interesting article because it can broaden my thanks :)solutions of prevention and treatment of diseases with herbs AgaricPro, Obat Penyakit Asam Urat and Obat Penyakit Hernia

You love PlayBox HD App

Intetesting point on xunlei. It lacks origin integrity checking (normally a big part of p2p). The problem is Xcode dpwnloads take ages as Apple does not provide it from a cdn within China. Maybe Apple themselves need to look at such a peer-to-peer accelerator.

Intetesting point on xunlei. It lacks origin integrity checking (normally a big part of p2p). The problem is Xcode dpwnloads take ages as Apple does not provide it from a cdn within China. Maybe Apple themselves need to look at such a peer-to-peer accelerator.

I enjoyed this article because it is not including worthless information .The author clearly describes the information.
Thank you for sharing this types article.I am waiting for next article.I recommended the custom essay writing service
(http://buyessays.com) for new essay writing tips.

Well written. Great post. Continue posting useful articles like this.

http://techuloid.com/merry-christmas-2015-images-wishes-quotes-pictures-...

Awesome post. Thanks for sharing this informative article. Continue good work.

http://updatescolony.com/64th-miss-universe-2015-live-preview-broadcast-...

Informative post. Thanks for sharing. Hope you Continue posting useful contents.

http://updatescolony.com/happy-new-year-2016-wishes-images-greetings-quo...

Well Written. Great share and thanks for posting such useful articles.

http://techuloid.com/happy-new-year-2016-wishes-quotes-images-greetings-...

Your tips is quite unique. I appreciate the info on your web site. Thanks a lot for sharing!

http://www.goldenglobeawards2016lives.com/

Great post. Thanks for sharing. Hope you Continue posting useful informations.

http://www.happynewyear2016m.com/

Nice post. Thanks for sharing. Hope you Continue posting useful informations.

http://goldenglobeawards2016livestream.com/

Justin Bieber Tickets 2016 || Justin Bieber Concert is back with his long awaited 2016 album Purpose concert tour across the U.S. and Canada. Don’t miss Justin Bieber Concert 2016 and stay with us for tour dates, event details & tickets updates.

Justin Bieber Tickets
http://justinbieberconcert.co/

I would like announce for music lover especially Justin Bieber diehard fan, I think you already guessed it. Yep!! Absolutely right, Justin Bieber concert are coming soon. Who are missed previous concert this time they will must participate this program. Justin Bieber Tickets 2016 are available if you don’t want to miss this mesmerizing concert just collect your ticket. If you are true fan of Justin Bieber, must know about his biography.

The Golden Globes nominations reveal follows two other such announcements this week. As Gossip Cop reported, the 2016 Grammy Awards nominees were unveiled on Monday. And on Wednesday, the Screen Actors Guild revealed the 2016 SAG Awards nominees.

Golden Globe 2016 Live Stream. The 73rd annual Golden Globes Awards Open ceremony Live Stream by The Hollywood Foreign Press, On January 10, 2016 from Beverly Hilton Hotel.

Welcome to 2016. The Golden Globe Awards Live Stream Presentation of the 73rd Annual Announces fixed Key Dates for 2016 Ceremony, It will air at 5 p.m. PT/8 p.m. ET live on NBCfrom the Beverly Hilton, and The Red Carpet Begins at 4 PM EST. Golden Globe Awards Live Stream Awards start at 8 PM.

The Golden Globe Awards Live Stream will take place at the Beverly Hilton Hotel on January 10. But first, the nominees must be announced! The nominations live stream is expected to begin at 8:15 a.m. Eastern Time. Stay tuned! Angela Bassett, Chloe Grace Moretz, Dennis Quaid, and America Ferrera will all participate in the event, revealing the nominees in more than 20 different categories spanning film and television. They’ll be joined by Corinne Foxx, the daughter of Jamie Foxx, who was recently
announced as Miss Golden Globe for the 73rd annual Golden Globes ceremony. Bassett is a Golden Globes winner, as is Ferrera, while Quaid is a former nominee.

NICE THANKING YOU

new year images

How I can speedup my website?
http://www.trickspassion.com/

Great article. Thanks for posting such an useful post. Keep writing more like this.

http://www.royalrumble2016s.com/

Informative article. Thanks for this. Continue posting useful stuffs like this in future

http://www.superbowl2016s.com/

Golden Globe Awards 2016 Live Stream || @ On January 10, 2016 set the date for the 73rd Annual Golden Globe Awards by The Hollywood Foreign Press.

http://goldenglobeawards2016livestream.com/

Your tips is quite unique. I appreciate the info on your web site. Thanks a lot for sharing!

http://egyshellhosting.com/get-your-own-website-only-for-185/

It was well written article and very easy to understand. I wish you very happy new year. if you are looking you are looking for royal rumble results live stream here are very good sites in case you want to visit..if you want to know aboutRoyal Rumble 2016 Live Stream

Thanks for this article. Great share. Keep up your good work.

http://updatescolony.com/best-happy-valentines-day-2016-week-list-quotes...

Wonderful article. Thanks for this informative post. Continue posting great contents.

http://updatescolony.com/super-bowl-2016-live-tv-channels-cbs-online-tea...

Secret codes for mobile phones
http://www.samteck.net

nice article, was able to learn few things, thanks, AirMirror

Friends a very very Happy Chinese New Year 2016 to all of you. Hope this Chinese New Year 2016 will bring a lot of joy and happiness to you and your family.

Pages

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.