Is there an example of misuse of dangerouslySetInnerHTML in ReactJS?
Everytime I look this up, it's just someone waving their hand and saying "cross site scripting."
I've seen dangerouslySetInnerHTML used to load CSS files with a css loading npm module:
import {stylesheet, classNames} from '../static/css/styles.css'
<Head><style dangerouslySetInnerHTML={{__html: stylesheet}} /></Head>
And I'm contemplating using dangerouslySetInnerHTML for some script tags for social media share buttons that have been causing my team trouble.
Code examples and explanations of how one would go about hacking a page with XSS would be highly appreciated!
<script dangerouslySetInnerHTML={someTextSubmittedByAUser}></script><in the string you are assigning todangerouslySetInnerHTML