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

Vulnerability in url-regex indirect dependency #1646

Open
silverwind opened this issue Aug 18, 2020 · 11 comments
Open

Vulnerability in url-regex indirect dependency #1646

silverwind opened this issue Aug 18, 2020 · 11 comments
Labels
tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build type/upstream Any issues in dependencies type/usage Any support issues asking for help
Milestone

Comments

@silverwind
Copy link

┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ No patch available                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ fomantic-ui                                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ fomantic-ui > gulp-concat-css > rework-import > url-regex    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/1550                            │
└───────────────┴──────────────────────────────────────────────────────────────┘

All these dependencies look pretty unmaintained to me so I think the best course of action would be to look for alternatives to gulp-concat-css.

@silverwind silverwind added state/awaiting-triage Any issues or pull requests which haven't yet been triaged type/usage Any support issues asking for help labels Aug 18, 2020
@lubber-de lubber-de added dependencies Pull requests that update a dependency file and removed state/awaiting-triage Any issues or pull requests which haven't yet been triaged labels Aug 19, 2020
@PMudra
Copy link

PMudra commented Aug 20, 2020

Some additions:

  • gulp-concat-css: 2 years ago
  • rework-import: 5 years ago
  • url-regex: a year ago

Upstream issue: kevva/url-regex#70

This issue is fixed in my maintained and modern version of this package at https://github.com/niftylettuce/url-regex-safe. You should be able to switch from url-regex to url-regex-safe now.

@ceisele-r
Copy link

Well this would mean that gulp-concat-css would have to depend on a forked rework-import package that depends on https://github.com/niftylettuce/url-regex-safe. Since they all seem to be unmaintained, none of them will probably switch to any other dependency meaning as @silverwind supposed the way to go is probably replacing gulp-concat-css.

@lubber-de lubber-de added Hacktoberfest Issues for Hacktoberfest! tag/help-wanted Issues which need help to fix or implement labels Sep 22, 2020
@gilquintana
Copy link

One question: do you have an estimated date for the attencion of this issue?

@lubber-de lubber-de removed the Hacktoberfest Issues for Hacktoberfest! label Jan 19, 2021
@lubber-de
Copy link
Member

One question: do you have an estimated date for the attencion of this issue?

Whenever somebody volunteers to maintain new packages or rewrite the dependency code to be directly included into the core

@phiberber
Copy link

One question: do you have an estimated date for the attention of this issue?

Whenever somebody volunteers to maintain new packages or rewrite the dependency code to be directly included in the core

There's a branch that can be used that uses the URL regex safe dependency. I can create a PR using it if you want me to.

https://github.com/Cj-bc/gulp-concat-css/tree/use_url-regex-safe_rework-import

@lubber-de
Copy link
Member

lubber-de commented Feb 2, 2021

There's a branch that can be used that uses the URL regex safe dependency. I can create a PR using it if you want me to.

https://github.com/Cj-bc/gulp-concat-css/tree/use_url-regex-safe_rework-import

Thanks, you are welcome to provide a proper PR.

@phiberber
Copy link

After looking on it for a while, url-regex-safe doesn't seem to be a good option as it uses node-re2 (A node-gyp wrapper for Google re2). Would be nice if someone could find an alternative for url-regex. Also, gulp-concat-css is only used when packing the CSS, I'm not that good at hacking but I don't think that it would be possible to exploit that vulnerability. Then there should be no need to worry about it.

@silverwind
Copy link
Author

I too think a C++ dependency like node-re2 is a no-go because it limits portability and is very prone to break in future Node.js versions. I'm sure there must be better alternatives.

@lubber-de lubber-de added type/upstream Any issues in dependencies and removed dependencies Pull requests that update a dependency file labels Feb 22, 2021
@onelifenyc
Copy link

onelifenyc commented May 6, 2021

I just wanted to bring up the fact that this issue is also found in the following deps:

image
+
image

I didn't find any issue reported about it - I am sorry for tagging it along here. Let me know if I should open a new issue.

https://npmjs.com/advisories/1631
https://npmjs.com/advisories/1677

@MeFisto94
Copy link

I am a nodeJS beginner, so bear with me if my proposal/thinking is wrong.

  1. Besides fixing the issues themselves, since the issues (at least the gulp related ones) never make it into the dist-files, it is some kinda false-positive for downstream projects.
  2. It's furthermore less risky, because developers typically control the input to gulp in some form anyway.
  3. Couldn't all gulp dependencies be moved into the devDependencies field anyway, because there isn't any part of fomantic-ui that makes it into the runtime? (besides the distribution, ofc). I tried that locally, and it gets rid of the issues within npm audit, I think (only hiding them, ofc).
  4. Extending by that, shouldn't end-users also add fomantic-ui as dev dependency, given that they only need it to generate the dist?

On topic of gulp-dedupe, the last version has been pushed 7 years ago and it's 50 SLOC, I wonder why no-one has just forked it and accepted the dependabot PR bumping diff 3 major versions. Shouldn't be too much of a maintenance burden, but at the same time maybe there are maintained deduping alternatives.

@lubber-de
Copy link
Member

gulp5 was upgraded by #3032
all other plugings have been upgraded by #3047

The remaining/new 2 moderate warnings will be fixed in FUI 2.10.0 when node 12 is dropped

@lubber-de lubber-de added this to the 2.9.4 milestone May 9, 2024
@lubber-de lubber-de added state/has-pr An issue which has a related PR open and removed tag/help-wanted Issues which need help to fix or implement Hacktoberfest Issues for Hacktoberfest! state/has-pr An issue which has a related PR open labels May 9, 2024
@lubber-de lubber-de added the tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tag/next-release/nightly Any issue which has a corresponding PR which has been merged and is available in the nightly build type/upstream Any issues in dependencies type/usage Any support issues asking for help
Projects
None yet
Development

No branches or pull requests

8 participants