<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>39675</bug_id>
          
          <creation_ts>2010-05-25 08:22:36 -0700</creation_ts>
          <short_desc>SVG recursion stack exhaustion crashes.</short_desc>
          <delta_ts>2016-10-12 05:58:19 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>SVG</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows Vista</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Berend-Jan Wever">skylined</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>christopher.reiss</cc>
    
    <cc>eric</cc>
    
    <cc>krit</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>230282</commentid>
    <comment_count>0</comment_count>
    <who name="Berend-Jan Wever">skylined</who>
    <bug_when>2010-05-25 08:22:36 -0700</bug_when>
    <thetext>Having an SVG image load itself through an svg &quot;image&quot; tag or an html &quot;img&quot; tag using foreignObject causes infinite recursion, which crashes the browser. I&apos;m creating one bug for both because they are essentially caused by the same problem. Feel free to split them if you think that works better.

-- html &quot;img&quot; tag --
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE svg PUBLIC &quot;-//W3C//DTD SVG 1.1//EN&quot; &quot;http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd&quot;&gt;
&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; width=&quot;1063&quot; height=&quot;638&quot;&gt;
  &lt;foreignObject&gt;
    &lt;body xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
      &lt;img src=&quot;[url to this .svg file]&quot; /&gt;
    &lt;/body&gt;
  &lt;/foreignObject&gt;
&lt;/svg&gt;

Chromium bug: http://code.google.com/p/chromium/issues/detail?id=44995
Repro: http://skypher.com/SkyLined/Repro/Chrome/44995%20-%20WebCore..FrameView..paintContents%20RecursionSOV%20(1b0fa0eb19ffe8d1d29dd7a361a99ee0)/repro.svg

-- svg &quot;image&quot; tag --
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE svg PUBLIC &quot;-//W3C//DTD SVG 1.1//EN&quot; &quot;http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd&quot;&gt;
&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; version=&quot;1.1&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; width=&quot;1063&quot; height=&quot;638&quot;&gt;
  &lt;image x=&quot;0&quot; y=&quot;0&quot; width=&quot;1063&quot; height=&quot;638&quot; xlink:href=&quot;[url to this .svg file]&quot; /&gt;
&lt;/svg&gt;

Chromium bug: http://code.google.com/p/chromium/issues/detail?id=44998
Repro: http://skypher.com/SkyLined/Repro/Chrome/44998%20-%20WebCore..CachedImage..changedInRect%20RecursionSOV%20(512de755335cb1ab73932c04c63216ba)/repro.svg

Marking as security: Because many chat/forum websites allow users to insert images with arbitrary URLs, these crashes can be used as a DoS against these websites.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>312295</commentid>
    <comment_count>1</comment_count>
    <who name="Berend-Jan Wever">skylined</who>
    <bug_when>2010-11-22 04:44:30 -0800</bug_when>
    <thetext>Another way to trigger stack exhaustion through recursion:

&lt;script&gt;
s = new Array(10000).join(&apos;&lt;marker&gt;&apos;);
document.writeln(&apos;&lt;svg&gt;&apos; + s);
&lt;/script&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>315637</commentid>
    <comment_count>2</comment_count>
    <who name="Berend-Jan Wever">skylined</who>
    <bug_when>2010-12-01 07:38:00 -0800</bug_when>
    <thetext>This is not a security issue</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>332406</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-01-11 09:44:41 -0800</bug_when>
    <thetext>&gt; Another way to trigger stack exhaustion through recursion:

That sounds like bug 15123.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1239258</commentid>
    <comment_count>4</comment_count>
      <attachid>291351</attachid>
    <who name="Dirk Schulze">krit</who>
    <bug_when>2016-10-12 05:57:35 -0700</bug_when>
    <thetext>Created attachment 291351
Recursion test

Test for recursion</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1239259</commentid>
    <comment_count>5</comment_count>
    <who name="Dirk Schulze">krit</who>
    <bug_when>2016-10-12 05:58:19 -0700</bug_when>
    <thetext>The recursion is not a problem.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>291351</attachid>
            <date>2016-10-12 05:57:35 -0700</date>
            <delta_ts>2016-10-12 05:57:35 -0700</delta_ts>
            <desc>Recursion test</desc>
            <filename>svg-recursion.zip</filename>
            <type>application/zip</type>
            <size>768</size>
            <attacher name="Dirk Schulze">krit</attacher>
            
              <data encoding="base64">UEsDBAoAAAAAAI0uTEkAAAAAAAAAAAAAAAAOABAAc3ZnLXJlY3Vyc2lvbi9VWAwA0jH+Vwky/lf1
ARQAUEsDBBQACAAIAJkuTEkAAAAAAAAAAAAAAAAXABAAc3ZnLXJlY3Vyc2lvbi9pbWFnZS5zdmdV
WAw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