{"id":10799,"date":"2019-05-13T09:50:46","date_gmt":"2019-05-13T13:50:46","guid":{"rendered":"https:\/\/www.thesslstore.com\/blog\/?p=10799"},"modified":"2023-03-31T11:48:03","modified_gmt":"2023-03-31T15:48:03","slug":"protecting-against-man-in-the-middle-attacks","status":"publish","type":"post","link":"https:\/\/www.thesslstore.com\/blog\/protecting-against-man-in-the-middle-attacks\/","title":{"rendered":"Protecting against Man-In-The-Middle Attacks"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"h-make-sure-nobody-gets-in-the-middle-of-your-connections\">Make sure nobody gets in the middle of your connections<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">SSL\/TLS\nforms the bedrock of modern web security by combining asymmetric and symmetric\ncryptography in order to achieve secrecy and non-repudiation. This is important\nwhen sending sensitive information (credit cards, social security numbers, etc.)\nvia an insecure channel such as the internet. However, improperly implemented\nSSL\/TLS can lead to these secrets being exposed. The biggest classification of\nthreat SSL\/TLS protects against is known as a \u201cman-in-the-middle\u201d attack,\nwhereby a malicious actor can intercept communication, and decrypt it (either\nnow or at a later point). <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SSL\/TLS ensures\nthat the party you are communicating with really is the party they\u2019re claiming\nto be, and really does have ownership of the domain you\u2019re visiting in Global\nDNS. This is important, because if the certificate were simply self-signed and\nyou were connected to a website that has gotten between you and the provider,\neven if the information is secure across the wire, it would be securely sent to\nthe attacker!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It\u2019s\nimportant to keep in mind that there are a lot of different layers between the\nclient and the server that an attacker could target. An attacker could run\nmalware on the endpoint itself, sniff for traffic on a layer 2 adjacent network\nsegment and potentially strip SSL\/TLS altogether, inject malicious entries into\nthe target\u2019s ARP cache, or even compromise the routing table of the upstream\nrouter serving as the gateway for the network. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After the traffic makes it to the internet, a bad actor could tap a telephone pole through which fiber is run, participate in BGP and reroute traffic through nodes that they control, or compromise name resolution by taking control of a DNS server between the client and its destination. All these avenues of attack are considered MITM, and all of them can be mitigated by properly employing and managing SSL\/TLS.<span id=\"newline\"><\/span><\/p>\n\n\n<span style=\"--tl-form-height-m:150.25px;--tl-form-height-t:121.4583px;--tl-form-height-d:121.4583px;\" class=\"tl-placeholder-f-type-shortcode_12753 tl-preload-form\"><span><\/span><\/span>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-focusing-on-the-man-in-the-middle\">Focusing on the Man-in-the-Middle<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In 2017, it\nwas discovered that many <a href=\"https:\/\/www.thesslstore.com\/blog\/banking-apps-vulnerability-mitm\/\">banking apps<\/a> from popular banks with a global presence\n(including Bank of America and HSBC) were vulnerable to man-in-the-middle\nattacks due to software not properly verifying the chain of trust. Unknown to\nany of these bank\u2019s members, attacks with access to the networks on which a\nclient was doing their banking could have posed as the bank\u2019s server and\nharvested balances, credentials, and even 2-factor authentication tokens.\nImagine having your life savings wiped out in a matter of hours, with little to\nno recourse.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"880\" height=\"487\" src=\"https:\/\/www.thesslstore.com\/blog\/wp-content\/uploads\/2018\/11\/man-in-the-middle-attack.png\" alt=\"man-in-the-middle attack\" class=\"wp-image-8082\" srcset=\"https:\/\/www.thesslstore.com\/blog\/wp-content\/uploads\/2018\/11\/man-in-the-middle-attack.png 880w, https:\/\/www.thesslstore.com\/blog\/wp-content\/uploads\/2018\/11\/man-in-the-middle-attack-300x166.png 300w, https:\/\/www.thesslstore.com\/blog\/wp-content\/uploads\/2018\/11\/man-in-the-middle-attack-768x425.png 768w\" sizes=\"auto, (max-width: 880px) 100vw, 880px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">As of April\n2019, tech titan Google has made an unprecedented decision that shows how\nseriously they take this threat. As policy going forward, they are forbidding\nlogins from mobile frameworks from being able to sign in to their sites and\nservices. Even though there is nothing malicious about these frameworks\nthemselves, they appear heuristically similar to man-in-the-middle attacks when\nit comes time for Google to determine if a sign in attempt is legitimate or\nnot. This is a controversial decision, but it puts security first. Going\nforward, developers are expected to transition to OAUTH tokens for federated\nlogin.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">HTTP is not\nthe only protocol vulnerable to man-in-the-middle attacks. In 2018, a\nvulnerability in the Bluetooth protocol was discovered (<a href=\"https:\/\/www.kb.cert.org\/vuls\/id\/304725\">https:\/\/www.kb.cert.org\/vuls\/id\/304725<\/a>) that allows an attacker to\nintercept Bluetooth communications encrypted by SSL\/TLS. Imagine an attacker\nintercepting communications as a user paired their phone with their smart lock.\nSuddenly, it\u2019s not so hard to imagine the risks of insecure communication not\nonly affecting one\u2019s digital life, but one\u2019s home as well. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To a\nbusiness, MITM attacks represent risk. Their reputations and profitability are\nat stake. According to the Ponemon Institute, the average cost for any kind of\ndata breach is $4.13 million. This does not necessarily scale linearly with the\nsize of the business. For many smaller businesses that do not clear this kind\nof revenue at all in a year, a single data breach can mean closing its doors. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-defending-against-the-man-in-the-middle\">Defending against the Man-in-the-Middle<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">So, how then\ncan a savvy business protect itself from this risk? How can these attack\nvectors be effectively mitigated? There are both administrative and technical\nhurdles to overcome. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Deciding as\na business on a uniform baseline policy for SSL\/TLS is an effective way of\nmaking sure individual business units don\u2019t make these decisions in a vacuum.\nThere is always a trade-off between compatibility with older devices and\nsecurity of data transfer. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A banking\ninstitution may well determine that only TLS 1.2, with only the strongest\nciphers, and Perfect-Forward-Secrecy across the board is the way to go. They\nwould also likely already be evaluating a move to TLS 1.3. To their business\nsegment, the lack of compatibility with older clients is worth the security of\nknowing that even 100 years in the future \u2013 or at least until quantum computing\nbecomes viable \u2013 this information will be kept secret. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A deli that\naccepts online orders however, may determine that compatibility is more\nimportant, and that all things considered, a data breach isn\u2019t on the top ten\nlist of things that could prove a death knell for the business. Regardless,\nwhether you\u2019re a bank or a purveyor of meats, user training is an equally\nimportant piece of the puzzle. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A recent academic study conducted by doctors from several prestigious US and UK university over 8 years found that <a href=\"https:\/\/www.thesslstore.com\/blog\/hospital-employees-open-1-out-of-every-7-phishing-emails\/\">employee training really does work<\/a>. Over the course of multiple simulations across several years employees showed decided improvement in terms of being able to identify threats and escalate them properly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Moving on, in\norder to make effective decisions, the decisionmaker either needs to be\nknowledgeable, or be able to delegate to someone that is. For bigger businesses,\nthis might mean training users to look for the lock in their browser when\nmaking an online purchase. For the deli owner, the best decision is probably\nnot to host the online services in their nephew\u2019s basement, but rather to\nenlist the services of a professional.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-tls-1-3-vs-the-man-in-the-middle\">TLS 1.3 vs the Man-in-the-Middle<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For security professionals, staying current on the current threat landscape and up-to-date on the latest mitigations against these threats is paramount. In August of 2018, <a href=\"https:\/\/www.thesslstore.com\/blog\/tls-1-3-approved\/\">TLS 1.3 was finalized in RFC 8446<\/a>. With it, perfect forward secrecy is no longer a cipher-level decision, but mandated in the protocol specification. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Session-resumption,\na feature of TLS 1.0 thru 1.2, which was prone to implementation weaknesses was\nremoved entirely in favor of pre-shared keys. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One\ncontroversial aspect of TLS 1.3 that will likely hinder its adoption is that\nthere are new considerations regarding forward proxies. Many organizations, in order\nto provide gateway antivirus protection and protect against the theft of\nintellectual property, perform deep packet inspection. If you see that\ncertificates your browser trusts on a company owned device are signed not by\nthe site you\u2019re visiting, but by your company\u2019s firewall instead, this means\nthat the company is using this kind of technology. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">While TLS\n1.3 can in fact be intercepted by a company for this purpose (because they\ncontrol the root certificate store on the endpoint as well as the route the\ntraffic takes), many existing software implementations relied on the TLS 1.0 \u2013\nTLS 1.2 handshake in order to provide this deep packet inspection. Companies in\norder to support TLS 1.3 at the very least will have to upgrade the firmware on\ntheir devices, and in some cases even purchase new hardware in order to inspect\nthe traffic in a different way. This mostly affects companies using implicit\ndeep packet inspection. Explicit proxies instead rely on CONNECT messages,\nwhich operate largely the same way with TLS 1.3.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This practice of intercepting HTTPS communication <a href=\"https:\/\/www.thesslstore.com\/blog\/https-interception-harming-security\/\">is controversial<\/a>. It intentionally breaks the foundation of encrypted communications and introduces additional points in the chain where an attacker could insert themselves towards malicious ends. Simultaneously, being able to inspect this data forms the bedrock of many organizational policies that inspect payload data for things like sending social security numbers, credit card numbers, or protected trade secrets via unexpected channels. Much like Google\u2019s decision to disallow authentication from well-intentioned mobile frameworks for the betterment of overall security, it would be unsurprising if deep packet inspection itself faces a reckoning in the future.<\/p>\n\n\n<span style=\"--tl-form-height-m:861.156px;--tl-form-height-t:899.625px;--tl-form-height-d:899.625px;\" class=\"tl-placeholder-f-type-shortcode_12653 tl-preload-form\"><span><\/span><\/span>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-final-thoughts\">Final Thoughts<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, with public key pinning losing traction, one of the best ways to protect your users is to employ <a href=\"https:\/\/www.thesslstore.com\/blog\/what-is-hypertext-strict-transport-security-hsts\/\">HSTS<\/a>. This technology works by a browser-based cache that maintains a database of visited websites. If the website identifies itself as leveraging HSTS, the browser will disallow insecure communication to that site. No connections can be made in the future via HTTP, crippling SSL stripping attacks. (Assuming of course, that the user is not being attacked on their very first visit to that site from their computer).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You may also\nconsider adding your website to the HSTS preload list, which is maintained by\nGoogle and used by all the major browsers. Even if an internet user has never\nvisited a given site, as long as it\u2019s on the list their browser will know to\nforce an HTTPS connection. This effectively shuts the window on a very narrow\nattack vector that presents itself upon a user\u2019s first visit \u2013 before they have\ndownloaded the HTTP header. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One word of caution though. If you do add your website to the HSTS list and your SSL certificate expires or gets revoked \u2013 your site is effectively broken until you replace it. Users will be unable to connect. This happened to the US government during its shutdown when <a href=\"https:\/\/www.thesslstore.com\/blog\/80-gov-ssl-tls-certificates-have-expired-during-the-shutdown\/\">over 80 websites broke due to certificate expiry<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Defending\nagainst the Man-in-the-Middle isn\u2019t as simple as just installing an SSL\ncertificate, there are other considerations that need to be made in terms of\nimplementation. Remember, keep your implementations up to date with the latest\nprotocols and the most secure cipher suites. Err on the side of security \u2013 not\ninteroperability. And use HSTS.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>What do you think? If you have any\ncomments or questions leave them below.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Make sure nobody gets in the middle of your connections SSL\/TLS forms the bedrock of modern web security by combining asymmetric and symmetric cryptography in order to achieve secrecy and&#8230;<\/p>\n","protected":false},"author":19,"featured_media":10800,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":"","tve_updated_post":"","tve_custom_css":"","tve_user_custom_css":"","tve_globals":{},"tcb2_ready":0,"tcb_editor_enabled":0,"tve_landing_page":"","_tve_header":"","_tve_footer":""},"categories":[130],"tags":[10329,5470],"class_list":["post-10799","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-everything-encryption","tag-man-in-the-middle","tag-mitm","post-with-tags"],"views":39495,"jetpack_featured_media_url":"https:\/\/www.thesslstore.com\/blog\/wp-content\/uploads\/2019\/05\/MITM-Feature.png","_links":{"self":[{"href":"https:\/\/www.thesslstore.com\/blog\/wp-json\/wp\/v2\/posts\/10799","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thesslstore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thesslstore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thesslstore.com\/blog\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thesslstore.com\/blog\/wp-json\/wp\/v2\/comments?post=10799"}],"version-history":[{"count":0,"href":"https:\/\/www.thesslstore.com\/blog\/wp-json\/wp\/v2\/posts\/10799\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.thesslstore.com\/blog\/wp-json\/wp\/v2\/media\/10800"}],"wp:attachment":[{"href":"https:\/\/www.thesslstore.com\/blog\/wp-json\/wp\/v2\/media?parent=10799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thesslstore.com\/blog\/wp-json\/wp\/v2\/categories?post=10799"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thesslstore.com\/blog\/wp-json\/wp\/v2\/tags?post=10799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}