China's track record with privacy violations, control of the internet and control of its citizens is well known. But now anyone who has ever visited the country has cause for concern.

Enter China via the border crossing between Xinjiang and Kyrgyzstan, and you're required to hand over your phone -- unlocked. This would obviously lead the owner to expect a little rooting around by officials, but an investigation has found that border officials are actually installing secret spy apps on iPhones and Android phones to scour emails, texts and other data stored on devices.

The investigation -- carried out by the Guardian, the New York Times, Vice and Süddeutsche Zeitung -- reveals details of how tourists' phones are being compromised. Liberated from their owners, handsets are whisked away, and the data gathering app is installed. Once it has done its job, it is supposed to be deleted, but some travellers have discovered traces of the app on their phone.

As part of the investigation, specialists reverse-engineered one such left-behind app, called 蜂采 (Fēng cǎi). The findings are disturbing. As reported by the Guardian:

The app has two main functions: to extract personal and private information from the traveller's device and to search for suspicious files. Analysis shows that the app harvests emails, contact numbers, SMS messages, social media account identifiers and detailed information about the handset, including unique device identifiers. This information is retrieved and sent for storage on a server on the border office's local intranet.

As the app is supposed to be removed from phones, there is nothing to suggest that visitors to China are being track through Fēng cǎi. It does seem, however, that Chinese officials are looking for specific data, and evidence of people access certain information.

In our sample most of the files were extremist material such as Dabiq and Inspire, propaganda magazines produced by Isis and al-Qaida, but there was also other content that the Chinese state appears to deem undesirable. This includes the writings of the Dalai Lama, work on the history and culture of Xinjiang and content critical of China’s involvement in Taiwan.

That China is snooping on visitors will come as no surprise. That it could be so slapdash in exposing what was -- presumably -- meant to be kept secret, however, is rather unusual.

Image credit: Azat Valeev / Shutterstock