-
Notifications
You must be signed in to change notification settings - Fork 58
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
isTabbableRadio doesn't properly escape query selectors #168
Comments
I'm for adding However I wouldn't add the polyfill, just a no-op fallback, and write about it in the docs because:
I'm not sure injection could cause any serious trouble here, the process that the query is being used in just checks if a radio element is not tabbable (notice that either way it's still a valid focusable element): (1) get a list of candidates elements that are supposed to be in the tested radio group (here you might cause different elements to be selected) (2) if one of those elements has a positive |
Thanks for the suggestion around the polyfill @idoros, I've created PR following it. I also agree with your analysis of the injection scenarios, and that the ramifications of such are fairly trivial. |
@all-contributors add @tidychips for bug |
I've put up a pull request to add @tidychips! 🎉 |
It's possible for radio button names to contain characters that are invalid when used in a CSS selector (e.g.
"
). Below is an example that causes thetabbable
function to throw an error due to an invalid selector constructed at:tabbable/src/index.js
Line 105 in cd06b98
HTML:
JS:
It's also possible to inject values into the selector with a name like:
A potential solution is CSS.escape, but it does require a polyfill for IE.
The text was updated successfully, but these errors were encountered: