Re:Mixing Vue.js templates with server-side templates can le...
by Scryptonite on Sunday February 25, 2018 @10:30PM
(#16462867)
Yup. Obfusticating using a tool like http://www.jsfuck.com would get around the lack of quotations.
If the result was too verbose, you can always handroll your own JS:
{{constructor.constructor(constructor.name.constructor.fromCharCode(97,108,101,114,116,40,39,120,115,115,39,41))()}}
Re:Mixing Vue.js templates with server-side templates can le...
by krapp on Monday February 26, 2018 @06:51AM
(#16464662)
> the problem is that htmlspecialchars() doesn't know to escape {{ }}, and that that then allows user input to get interpreted as Vue template expressions
Arguably, that's not a problem, because '{' and '}' aren't HTML special characters, so the function is working exactly as intended.
If you have a sanitizer that cleans up ' and ", that'd only serve to limit the vulnerability to executing javascript without quotations in it. That's nowhere near a comfortable place to be - user data should not end up interpreted as Javascript, quotations or not.