Skip to content

Add rule to prohibit building script tags in the client#223

Merged
manuelpuyol merged 3 commits intomainfrom
no-script-tag-building
Mar 25, 2022
Merged

Add rule to prohibit building script tags in the client#223
manuelpuyol merged 3 commits intomainfrom
no-script-tag-building

Conversation

@manuelpuyol
Copy link
Copy Markdown
Contributor

We should never allow building script tags in our applications since they side-step some security measures.

@manuelpuyol manuelpuyol requested a review from a team as a code owner March 24, 2022 17:08
@manuelpuyol manuelpuyol requested a review from theinterned March 24, 2022 17:08
Comment thread lib/rules/no-script-tag-building.js Outdated
Comment thread README.md Outdated
Copy link
Copy Markdown
Contributor

@theinterned theinterned left a comment

Choose a reason for hiding this comment

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

❤️ Thank you for addressing my feedback!

Comment thread lib/rules/no-dynamic-script-tag.js Outdated
]
},
{
code: 'document.createElement("span").type = "text/javascript"',
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.

This should be a script right? Spans don't have a type.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I just wanted to test that .type = "text/javascript" will fail. If I add document.createElement("script"), it will fail without checking the type

Co-authored-by: Kristján Oddsson <koddsson@gmail.com>
@manuelpuyol manuelpuyol merged commit 36a1dd0 into main Mar 25, 2022
@manuelpuyol manuelpuyol deleted the no-script-tag-building branch March 25, 2022 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants