<?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>30432</bug_id>
          
          <creation_ts>2009-10-16 01:10:42 -0700</creation_ts>
          <short_desc>BASE tag is allowed more than once and outside the &lt;head&gt; section</short_desc>
          <delta_ts>2022-08-19 17:15:39 -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>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc>http://zaz.sirdarckcat.net/zaz</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="eduardo vela">sirdarckcat</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>cdumez</cc>
    
    <cc>rniwa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>155039</commentid>
    <comment_count>0</comment_count>
    <who name="eduardo vela">sirdarckcat</who>
    <bug_when>2009-10-16 01:10:42 -0700</bug_when>
    <thetext>Reproducible: Always

Steps to Reproduce:
1. Go to http://zaz.sirdarckcat.net/zaz/ (a script that alerts the location of
the script being included).
2. See the alerts
Actual Results:  
the alerts are:
a/b.js
a/b/c.js
a/b/c/d.js
a/b.js
a/b/c.js
a/b/c/d.js

Expected Results:  
the alerts should be:
a/b.js
a/c.js
a/d.js
a/b.js
a/c.js
a/d.js

I&apos;m not very good making testcases, and I tried to look for the bug, but I
couldn&apos;t find it.. I think this is a well known bug for developers, so I guess
its a dupe, but I couldnt find the bug where this is being discussed.

In any way, I want to propose this being fixed, or are there some details I&apos;m
missing?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>155040</commentid>
    <comment_count>1</comment_count>
    <who name="eduardo vela">sirdarckcat</who>
    <bug_when>2009-10-16 01:12:53 -0700</bug_when>
    <thetext>I should have reported this here instead of chromium:
http://code.google.com/p/chromium/issues/detail?id=25017

And I also submitted a bug report for firefox:
https://bugzilla.mozilla.org/show_bug.cgi?id=522658</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>155044</commentid>
    <comment_count>2</comment_count>
    <who name="eduardo vela">sirdarckcat</who>
    <bug_when>2009-10-16 01:25:59 -0700</bug_when>
    <thetext>I want to add that this has security considerations, if an attacker is able to
add a &lt;base&gt; tag in the middle of the source code, it may leak information to
other domains.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>155295</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-10-16 15:59:16 -0700</bug_when>
    <thetext>As implied by comment 1, we match Firefox here. We probably shouldn&apos;t change this unilaterally - but it&apos;s definitely something to keep an eye on.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>156088</commentid>
    <comment_count>4</comment_count>
    <who name="eduardo vela">sirdarckcat</who>
    <bug_when>2009-10-20 00:08:17 -0700</bug_when>
    <thetext>FYI:
https://bugzilla.mozilla.org/show_bug.cgi?id=515401

Apparently Gecko is fixing this</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1890354</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-08-10 11:02:22 -0700</bug_when>
    <thetext>WPT do have coverage for BASE tag multiple:

https://wpt.fyi/results/html/semantics/document-metadata/the-base-element?label=master&amp;label=experimental&amp;aligned&amp;view=subtest&amp;q=base

Safari TP 150 passes all tests, do we need to do something here? The test URL does not work and I tried to look into Wayback Archive but couldn&apos;t find as well. Appreciate if someone can comment and update the bug status accordingly or attached minimal test case (if needed). Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1892565</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2022-08-19 17:15:39 -0700</bug_when>
    <thetext>Not sure if WPT covers everything that this bug talks about, but in my testing, all browsers agree now.

- When there are multiple BASE elements, only the first one is respected.
- BASE elements in BODY _are_ respected.

&gt; I want to add that this has security considerations

I think that you are correct, but at this point, it&apos;s up to websites to prevent base element injection.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>