Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

XSS in tutorial example #11

Closed
bls opened this issue Jan 13, 2015 · 2 comments
Closed

XSS in tutorial example #11

bls opened this issue Jan 13, 2015 · 2 comments

Comments

@bls
Copy link

bls commented Jan 13, 2015

Hi,

There is a pretty obvious XSS in the example code -- a comment such as:

 <img onmouseover="alert(1);" src="http://www.frikipedia.es/images/thumb/d/d5/Asdsa-asdas.jpg/300px-Asdsa-asdas.jpg">

Will trigger JS exec.

There are some XSS "signposts" in the tutorial (Quote: "Remember: by using this feature you're relying on Showdown to be secure."), but ultimately this isn't setting a great example for new react developers.

Thanks - Blair.

@bls
Copy link
Author

bls commented Jan 13, 2015

Oh, it seems like this is related to this: showdownjs/showdown#70 ... (i.e, the comment regarding "relying on showdown to be secure" is spot on).

@zpao
Copy link
Member

zpao commented Jan 13, 2015

Meh, this is far and away not the point of the tutorial. It's not production code, it's a tutorial. And we call out that by using dangerouslySetInnerHTML you are explicitly opting out of React's protection.

Thanks for calling it out, but I don't think it's worth making an effort to fix.

@zpao zpao closed this as completed Jan 13, 2015
shenxl pushed a commit to shenxl/react-tutorial that referenced this issue Sep 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants