base
Last updated
Last updated
The HTML element specifies the base URL to use for all relative URLs in a document.
<base>
tag injection allows redirecting relative URLs to an arbitrary host.
For example, for the following page, the browser will request a script from https://attacker-website.com/assets/some-script.js
.
In other words, if there is a way to inject the <base>
tag it is possible to inject arbitrary JavaScipt code to the <scripts>
elements that download scripts using relative URLs.