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

Usage of debug package #353

Closed
Avishagp opened this issue May 10, 2021 · 7 comments
Closed

Usage of debug package #353

Avishagp opened this issue May 10, 2021 · 7 comments

Comments

@Avishagp
Copy link

Avishagp commented May 10, 2021

Hi @tomas,

One of needle's dependencies is the debug package (used solely in needle.js).

Lately an issue posted in debug package showing there's a critical bug in the package:
User defined window.localStorage.debug could flow into new Regex() function, leading to a Regular Expression Injection.

Since the usage of debug in needle is so minimal, could you switch to using the native util.debuglog option?
It offers the exact same usage needle needs. It'd also mean one less dependency in needle.

Thank you,
Avishag

@tomas
Copy link
Owner

tomas commented May 10, 2021

That would mean losing support for Node versions prior to v0.11.3. I'm not sure if that's the way to go.

Can you provide an example where the debug issue could be exploited in the context of a program using needle?

@Avishagp Avishagp changed the title Usage of vulnerable debug package Usage of debug package May 10, 2021
@vsridhars
Copy link

Hi,

Wanted to check if moving to a debug 4.3.x version would be possible.
Similar audit concerns are getting flagged by parsing tools.

@cmotsn
Copy link

cmotsn commented Jan 13, 2023

@tomas Hi!
2023 update: the usage of debug 3.2.7 is still flagged by security tools due to a memory leak error which can be exploited (see example section in this page)

That memory leak was fixed in debug 4.3.0 in 2020. There doesn't seem to be any backport of the fix, so this would imply using the 4.x.x version of debug, which dropped support for Node 4 and Node 5.

Upgrading to debug 4.3.x would fix this vulnerability (and also the one mentioned in the original Issue post).

@tomas
Copy link
Owner

tomas commented Jan 13, 2023

I think I'm more inclined to replace the debug package with util.debuglog as @Avishagp sugested in the first place. Would that be OK?

@cmotsn
Copy link

cmotsn commented Jan 13, 2023

It would certainly remove any past and future vulnerabilities from the debug package :)

@tomas
Copy link
Owner

tomas commented Jan 13, 2023

Would you submit a PR for this? 🙏

@cmotsn
Copy link

cmotsn commented Jan 13, 2023

I can try on the weekend but as a disclaimer, I do not know the needle client nor am I very familiar with NodeJS X)

@tomas tomas closed this as completed in a0a8702 Dec 8, 2023
tomas added a commit that referenced this issue Dec 8, 2023
Replace `debug` package by node:util.debuglog. Fixes #353
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants