-
Notifications
You must be signed in to change notification settings - Fork 47.4k
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
What does dangerouslySetInnerHTML prop do? How is it achieved? #14509
Comments
The prop react/packages/react-dom/src/client/ReactDOMComponent.js Lines 311 to 316 in c954efa
setInnerHTML can be found here: react/packages/react-dom/src/client/setInnerHTML.js Lines 40 to 45 in c954efa
The implementation we use in preact is similar, although quite a bit shorter: Because it passes a raw For everything security related the owasp guidelines have a great page about html injection: https://www.owasp.org/index.php/DOM_based_XSS_Prevention_Cheat_Sheet |
|
@marvinhagemeister @milesj Thank you very much, I got the answer I want. |
I understand the most basic xss. I used this property in my project and found this feature is no different from innnerHtml.
I read the source code, but because of the level and Time is limited.I have not been able to find the relevant code. I want to know if it can avoid the risk of xss? Are there other risks? At the same time, if someone knows the location of the relevant code, can you help me to point it out? I have no plans to read the entire code for the moment.
The text was updated successfully, but these errors were encountered: