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'm not very good making testcases, and I tried to look for the bug, but I couldn'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'm missing?
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
I want to add that this has security considerations, if an attacker is able to add a <base> tag in the middle of the source code, it may leak information to other domains.
As implied by comment 1, we match Firefox here. We probably shouldn't change this unilaterally - but it's definitely something to keep an eye on.
FYI: https://bugzilla.mozilla.org/show_bug.cgi?id=515401 Apparently Gecko is fixing this
WPT do have coverage for BASE tag multiple: https://wpt.fyi/results/html/semantics/document-metadata/the-base-element?label=master&label=experimental&aligned&view=subtest&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't find as well. Appreciate if someone can comment and update the bug status accordingly or attached minimal test case (if needed). Thanks!
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. > I want to add that this has security considerations I think that you are correct, but at this point, it's up to websites to prevent base element injection.