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

Replace url-regex and is-url-superb with custom implementation #120

Closed
richardowen opened this issue Jul 8, 2020 · 6 comments
Closed

Replace url-regex and is-url-superb with custom implementation #120

richardowen opened this issue Jul 8, 2020 · 6 comments

Comments

@richardowen
Copy link

Feature Use Case

There is an open security vulnerability in url-regex (kevva/url-regex#70) and no patch available. The url-regex dependency isn't actually used by this package but even if it was removed, it would still be required further down the dependency tree by is-url-superb. It has been removed as a dependency of that package but upgrading isn't an option as that package now doesn't class protocol-relative URLs as valid. Protocol-relative URLs are valid in CSS so we want to allow them in this package. See #119 for more discussion.

Feature Proposal

  • Implement a new isUrl check in this package
    • This could use the Node.js URL class for the bulk of validation but also needs to allow protocol-relative URLs (not allowed by the URL class)
  • Remove the is-url-superb and url-regex dependencies
@jhuesos
Copy link

jhuesos commented Aug 19, 2020

As a workaround, maybe it could be an option to replace url-regex with url-regex-safe which fixes the issue and I think its API is fully compatible?

jhuesos added a commit to jhuesos/jvega.dev that referenced this issue Aug 19, 2020
This solves some security issues. Only one remain:
shellscape/postcss-values-parser#120
@shellscape
Copy link
Owner

@jhuesos looks good 👍

@richardowen
Copy link
Author

@jhuesos Yes that sounds good.

Note that url-regex isn't actually used in this package right now (although it is a direct dependency so that needs removing). This package uses is-url-superb so the change would need to be replacing is-url-superb with an implementation which uses url-regex-safe.

@Hypnosphi

This comment has been minimized.

@richardowen
Copy link
Author

@Hypnosphi Unfortunately upgrading to that version isn't an option here because the new version doesn't class protocol-relative URLs as valid. See the original comment on this issue for more.

@davilima6
Copy link

Can be closed after #125

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

No branches or pull requests

5 participants