-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An alternative fix suggestion for legacy apps #5
Comments
@dalevink It would be better to escape even one '{' character. Otherwise XSS is still possible, if you concatenate output somewhere. For example:
|
It would be great if the Haven't had a chance to test it but that would make sense without adding extra spans throughout your layout. UPDATE: Just tested and vue still interprets the entities! Thats interesting... |
@helmut I found this and was surprised too that Vue interprets the entities! Yeah, the extra spans aren't pretty, but they could be a temporary trade-off as you migrate to better methods. Hold that thought… here’s a way to avoid ANY extra markup and simply use Vue itself to escape the string: |
@dalevink This is also a nice solution, but then you should be careful if you use this escape method outside of the Vue app scope (e.g. in the header). |
I have a suggestion, for any existing app that consistently addresses existing XSS vulnerabilities (pre Vue).
For example, you (should?) have an existing "globally" used function, such as:
Could this be simply altered to include the escaping of Vue template interpolation, eg:
A possible one line fix?
Note: Updated code fix as per suggestion below – thanks to @apreiml
The text was updated successfully, but these errors were encountered: