<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>SpellBook</title>
    <link>https://ag2s.ca/spellbook/2.-web-pentesting/2.2-blackbox-attacks/xss---cross-site-scripting/sanitizers/</link>
    <description>Recent content on SpellBook</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <atom:link href="https://ag2s.ca/spellbook/2.-web-pentesting/2.2-blackbox-attacks/xss---cross-site-scripting/sanitizers/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title></title>
      <link>https://ag2s.ca/spellbook/2.-web-pentesting/2.2-blackbox-attacks/xss---cross-site-scripting/sanitizers/dompurify/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://ag2s.ca/spellbook/2.-web-pentesting/2.2-blackbox-attacks/xss---cross-site-scripting/sanitizers/dompurify/</guid>
      <description>&lt;h1 id=&#34;dompurify-misconfiurations&#34;&gt;DOMPurify Misconfiurations&lt;a class=&#34;anchor&#34; href=&#34;#dompurify-misconfiurations&#34;&gt;#&lt;/a&gt;&lt;/h1&gt;&#xA;&lt;p&gt;Depending on DOMPurify&amp;rsquo;s configuration, there might be a downgrade in sanitization protection. This could lead to either a small sanitization downgrade or, in the worst case, a full sanitization bypass.&lt;/p&gt;&#xA;&lt;p&gt;Each &lt;code&gt;DOMPurify.sanitize&lt;/code&gt; call can have a different configuration, meaning that one call might be safe while the next might not be.&lt;/p&gt;&#xA;&lt;p&gt;If you want to look for DOMPurify misconfigurations, the best way is to:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Search for the &lt;code&gt;&amp;lt;!--&amp;gt;&lt;/code&gt; or &lt;code&gt;\x3c!--\x3e&lt;/code&gt; string in all the compiled JS files. This is used at the beginning of the &lt;a href=&#34;https://github.com/cure53/DOMPurify/blob/1c1b1838625851939d4b86436feeb3e3ccb7dbb6/src/purify.ts#L1438&#34;&gt;sanitize&lt;/a&gt; function (&lt;a href=&#34;https://github.com/cure53/DOMPurify/blob/1c1b1838625851939d4b86436feeb3e3ccb7dbb6/src/purify.ts#L1448&#34;&gt;ref&lt;/a&gt;).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;img src=&#34;https://ag2s.ca/spellbook/images/e4e605ebaaf047ae867473aa67d50f443ead9c18a9730e98418b338475ce852a.jpeg&#34; alt=&#34;&#34; /&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title></title>
      <link>https://ag2s.ca/spellbook/2.-web-pentesting/2.2-blackbox-attacks/xss---cross-site-scripting/sanitizers/mutation-xss/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://ag2s.ca/spellbook/2.-web-pentesting/2.2-blackbox-attacks/xss---cross-site-scripting/sanitizers/mutation-xss/</guid>
      <description>&lt;h1 id=&#34;mutation-xss&#34;&gt;Mutation XSS&lt;a class=&#34;anchor&#34; href=&#34;#mutation-xss&#34;&gt;#&lt;/a&gt;&lt;/h1&gt;&#xA;&lt;p&gt;Mutation XSS is a kind of attack that takes advantage of HTML&amp;rsquo;s tolerant nature.&lt;/p&gt;&#xA;&lt;p&gt;Highly recommended taking a look at &lt;a href=&#34;https://mizu.re/post/exploring-the-dompurify-library-bypasses-and-fixes&#34;&gt;https://mizu.re/post/exploring-the-dompurify-library-bypasses-and-fixes&lt;/a&gt; after reading this. Most of the payload does not work anymore, because of browser&amp;rsquo;s fix and dompurify&amp;rsquo;s fix. However, it is a good read&lt;/p&gt;&#xA;&lt;h2 id=&#34;mutations&#34;&gt;Mutations&lt;a class=&#34;anchor&#34; href=&#34;#mutations&#34;&gt;#&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Mutation in HTML is any kind of change made to the markup for some reason or another:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;When a parser fixes a broken markup (&lt;code&gt;&amp;lt;p&amp;gt;test&lt;/code&gt; → &lt;code&gt;&amp;lt;p&amp;gt;test&amp;lt;/p&amp;gt;&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Normalizing attribute quotes (&lt;code&gt;&amp;lt;a alt=test&amp;gt;&lt;/code&gt; → &lt;code&gt;&amp;lt;a alt=”test”&amp;gt;&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Rearranging elements (&lt;code&gt;&amp;lt;table&amp;gt;&amp;lt;a&amp;gt;&lt;/code&gt; → &lt;code&gt;&amp;lt;a&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;table&amp;gt;&amp;lt;/table&amp;gt;&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Elements handle their content (the text between opening and closing tags eg. &lt;code&gt;&amp;lt;p&amp;gt;content&amp;lt;/p&amp;gt;&lt;/code&gt;) differently, with seven distinct &lt;a href=&#34;https://html.spec.whatwg.org/#elements-2&#34;&gt;parsing modes&lt;/a&gt; at play:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
