Skip to content
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

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

Merged
merged 3 commits into from Mar 25, 2022

Conversation

manuelpuyol
Copy link
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
README.md Outdated Show resolved Hide resolved
Copy link
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!

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

None yet

3 participants