-
-
Notifications
You must be signed in to change notification settings - Fork 400
fix: replace parse-glob (fixes #664) #827
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
Conversation
Thanks! I tried to inline this, just to see what it was actually trying to do in the code today, but I think there is something missing, since |
@nschonni My bad, I forgot to handle non-globs (path only). |
I'm playing with this in https://github.com/nschonni/HTMLHint/tree/parse-glob-fix by inlining the code. |
@nschonni I added a couple of more test globs to the unit test on my local machine to try it out; I noticed that while This is the only difference in behavior I could find, and I could argue that the behavior of my replacement is more consistent than in the package that was removed. I hope and believe this should be good enough to replace the Whether you chose to approve the PR or to use the function from the PR some other way, I still hope you will be able to release a new version of HTMLHint without Let me know if there's anything more I can do to contribute. |
@nschonni Any progress on this? You need to do something to mitigate the "Regular expression denial of service" vulnerability Even if HTMLHint is just a dev tool, this issue causes a lot of noise and ugliness in static application security test reports etc. I believe my contribution through this PR should make this fairly simple. |
Is it expected that this PR will receive attention or would you recommend instead maintaining personal forks of HTMLHint to eliminate the security issue? |
I've created an updated and rebased version of this PR in #927. I also regenerated the binaries so that my fork can be used directly as a dependency in the meantime. |
@joeyparrish is this PR still relevant? |
This PR replaces the abandoned, security-vulnerable
parse-glob
package with a customparse-glob.js
module/function and thereby fixes issue #664The added module exactly mimics the behavior of the function from the
parse-glob
package, but only includes the subset that is required by HTMLHint in the returned object. It usesis-glob
to validate the glob.Changes:
parse-glob.ts
to replace the vulnerable package@types/parse-glob
package fromdevDependencies
parse-glob
fromdependencies
todevDependencies
(currently needed for the added unit test)is-glob
asdependency
This PR is meant as an intermediate step to prove that the
parse-glob
package has been properly replaced.As a next step it would make sense to:
parse-glob
devDependency - and the simple unit testIf (hopefully when) this PR is approved; let me know if you would like me to contribute with that.