{"id":35532,"date":"2019-10-31T22:04:52","date_gmt":"2019-10-31T19:04:52","guid":{"rendered":"https:\/\/prohoster.info\/blog\/bezopasnye-push-uvedomleniya-ot-teorii-k-praktike\/"},"modified":"2019-10-31T22:04:52","modified_gmt":"2019-10-31T19:04:52","slug":"bezopasnye-push-uvedomleniya-ot-teorii-k-praktike","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/bezopasnye-push-uvedomleniya-ot-teorii-k-praktike","title":{"rendered":"Secure Push Notifications: From Theory to Practice","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Hello, Habr! <\/p>\n<p>Today I will talk about what my colleagues and I have been working on for several months: push notifications for mobile messengers. As I mentioned, our application places a strong emphasis on security. Therefore, we investigated whether push notifications have any 'weak points' and, if they do, how we can mitigate them to add this useful option to our service.<\/p>\n<p>I am publishing the translation of our <noindex><a rel=\"nofollow\" href=\"https:\/\/medium.com\/adamant-im\/push-notifications-friends-or-foes-b118b67ed258?postPublishedType=repub\">article from Medium<\/a><\/noindex> with a few additions from myself. It summarizes the results of our 'investigation' and explains how we resolved the issue.<\/p>\n<h2>Exploring the technical aspects<\/h2>\n<p>\nIn the classic model, push notifications make messengers vulnerable to MITM (Man-in-the-middle) attacks. For instance, Google, Microsoft, and the old version of iMessage send encryption keys to Apple servers \u2014 user authentication and message header (or content) decryption occurs on the server.<\/p>\n<p><img decoding=\"async\" alt=\"Secure Push Notifications: From Theory to Practice\" src=\"\/wp-content\/uploads\/2019\/06\/5a1d3de5fc9c7d6da3f48490dccd2ab6.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nAs a result, there is a chance of reading conversations by gaining access to the push notification server. This means that any encryption of conversations is useless: push notifications will still provide a means for third parties to read them. The authors of the article discussed this possibility in detail in <noindex><a rel=\"nofollow\" href=\"https:\/\/xakep.ru\/2018\/06\/14\/useless-encryption\/\">\"Encrypt Wisely\"<\/a><\/noindex> on Xaker.ru, dedicated to message encryption methods. <\/p>\n<p>If you think that Apple and Google servers will 100% prevent the leakage of users' encryption keys, consider that their employees have access to them. And employees are human.<br \/>\nDespite all the vulnerabilities of push notifications, many 'secure' messengers, including Signal and Telegram, use them. Otherwise, users would have to manually check for new messages by constantly entering the app, which is quite inconvenient, giving competing messengers an advantage.<\/p>\n<h2>Paranoia and Common Sense<\/h2>\n<p><noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><br \/>\nIn our project, we began to focus on this issue several months ago. We needed to implement a push notification option to remain competitive. However, we must not overlook security holes, as any data leak would undermine trust in the project.<\/p>\n<p>However, we already have a significant advantage: our messenger is decentralized (data is stored on the blockchain), and employees do not have access to user accounts. Only users have encryption keys, and the public keys of interlocutors are available on the blockchain to protect against MITM attacks.<\/p>\n<p>In the first version of push notifications, we decided to err on the side of caution and not transmit the text of the message at all. The push service received only a signal about the receipt of the message, not the message text. Therefore, the user saw the notification 'You have a new message.' It could only be read in the messenger. <\/p>\n<p><img decoding=\"async\" alt=\"Secure Push Notifications: From Theory to Practice\" src=\"\/wp-content\/uploads\/2019\/06\/5f4bf5861141666105cd5c76c27c796c.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<noindex><a rel=\"nofollow\" href=\"https:\/\/www.youtube.com\/watch?time_continue=21&amp;v=WK3gyH7_iAw\">How it worked: video<\/a><\/noindex>.<\/p>\n<p>After that, we learned that the latest version of notifications from Apple includes new security features. They <noindex><a rel=\"nofollow\" href=\"https:\/\/developer.apple.com\/documentation\/usernotifications\/unnotificationserviceextension\">was released<\/a><\/noindex> UNNotificationServiceExtension, which allows developers to send fully encrypted notification data via APNS. Then the application on the end user's device performs decryption (or loads additional data) and displays the notification. We based our second version of push notifications on this.<\/p>\n<p>Currently, we have developed the second version of push notifications for iOS, which allows displaying the message text without compromising security. In the new concept, the logic looks like this:<\/p>\n<ul>\n<li>The push service sends a push notification with the transaction number (the encrypted message can be very large, while notification sizes are heavily restricted)<\/li>\n<li>Upon receiving the notification, the device launches our NotificationServiceExtension \u2014 a micro-application that requests the transaction by id from the node, decrypts it using the stored passphrase, and returns a new notification to the system. The passphrase is stored in a secure vault.<\/li>\n<li>The system displays a notification with the decrypted message or translation.<\/li>\n<li>The keys go nowhere, nor does the plain text message. The push service cannot decrypt the message. <\/li>\n<\/ul>\n<p>\n<img decoding=\"async\" alt=\"Secure Push Notifications: From Theory to Practice\" src=\"\/wp-content\/uploads\/2019\/06\/9b137036738a742c93e5b97a2f0acea5.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nWe adopted this version as the working one and implemented it in the latest update of the iOS application.<br \/>\nThose interested in the technical side can check the source code: <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/Adamant-im\/adamant-notificationService\/\">github.com\/Adamant-im\/adamant-notificationService<\/a><\/noindex>.<br \/>\n<br \/>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/456902\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0442\u043e\u043c, \u0447\u0435\u043c \u043c\u044b \u0441 \u043a\u043e\u043b\u043b\u0435\u0433\u0430\u043c\u0438 \u0437\u0430\u043d\u044f\u0442\u044b \u0443\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u044f\u0446\u0435\u0432: \u043e \u043f\u0443\u0448-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f\u0445 \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u043e\u0432. \u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b, \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0443\u043f\u043e\u0440 \u0441\u0434\u0435\u043b\u0430\u043d \u043d\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0432\u044b\u044f\u0441\u043d\u044f\u043b\u0438, \u0435\u0441\u0442\u044c \u043b\u0438 \u0443 \u043f\u0443\u0448-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u201c\u0441\u043b\u0430\u0431\u044b\u0435 \u043c\u0435\u0441\u0442\u0430\u201d \u0438 \u0435\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0445 \u043d\u0438\u0432\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u043e\u043f\u0446\u0438\u044e \u0432 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":26645,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-35532","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0442\u043e\u043c, \u0447\u0435\u043c \u043c\u044b \u0441 \u043a\u043e\u043b\u043b\u0435\u0433\u0430\u043c\u0438 \u0437\u0430\u043d\u044f\u0442\u044b \u0443\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u044f\u0446\u0435\u0432: \u043e \u043f\u0443\u0448-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f\u0445 \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u043e\u0432. \u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b, \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0443\u043f\u043e\u0440 \u0441\u0434\u0435\u043b\u0430\u043d \u043d\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/bezopasnye-push-uvedomleniya-ot-teorii-k-praktike\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0435 push-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f: \u043e\u0442 \u0442\u0435\u043e\u0440\u0438\u0438 \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0442\u043e\u043c, \u0447\u0435\u043c \u043c\u044b \u0441 \u043a\u043e\u043b\u043b\u0435\u0433\u0430\u043c\u0438 \u0437\u0430\u043d\u044f\u0442\u044b \u0443\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u044f\u0446\u0435\u0432: \u043e \u043f\u0443\u0448-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f\u0445 \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u043e\u0432. \u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b, \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0443\u043f\u043e\u0440 \u0441\u0434\u0435\u043b\u0430\u043d \u043d\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/bezopasnye-push-uvedomleniya-ot-teorii-k-praktike\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-10-31T19:04:52+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-10-31T19:04:52+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Secure push notifications: from theory to practice | ProHoster","description":"Hello, Habr! Today I will tell you about what my colleagues and I have been working on for several months: push notifications for mobile messengers. As I mentioned, our application focuses primarily on security.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/bezopasnye-push-uvedomleniya-ot-teorii-k-praktike","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0435 push-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f: \u043e\u0442 \u0442\u0435\u043e\u0440\u0438\u0438 \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 | ProHoster","og:description":"\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0442\u043e\u043c, \u0447\u0435\u043c \u043c\u044b \u0441 \u043a\u043e\u043b\u043b\u0435\u0433\u0430\u043c\u0438 \u0437\u0430\u043d\u044f\u0442\u044b \u0443\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u044f\u0446\u0435\u0432: \u043e \u043f\u0443\u0448-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f\u0445 \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u043e\u0432. \u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b, \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0443\u043f\u043e\u0440 \u0441\u0434\u0435\u043b\u0430\u043d \u043d\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c.","og:url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/bezopasnye-push-uvedomleniya-ot-teorii-k-praktike","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-10-31T19:04:52+00:00","article:modified_time":"2019-10-31T19:04:52+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"35532","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-21 23:40:19","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-03-01 02:00:25","updated":"2026-01-21 23:40:19","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/35532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=35532"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/35532\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media\/26645"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=35532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=35532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=35532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}