I thought about the XSS vulnerability for my application. On the server side, I do not sanitize input or output, so
<script>alert(document.cookies)</script>
stored in the database just like that. To view this value on the client side, I use Mustache. If this script was executed by the administrator, it is of course easy to capture his session. However, I noticed that Mustache by default avoids these values ββand \ "<> when you use the {{}} syntax. I need to worry about XSS when the value from the database is inserted into
<p>{{value}}</p>
or even
<p data-id='{{value}}'>something</p>
? Should I perhaps browse my Mustache templates to find any vulnerable code, or if I will not use
<script>{{value}}</script>
I'm safe?
source share