Skip to content

Two minor changes from internal#8855

Merged
sophiebits merged 1 commit into
react:masterfrom
sophiebits:fbx
Jan 24, 2017
Merged

Two minor changes from internal#8855
sophiebits merged 1 commit into
react:masterfrom
sophiebits:fbx

Conversation

@sophiebits

Copy link
Copy Markdown
Collaborator

No description provided.

@gaearon

gaearon commented Jan 24, 2017

Copy link
Copy Markdown
Collaborator

This didn’t flow well.

@gaearon gaearon mentioned this pull request Jan 24, 2017
// set to true and it does not execute
var div = ownerDocument.createElement('div');
div.innerHTML = '<script></script>';
div.innerHTML = '<script><' + '/script>'; // eslint-disable-line

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I am curious. What's that concatenation for? Is it a security-related thing?

@dotspencer dotspencer Nov 28, 2018

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about this too... 🤔

@sophiebits sophiebits Nov 28, 2018

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is to avoid this class of bug when inlining the full React source into a <script> tag: https://sophiebits.com/2012/08/03/preventing-xss-json.html.

Really the fix should not be made here though, this was really a hack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants