{"id":3047,"date":"2024-11-26T10:41:09","date_gmt":"2024-11-26T08:41:09","guid":{"rendered":"https:\/\/certitude.consulting\/blog\/?p=3047"},"modified":"2024-11-26T10:41:10","modified_gmt":"2024-11-26T08:41:10","slug":"exploring-anti-phishing-measures-in-microsoft-365-pt-2","status":"publish","type":"post","link":"https:\/\/certitude.consulting\/blog\/en\/exploring-anti-phishing-measures-in-microsoft-365-pt-2\/","title":{"rendered":"Exploring Anti-Phishing Measures in Microsoft 365 &#8211; Pt. 2"},"content":{"rendered":"\n<p><strong>In a previous <a href=\"https:\/\/certitude.consulting\/blog\/en\/o365-anti-phishing-measures\/\" data-type=\"link\" data-id=\"https:\/\/certitude.consulting\/blog\/en\/o365-anti-phishing-measures\/\">blog post<\/a>, we described an issue with the &#8220;First Contact Safety Tip&#8221; which allowed it to be bypassed by malicious actors. Recently, we discovered that Microsoft modified the disclaimer to better resist the described attack. In this blog post, we discuss these changes, and whether it is still possible to carry out the same attack.<\/strong><\/p>\n\n\n\n<p>We recently discovered that the &#8220;First Contact Safety Tip&#8221; had been modified, so that the proof of concept  that previously worked no longer functioned correctly:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1267\" height=\"374\" src=\"https:\/\/certitude.consulting\/blog\/wp-content\/uploads\/2024\/11\/image-2.png\" alt=\"\" class=\"wp-image-3261\" srcset=\"https:\/\/certitude.consulting\/blog\/wp-content\/uploads\/2024\/11\/image-2.png 1267w, https:\/\/certitude.consulting\/blog\/wp-content\/uploads\/2024\/11\/image-2-300x89.png 300w, https:\/\/certitude.consulting\/blog\/wp-content\/uploads\/2024\/11\/image-2-1024x302.png 1024w, https:\/\/certitude.consulting\/blog\/wp-content\/uploads\/2024\/11\/image-2-768x227.png 768w\" sizes=\"auto, (max-width: 1267px) 100vw, 1267px\" \/><figcaption class=\"wp-element-caption\"><em>Figure 1: The &#8220;First Contact Safety Tip&#8221; is only partly affected by the POC used in the previous blog post.<\/em><\/figcaption><\/figure>\n\n\n\n<p>To understand why the POC no longer works, we need to take a look at the source code to see what has changed. Shown below is a &#8220;First Contact Safety Tip&#8221; from an email sent in August 2024, next to the same disclaimer from an email sent in September 2024:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"1835\" height=\"755\" src=\"https:\/\/certitude.consulting\/blog\/wp-content\/uploads\/2024\/11\/image-3.png\" alt=\"\" class=\"wp-image-3262\" srcset=\"https:\/\/certitude.consulting\/blog\/wp-content\/uploads\/2024\/11\/image-3.png 1835w, https:\/\/certitude.consulting\/blog\/wp-content\/uploads\/2024\/11\/image-3-300x123.png 300w, https:\/\/certitude.consulting\/blog\/wp-content\/uploads\/2024\/11\/image-3-1024x421.png 1024w, https:\/\/certitude.consulting\/blog\/wp-content\/uploads\/2024\/11\/image-3-768x316.png 768w, https:\/\/certitude.consulting\/blog\/wp-content\/uploads\/2024\/11\/image-3-1536x632.png 1536w\" sizes=\"auto, (max-width: 1835px) 100vw, 1835px\" \/><figcaption class=\"wp-element-caption\">Figure 2: <em>On the left is the &#8216;First Contact Safety Tip&#8217; from an email sent on 02.08.2024. On the right is the same disclaimer from an email sent on 04.09.2024.<\/em><\/figcaption><\/figure>\n\n\n\n<p>The difference between the two, are the various <code>style<\/code> attributes, also targeting elements which previously had no <code>style<\/code> attribute. The new <code>style<\/code> attributes each follow a similar pattern; a long block of <strong><code>revert<\/code><\/strong> clauses has been prepended to the original style, as well as heavy use of the <strong><code>!important<\/code><\/strong> keyword. For example, shown below is the new content of the <code>style<\/code> attribute for the <code>table<\/code> element, with the reverting clauses highlighted in yellow:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>style=\" <mark style=\"background-color:#fcb900\" class=\"has-inline-color has-black-color\">aspect-ratio: revert !important; background: revert !important; block-size: revert !important; border: revert !important; bottom: revert !important; color: revert !important; color-scheme: revert !important; content-visibility: revert !important; cursor: revert !important; direction: revert !important; display: revert !important; font-size: revert !important; height: revert !important; hyphens: revert !important; letter-spacing: revert !important; line-height: revert !important; margin: revert !important; opacity: revert !important; order: revert !important; outline: revert !important; overflow: revert !important; padding: revert !important; position: revert !important; resize: revert !important; rotate: revert !important; scale: revert !important; tab-size: revert !important; table-layout: revert !important; text-align: revert !important; text-indent: revert !important; text-orientation: revert !important; text-overflow: revert !important; text-shadow: revert !important; text-transform: revert !important; text-wrap: revert !important; top: revert !important; transition: revert !important; user-select: revert !important; vertical-align: revert !important; visibility: revert !important; white-space: revert !important; width: revert !important; word-break: revert !important; word-spacing: revert !important; writing-mode: revert !important; zoom: revert !important;<\/mark> cellpadding: 0 !important; border: 0 !important; cellspacing: 0 !important; display: table !important; width: 100% !important; table-layout: fixed !important; border-collapse: seperate !important; float: none !important; border-spacing: 0px 0px !important; \"\n            align=\"left\"<\/code><\/pre>\n\n\n\n<p><strong>What does <code>revert<\/code> do, and why are there so many of them now?<\/strong> Well, according to the relevant <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/revert\" data-type=\"link\" data-id=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/revert\">MDN Web Docs<\/a> article, <code>revert<\/code> is a CSS keyword which <em>&#8220;reverts the cascaded value of the property from its current value to the value the property would have had if no changes had been made by the current style origin to the current element&#8221;<\/em>. This keyword may be applied to any CSS property.<\/p>\n\n\n\n<p><strong>What about <code>!important<\/code>?<\/strong> According to another <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/Specificity#the_!important_exception\" data-type=\"link\" data-id=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/Specificity#the_!important_exception\">MDN Web Docs<\/a> article, <code>!important<\/code> is a CSS keyword which can be used to override other CSS declarations which would otherwise apply to an element based on specificity.<\/p>\n\n\n\n<p>Visually, there is no difference between the old and new &#8220;First Contact Safety Tip&#8221; (see below). A distinction is only noticed, when attempting to alter the appearance of this disclaimer with custom CSS rules, as was demonstrated in Figure 1.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"718\" height=\"393\" src=\"https:\/\/certitude.consulting\/blog\/wp-content\/uploads\/2024\/11\/image.png\" alt=\"\" class=\"wp-image-3259\" srcset=\"https:\/\/certitude.consulting\/blog\/wp-content\/uploads\/2024\/11\/image.png 718w, https:\/\/certitude.consulting\/blog\/wp-content\/uploads\/2024\/11\/image-300x164.png 300w\" sizes=\"auto, (max-width: 718px) 100vw, 718px\" \/><figcaption class=\"wp-element-caption\">Figure 3: <em>The older &#8220;First Contact Safety Tip&#8221; is shown above (1). Below is the newer version (2).<\/em><\/figcaption><\/figure>\n\n\n\n<p><strong>So, is it still possible to alter\/hide the &#8220;First Contact Safety Tip&#8221;, despite the changes which have been made?<\/strong> In Fig. 1, we already saw that the POC was not completely mitigated, since the text was effectively hidden, but <strong>we could not find a way to go further than this<\/strong>. Meaning at least the gray bar is always visible. However, an attacker may e.g. choose to set the background of the e-mail to the same gray. This might make it harder for a victim to notice something to be off:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1176\" height=\"513\" src=\"https:\/\/certitude.consulting\/blog\/wp-content\/uploads\/2024\/11\/image-1.png\" alt=\"\" class=\"wp-image-3260\" srcset=\"https:\/\/certitude.consulting\/blog\/wp-content\/uploads\/2024\/11\/image-1.png 1176w, https:\/\/certitude.consulting\/blog\/wp-content\/uploads\/2024\/11\/image-1-300x131.png 300w, https:\/\/certitude.consulting\/blog\/wp-content\/uploads\/2024\/11\/image-1-1024x447.png 1024w, https:\/\/certitude.consulting\/blog\/wp-content\/uploads\/2024\/11\/image-1-768x335.png 768w\" sizes=\"auto, (max-width: 1176px) 100vw, 1176px\" \/><figcaption class=\"wp-element-caption\">Figure 4: <em>Bypass using gray background.<\/em><\/figcaption><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a previous blog post, we described an issue with the &#8220;First Contact Safety Tip&#8221; which allowed it to be bypassed by malicious actors. Recently, we discovered that Microsoft modified the disclaimer to better resist the described attack. In this blog post, we discuss these changes, and whether it is still possible to carry out [&hellip;]<\/p>\n","protected":false},"author":18,"featured_media":3183,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[60,103],"tags":[524,520,440,318],"class_list":["post-3047","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technical-analysis","category-vulnerability-research-en","tag-microsoft-en","tag-outlook","tag-phishing-en","tag-social-engineering"],"_links":{"self":[{"href":"https:\/\/certitude.consulting\/blog\/wp-json\/wp\/v2\/posts\/3047","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/certitude.consulting\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/certitude.consulting\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/certitude.consulting\/blog\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/certitude.consulting\/blog\/wp-json\/wp\/v2\/comments?post=3047"}],"version-history":[{"count":9,"href":"https:\/\/certitude.consulting\/blog\/wp-json\/wp\/v2\/posts\/3047\/revisions"}],"predecessor-version":[{"id":3263,"href":"https:\/\/certitude.consulting\/blog\/wp-json\/wp\/v2\/posts\/3047\/revisions\/3263"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/certitude.consulting\/blog\/wp-json\/wp\/v2\/media\/3183"}],"wp:attachment":[{"href":"https:\/\/certitude.consulting\/blog\/wp-json\/wp\/v2\/media?parent=3047"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/certitude.consulting\/blog\/wp-json\/wp\/v2\/categories?post=3047"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/certitude.consulting\/blog\/wp-json\/wp\/v2\/tags?post=3047"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}