multipage 和 one-page 內容有出入
An ASCII tab or newline is U+0009 TAB, U+000A LF, or U+000D CR.
ASCII whitespace is U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, or U+0020 SPACE
&
&
&
<iframe src='<script>alert(1)</script>'>
script
style
內無法使用 HTML entity,但是 svg,math
底下的 script
可以使用,因為會轉換成 xml parsing'"<
=
和 value 間的 \x09\x0a\x0c\x20
protocol, scheme
navigate 大致解析順序
[scheme]:
element src
fetch
API 解析防禦
new URL
解析後才做過濾common
scheme case-insensitive
//
, \\
解析成當前域協議
chrome 正規化實作 https://github.com/chromium/chromium/blob/4ea9fb6208b67451a55f9a2fa2eaba8fd7b61bae/url/url_util.cc#L250C6-L250C20
可以塞垃圾 (<=0x20) 在前後
可以塞垃圾 \r \n \t 到任意位置
location.href="\tjAva\tScript:%0a\ta\tl\te\tr\tt(1)"
TODO: review basic URL parser algorithm
location.href='javascript:"<svg/onload=alert(window.origin)>"'
,
會是 mimetype([mediatype]+[";base64"]), 剩下為 encodedBody,只有 encodedBody 會經過 percent decoding 變成 bodyLet stringBody be the isomorphic decode of body.
(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp)
,其中 ftps|tel|callto|sms|cid|xmpp
取值都不會做 url encode在 document 尚未解析完前 document.write
會寫在下一行,解析完後是 overwrite
猜測:因為 svg 切換成 XML parsing 後,第二層的 svg 經過 tokenize 後直接觸發 tree construction
<meta http-equiv="refresh" content="5; url=https://www.fooish.com">
<!--
close:-->
或是 --!>
<?
開頭會把遇到第一個 >
間的內容都當成註解download
<a href='data:,jizzz' download>
href
a
轉換成字串時,會使用 href
內容A JavaScript property name P is a cross-origin accessible window property name if it is "window", "self", "location", "close", "closed", "focus", "blur", "frames", "length", "top", "opener", "parent", "postMessage", or an array index property name.
https://html.spec.whatwg.org/multipage/browsers.html#crossoriginproperties-(-o-)
Always specify an exact target origin, not *, when you use postMessage to send data to other windows. A malicious site can change the location of the window without your knowledge, and therefore it can intercept the data sent using postMessage.ref
src
data:
, javascript:
data:
origin 會設成 nulljavascript:
要求 same originsrcdoc
csp
sandbox
\n
實際上傳輸變成 \r\n
Content-Type
application/webbundle
: TODOtype
attribute 可接受ㄉ值
webbundle
module
importmap
speculationrules
<script>
碰到 </script>
就會被閉合,執行中間內容<!--<script>
,這個 state 會把後面遇到的 </script>
也當成內容的一部分,然後才尋找 </script>
做閉合,因此可以跨過 script
,另外內容的 <!--
和 <script
要 balanced 內容才會被執行
<!--
和 -->
在 browser 被視為單行註釋,下面的 -->
是為了平衡而沒有註釋效果,被包在 /**/
本身已經是註釋一部份
script
innerText 是無法使用 HTML entity,若是在 svg
裡則可以使用,可以繞過 WAFscript
會解析 HTML entity<foreignObject>
可寫 html<button>, <input>, <meter>, <output>, <progress>, <select>, <textarea>
<input type=image src=x onerror=alert(7122)>
ref: maple3124
<svg></p><style><a id="</style><img src=1 onerror=alert(1)>">