{"id":51281,"date":"2024-05-22T04:17:51","date_gmt":"2024-05-22T08:17:51","guid":{"rendered":"https:\/\/www.kaspersky.com\/blog\/?p=51281"},"modified":"2024-05-22T04:17:51","modified_gmt":"2024-05-22T08:17:51","slug":"prevent-android-keylogging-and-ime-spying","status":"publish","type":"post","link":"https:\/\/www.kaspersky.com\/blog\/prevent-android-keylogging-and-ime-spying\/51281\/","title":{"rendered":"What does your Android keyboard tell strangers?"},"content":{"rendered":"<p>\u201cHackers can spy on every keystroke of Honor, OPPO, Samsung, Vivo, and Xiaomi smartphones over the internet\u201d \u2013 alarming headlines like this have been circulating in the media over the past few weeks. Their origin was a rather serious study on <a href=\"https:\/\/citizenlab.ca\/2024\/04\/vulnerabilities-across-keyboard-apps-reveal-keystrokes-to-network-eavesdroppers\/\" target=\"_blank\" rel=\"nofollow noopener\">vulnerabilities in keyboard traffic encryption<\/a>. Attackers who are able to observe network traffic, for example, through an <a href=\"https:\/\/www.kaspersky.com\/blog\/router-malware\/44539\/\" target=\"_blank\" rel=\"noopener nofollow\">infected home router<\/a>, can indeed intercept every keystroke and uncover all your passwords and secrets. But don\u2019t rush to trade in your Android for an iPhone just yet \u2013 this only concerns Chinese language input using the pinyin system, and only if the \u201ccloud prediction\u201d feature is enabled. Nevertheless, we thought it would be worth investigating the situation with other languages and keyboards from other manufacturers.<\/p>\n<h2>Why many pinyin keyboards are vulnerable to eavesdropping<\/h2>\n<p>The <a href=\"https:\/\/en.wikipedia.org\/wiki\/Pinyin\" target=\"_blank\" rel=\"nofollow noopener\">pinyin<\/a> writing system, also known as the Chinese phonetic alphabet, helps users write Chinese words using Latin letters and diacritics. It\u2019s the official romanization system for the Chinese language, adopted by the UN among others. Drawing Chinese characters on a smartphone is rather inconvenient, so the pinyin input method is very popular, used by over a billion people, according to some estimates. Unlike many other languages, word prediction for Chinese, especially in pinyin, is difficult to implement directly on a smartphone \u2013 it\u2019s a computationally complex task. Therefore, almost all keyboards (or more precisely, input methods \u2013 IMEs) use \u201ccloud prediction\u201d, meaning they instantaneously send the pinyin characters entered by the user to a server and receive word completion suggestions in return. Sometimes the \u201ccloud\u201d function can be turned off, but this reduces the speed and quality of the Chinese input.<\/p>\n<div id=\"attachment_51287\" style=\"width: 937px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/media.kasperskydaily.com\/wp-content\/uploads\/sites\/92\/2024\/05\/22041559\/prevent-android-keylogging-and-IME-spying-1.png\"><img decoding=\"async\" aria-describedby=\"caption-attachment-51287\" class=\"size-full wp-image-51287\" src=\"https:\/\/media.kasperskydaily.com\/wp-content\/uploads\/sites\/92\/2024\/05\/22041559\/prevent-android-keylogging-and-IME-spying-1.png\" alt=\"To predict the text entered in pinyin, the keyboard sends data to the server\" width=\"927\" height=\"931\"><\/a><p id=\"caption-attachment-51287\" class=\"wp-caption-text\">To predict the text entered in pinyin, the keyboard sends data to the server<\/p><\/div>\n<p>Of course, all the characters you type are accessible to the keyboard developers due to the \u201ccloud prediction\u201d system. But that\u2019s not all! Character-by-character data exchange requires special encryption, which many developers fail to implement correctly. As a result, all keystrokes and corresponding predictions can be easily decrypted by outsiders.<\/p>\n<p>You can find details about each of the errors found in the <a href=\"https:\/\/citizenlab.ca\/2024\/04\/vulnerabilities-across-keyboard-apps-reveal-keystrokes-to-network-eavesdroppers\/\" target=\"_blank\" rel=\"nofollow noopener\">original source<\/a>, but overall, of the nine keyboards analyzed, only the pinyin IME in Huawei smartphones had correctly implemented TLS encryption and resisted attacks. However, IMEs from Baidu, Honor, iFlytek, OPPO, Samsung, Tencent, Vivo, and Xiaomi were found to be vulnerable to varying degrees, with Honor\u2019s standard pinyin keyboard (Baidu 3.1) and QQ pinyin failing to receive updates even after the researchers contacted the developers. Pinyin users are advised to update their IME to the latest version, and if no updates are available, to download a different pinyin IME.<\/p>\n<h2>Do other keyboards send keystrokes?<\/h2>\n<p>There is no direct technical need for this. For most languages, word and sentence endings can be predicted directly on the device, so popular keyboards don\u2019t require character-by-character data transfer. Nevertheless, data about entered text may be sent to the server for personal dictionary synchronization between devices, for machine learning, or for other purposes not directly related to the primary function of the keyboard \u2013 such as advertising analytics.<\/p>\n<p>Whether you want such data to be stored on Google and Microsoft servers is a matter of personal choice, but it\u2019s unlikely that anyone would be interested in sharing it with outsiders. At least one such incident was publicized in 2016 \u2013 the SwiftKey keyboard was found to be <a href=\"https:\/\/www.androidauthority.com\/swiftkey-suspends-service-data-leak-706680\/\" target=\"_blank\" rel=\"nofollow noopener\">predicting email addresses<\/a> and other personal dictionary entries of other users. After the incident, Microsoft temporarily disabled the synchronization service, presumably to fix the errors. If you don\u2019t want your personal dictionary stored on Microsoft\u2019s servers, don\u2019t create a SwiftKey account, and if you already have one, deactivate it and delete the data stored in the cloud by following <a href=\"https:\/\/support.microsoft.com\/en-us\/topic\/microsoft-swiftkey-keyboard-privacy-questions-and-your-data-07e13677-6b38-4ad0-bad0-d41207cab6de\" target=\"_blank\" rel=\"nofollow noopener\">these instructions<\/a>.<\/p>\n<p>There have been no other widely known cases of typed text being leaked. However, research has shown that popular keyboards actively monitor metadata as you type. For example, Google\u2019s Gboard and Microsoft\u2019s SwiftKey <a href=\"https:\/\/www.scss.tcd.ie\/Doug.Leith\/pubs\/gboard_kamil.pdf\" target=\"_blank\" rel=\"nofollow noopener\">send data about every word entered<\/a>: language, word length, the exact input time, and the app in which the word was entered. SwiftKey also sends statistics on how much effort was saved: how many words were typed in full, how many were automatically predicted, and how many were swiped. Considering that both keyboards send the user\u2019s unique advertising ID to the \u201cheadquarters\u201d, this creates ample opportunity for profiling \u2013 for example, it becomes possible to determine which users are corresponding with each other in <strong>any<\/strong> messenger.<\/p>\n<p>If you create a SwiftKey account and don\u2019t disable the \u201cHelp Microsoft improve\u201d option, then according to the privacy policy, \u201csmall samples\u201d of typed text may be sent to the server. How this works and the size of these \u201csmall samples\u201d is unknown.<\/p>\n<div id=\"attachment_51286\" style=\"width: 646px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/media.kasperskydaily.com\/wp-content\/uploads\/sites\/92\/2024\/05\/22041506\/prevent-android-keylogging-and-IME-spying-2.jpg\"><img decoding=\"async\" aria-describedby=\"caption-attachment-51286\" class=\"size-full wp-image-51286\" src=\"https:\/\/media.kasperskydaily.com\/wp-content\/uploads\/sites\/92\/2024\/05\/22041506\/prevent-android-keylogging-and-IME-spying-2.jpg\" alt='\"Help Microsoft improve\"... what? Collecting your data?' width=\"636\" height=\"793\"><\/a><p id=\"caption-attachment-51286\" class=\"wp-caption-text\">\u201cHelp Microsoft improve\u201d\u2026 what? Collecting your data?<\/p><\/div>\n<p>Google allows you to disable the \u201cShare Usage Statistics\u201d option in Gboard, which significantly reduces the amount of information transmitted: word lengths and apps where the keyboard was used are no longer included.<\/p>\n<div id=\"attachment_51285\" style=\"width: 550px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/media.kasperskydaily.com\/wp-content\/uploads\/sites\/92\/2024\/05\/22041441\/prevent-android-keylogging-and-IME-spying-3.jpg\"><img decoding=\"async\" aria-describedby=\"caption-attachment-51285\" class=\"size-full wp-image-51285\" src=\"https:\/\/media.kasperskydaily.com\/wp-content\/uploads\/sites\/92\/2024\/05\/22041441\/prevent-android-keylogging-and-IME-spying-3.jpg\" alt='Disabling the \"Share Usage Statistics\" option in Gboard significantly reduces the amount of information collected' width=\"540\" height=\"899\"><\/a><p id=\"caption-attachment-51285\" class=\"wp-caption-text\">Disabling the \u201cShare Usage Statistics\u201d option in Gboard significantly reduces the amount of information collected<\/p><\/div>\n<p>In terms of cryptography, data exchange in Gboard and SwiftKey did not raise any concerns among the researchers, as both apps rely on the standard TLS implementation in the operating system and are resistant to common cryptographic attacks. Therefore, traffic interception in these apps is unlikely.<\/p>\n<p>In addition to Gboard and SwiftKey, the authors also analyzed the popular AnySoftKeyboard app. It fully lived up to its reputation as a keyboard for privacy diehards by not sending any telemetry to servers.<\/p>\n<h2>Is it possible for passwords and other confidential data to leak from a smartphone?<\/h2>\n<p>An app doesn\u2019t have to be a keyboard to intercept sensitive data. For example, <a href=\"https:\/\/arstechnica.com\/gadgets\/2020\/06\/tiktok-and-53-other-ios-apps-still-snoop-your-sensitive-clipboard-data\/\" target=\"_blank\" rel=\"nofollow noopener\">TikTok monitors all data<\/a> copied to the clipboard, even though this function seems unnecessary for a social network. Malware on Android often activates <a href=\"https:\/\/www.kaspersky.com\/blog\/android-most-dangerous-features\/49418\/\" target=\"_blank\" rel=\"noopener nofollow\">accessibility features and administrator rights<\/a> on smartphones to capture data from input fields and directly from files of \u201cinteresting\u201d apps.<\/p>\n<p>On the other hand, an Android keyboard can \u201cleak\u201d not only typed text. For example, the AI.Type keyboard caused a <a href=\"https:\/\/www.zdnet.com\/article\/popular-virtual-keyboard-leaks-31-million-user-data\/\" target=\"_blank\" rel=\"nofollow noopener\">data leak for 31 million users<\/a>. For some reason, it collected data such as phone numbers, exact geolocations, and even the contents of address books.<\/p>\n<h2>How to protect yourself from keyboard and input field spying<\/h2>\n<ul>\n<li>Whenever possible, use a keyboard that doesn\u2019t send unnecessary data to the server. Before installing a new keyboard app, search the web for information about it \u2013 if there have been any scandals associated with it, it will show up immediately.<\/li>\n<li>If you\u2019re more concerned about the keyboard\u2019s convenience than its privacy (we don\u2019t judge, the keyboard is important), go through the settings and disable the synchronization and statistics transfer options wherever possible. These may be hidden under various names, including \u201cAccount\u201d, \u201cCloud\u201d, \u201cHelp us improve\u201d, and even <a href=\"https:\/\/support.google.com\/gboard\/answer\/12373137?hl=en\" target=\"_blank\" rel=\"nofollow noopener\">\u201cAudio donations\u201d<\/a>.<\/li>\n<li>Check which <a href=\"https:\/\/www.kaspersky.com\/blog\/android-8-permissions-guide\/23981\/\" target=\"_blank\" rel=\"noopener nofollow\">Android permissions<\/a> the keyboard needs and revoke any that it doesn\u2019t need. Access to contacts or the camera is definitely not necessary for a keyboard.<\/li>\n<li>Only install apps from trusted sources, check the app\u2019s reputation, and, again, don\u2019t give it excessive permissions.<\/li>\n<li>Use comprehensive protection for all your Android and iOS smartphones, such as <a href=\"https:\/\/www.kaspersky.com\/premium?icid=gl_bb2023-kdplacehd_acq_ona_smm__onl_b2c_kdaily_lnk_sm-team___kprem___\" target=\"_blank\" rel=\"noopener nofollow\">Kaspersky Premium<\/a>.<\/li>\n<\/ul>\n<input type=\"hidden\" class=\"category_for_banner\" value=\"premium-generic\">\n","protected":false},"excerpt":{"rendered":"<p>We explore whether it\u2019s possible to reveal all your secrets via your smartphone&#8217;s on-screen keyboard.<\/p>\n","protected":false},"author":2722,"featured_media":51282,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9],"tags":[105,109,282,1984,43,97],"class_list":{"0":"post-51281","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-tips","8":"tag-android","9":"tag-apps","10":"tag-cybersecurity","11":"tag-keyboard","12":"tag-privacy","13":"tag-security-2"},"hreflang":[{"hreflang":"x-default","url":"https:\/\/www.kaspersky.com\/blog\/prevent-android-keylogging-and-ime-spying\/51281\/"},{"hreflang":"en-in","url":"https:\/\/www.kaspersky.co.in\/blog\/prevent-android-keylogging-and-ime-spying\/27472\/"},{"hreflang":"en-ae","url":"https:\/\/me-en.kaspersky.com\/blog\/prevent-android-keylogging-and-ime-spying\/22790\/"},{"hreflang":"en-us","url":"https:\/\/usa.kaspersky.com\/blog\/prevent-android-keylogging-and-ime-spying\/30145\/"},{"hreflang":"en-gb","url":"https:\/\/www.kaspersky.co.uk\/blog\/prevent-android-keylogging-and-ime-spying\/27624\/"},{"hreflang":"es-mx","url":"https:\/\/latam.kaspersky.com\/blog\/prevent-android-keylogging-and-ime-spying\/27395\/"},{"hreflang":"es","url":"https:\/\/www.kaspersky.es\/blog\/prevent-android-keylogging-and-ime-spying\/30045\/"},{"hreflang":"it","url":"https:\/\/www.kaspersky.it\/blog\/prevent-android-keylogging-and-ime-spying\/28905\/"},{"hreflang":"ru","url":"https:\/\/www.kaspersky.ru\/blog\/prevent-android-keylogging-and-ime-spying\/37472\/"},{"hreflang":"fr","url":"https:\/\/www.kaspersky.fr\/blog\/prevent-android-keylogging-and-ime-spying\/21899\/"},{"hreflang":"pt-br","url":"https:\/\/www.kaspersky.com.br\/blog\/prevent-android-keylogging-and-ime-spying\/22635\/"},{"hreflang":"de","url":"https:\/\/www.kaspersky.de\/blog\/prevent-android-keylogging-and-ime-spying\/31291\/"},{"hreflang":"ja","url":"https:\/\/blog.kaspersky.co.jp\/prevent-android-keylogging-and-ime-spying\/36422\/"},{"hreflang":"ru-kz","url":"https:\/\/blog.kaspersky.kz\/prevent-android-keylogging-and-ime-spying\/27779\/"},{"hreflang":"en-au","url":"https:\/\/www.kaspersky.com.au\/blog\/prevent-android-keylogging-and-ime-spying\/33619\/"},{"hreflang":"en-za","url":"https:\/\/www.kaspersky.co.za\/blog\/prevent-android-keylogging-and-ime-spying\/33283\/"}],"acf":[],"banners":"","maintag":{"url":"https:\/\/www.kaspersky.com\/blog\/tag\/android\/","name":"Android"},"_links":{"self":[{"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/posts\/51281","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/users\/2722"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/comments?post=51281"}],"version-history":[{"count":3,"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/posts\/51281\/revisions"}],"predecessor-version":[{"id":51288,"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/posts\/51281\/revisions\/51288"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/media\/51282"}],"wp:attachment":[{"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/media?parent=51281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/categories?post=51281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kaspersky.com\/blog\/wp-json\/wp\/v2\/tags?post=51281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}