<?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>139764</bug_id>
          
          <creation_ts>2014-12-17 21:43:44 -0800</creation_ts>
          <short_desc>buffer overflow parsing plugin information</short_desc>
          <delta_ts>2016-03-22 09:56:49 -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>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Windows 7</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <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="Bevan Collins">b.collins</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1056718</commentid>
    <comment_count>0</comment_count>
      <attachid>243481</attachid>
    <who name="Bevan Collins">b.collins</who>
    <bug_when>2014-12-17 21:43:44 -0800</bug_when>
    <thetext>Created attachment 243481
patch

getVersionInfo in PluginPackageWin.cpp has a buffer overflow. VerQueryValueW returns the size of the buffer in bytes, not TCHARs for translation values</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1177004</commentid>
    <comment_count>1</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2016-03-22 09:56:49 -0700</bug_when>
    <thetext>Thank you for taking the time to report this issue, but the proposed patch is not correct.

According to MSDN &lt;https://msdn.microsoft.com/en-us/library/windows/desktop/ms647464(v=vs.85).aspx&gt;, puLen is defined as &quot;for version information values, the length in characters of the string stored at lplpBuffer&quot;. Since we are only retrieving version information content, not translation array or root block values, the character count is the correct size.

Since we are calling the wide-character variant of VerQueryValue (VerQueryValueW), the value we get back is a buffer of UCHAR, and the count is the number of these UCHAR characters.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>243481</attachid>
            <date>2014-12-17 21:43:44 -0800</date>
            <delta_ts>2016-03-22 09:43:08 -0700</delta_ts>
            <desc>patch</desc>
            <filename>PluginPackageWin.cpp.patch</filename>
            <type>text/plain</type>
            <size>288</size>
            <attacher name="Bevan Collins">b.collins</attacher>
            
              <data encoding="base64">ZGlmZiAtciBTb3VyY2Vfb3JpZ1xXZWJDb3JlXHBsdWdpbnNcd2luXFBsdWdpblBhY2thZ2VXaW4u
Y3BwIFNvdXJjZVxXZWJDb3JlXHBsdWdpbnNcd2luXFBsdWdpblBhY2thZ2VXaW4uY3BwDQo1NmM1
Ng0KPCAgICAgcmV0dXJuIFN0cmluZyhyZWludGVycHJldF9jYXN0PFVDaGFyKj4oYnVmZmVyKSwg
YnVmZmVyTGVuZ3RoIC0gMSk7DQotLS0NCj4gICAgIHJldHVybiBTdHJpbmcocmVpbnRlcnByZXRf
Y2FzdDxVQ2hhcio+KGJ1ZmZlciksIChidWZmZXJMZW5ndGggLyBzaXplb2YoVUNoYXIpKSAtIDEp
Ow0K
</data>

          </attachment>
      

    </bug>

</bugzilla>