<?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>218018</bug_id>
          
          <creation_ts>2020-10-21 05:52:46 -0700</creation_ts>
          <short_desc>Error handling for ISO-2022-JP is incorrect</short_desc>
          <delta_ts>2020-10-21 16:04:04 -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>DOM</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>218046</dup_id>
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=218046</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anne van Kesteren">annevk</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>achristensen</cc>
    
    <cc>beidson</cc>
    
    <cc>darin</cc>
    
    <cc>mmaxfield</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1700156</commentid>
    <comment_count>0</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2020-10-21 05:52:46 -0700</bug_when>
    <thetext>See tests added and corrected in https://github.com/web-platform-tests/wpt/pull/26158. In particular it seems 0x0E, 0x0F, and 0x1B are not treated as errors which could lead to XSS in badly constructed sites.

(I think a similar problem applies to form submission, but I didn&apos;t write tests for that.)

(There&apos;s also some specification changes for this: https://github.com/whatwg/url/pull/558 and https://github.com/whatwg/encoding/pull/238.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1700339</commentid>
    <comment_count>1</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2020-10-21 13:14:56 -0700</bug_when>
    <thetext>Strange, Alex’s new code in TextCodecCJK::iso2022JPDecode has code like this:

    if (byte &lt;= 0x7F &amp;&amp; byte != 0x0E &amp;&amp; byte != 0x0F &amp;&amp; byte != 0x1B) {
        m_iso2022JPOutput = false;
        result.append(byte);
        break;
    }
    m_iso2022JPOutput = false;
    return SawError::Yes;

Sure looks like that would treat it as an error. Wonder why that’s not working. Or maybe Anne is testing an older version of Safari that used the ICU decoder?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1700373</commentid>
    <comment_count>2</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2020-10-21 13:53:06 -0700</bug_when>
    <thetext>Oh, is this encode rather than decode?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1700442</commentid>
    <comment_count>3</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2020-10-21 16:04:04 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 218046 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>