Apple's China-Friendly Censorship Caused An iPhone-Crashing Bug (wired.com)
Security researcher Patrick Wardle helped Apple fix a bug that would crash apps displaying the word "Taiwan" or the Taiwanese flag emoji. Some iPhones could be remotely crashed by something as simple as receiving a text message with the Taiwanese flag. Apple confirmed the fix in a security update Monday. Wired reports: "Basically Apple added some code to iOS with the goal that phones in China wouldn't display a Taiwanese flag," Wardle says, "and there was a bug in that code." Since at least early 2017, iOS has included that Chinese censorship function: Switch your iPhone's location setting to China, and the Taiwanese flag emoji essentially disappears from your phone, evaporating from its library of emojis and appearing as a "missing" emoji in any text that appears on the screen. That code likely represents a favor from Apple to the Chinese government, which for the last 70 years has maintained that Taiwan is a part of China and has no legitimate independent government.
But Wardle found that in some edge cases, a bug in the Taiwan-censorship code meant that instead of treating the Taiwan emoji as missing from the phone's library, it instead considered it an invalid input. That caused phones to crash altogether, resulting in what hackers call a "denial of service" attack that would let anyone crash a vulnerable device on command. Wardle's still not sure how many devices are affected, or what caused that bug to be triggered only in some iOS devices and not others, but he believes it has something to do with the phone's location and language settings. Wardle has more details of the bug on his blog.
But Wardle found that in some edge cases, a bug in the Taiwan-censorship code meant that instead of treating the Taiwan emoji as missing from the phone's library, it instead considered it an invalid input. That caused phones to crash altogether, resulting in what hackers call a "denial of service" attack that would let anyone crash a vulnerable device on command. Wardle's still not sure how many devices are affected, or what caused that bug to be triggered only in some iOS devices and not others, but he believes it has something to do with the phone's location and language settings. Wardle has more details of the bug on his blog.
Pseudo code for those of you not familiar with Objective C. ...
locale currentLocale = CFLocaleCopyCurrent();
string countryCode = CFLocaleGetValue(currentLocale, kCFLocaleCountryCode);
if countryCode == "CN" then
If in your phone's configuration no current region is set (region-less configuration) then CFLocaleGetValue will return a null pointer. And thus when the code tries to compare the 'C' with the first character in countryCode, it crashes with a null pointer dereference.
the [People Republic of China] government, which for the last 70 years has maintained that Taiwan is a part of China and has no legitimate independent government.
And Taiwan's government has the exact same opposite position, maintaining that they are the only legitimate government of China. Both government consider there is only one China, and that its territory contains mainland and Taiwan island.
The Taiwanese Flag is also the Chinese National Flag... pre-Communist revolution. The Taiwanese government claims continuity with the pre-Communist government. Hence, to mainland China, it is very much like Delaware wanted to keep flying the Union Jack in 1830.
Your ad here. Ask me how!