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

[New] Add jsx-no-script-url to prevent usage of javascript: URLs #2419

Merged
merged 1 commit into from Nov 30, 2019

Conversation

sergei-startsev
Copy link
Contributor

In React 16.9 any URLs starting with javascript: scheme log a warning. React considers the pattern as a dangerous attack surface, see details and in a future major release it will throw an error if it encounters a javascript: URL.

The rule prevents usage of javascript: URLs in JSX.

@sergei-startsev sergei-startsev force-pushed the jsx-no-script-url branch 4 times, most recently from 3285ca7 to 01d9fec Compare October 1, 2019 19:15
lib/rules/jsx-no-script-url.js Show resolved Hide resolved
lib/rules/jsx-no-script-url.js Outdated Show resolved Hide resolved
lib/rules/jsx-no-script-url.js Outdated Show resolved Hide resolved
@ljharb ljharb merged commit 2ecdf36 into jsx-eslint:master Nov 30, 2019
@erunion
Copy link

erunion commented Jan 21, 2020

Should this be added to the recommended config?

@ljharb
Copy link
Member

ljharb commented Jan 21, 2020

Not at this time, adding things to the recommended config is a breaking change.

If we ever are forced to do a semver-major, then we'll re-evaluate the recommended config.

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

Successfully merging this pull request may close these issues.

None yet

3 participants