-
Notifications
You must be signed in to change notification settings - Fork 946
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
Problem when using a library that uses debug
in Deno
#981
Comments
Er, No sorry. The whole point is that debug uses the environment to configure itself. Very common thing for logging libraries to do. |
Yes, sure. I get that. Totally valid point. I'm just asking if you could change it, so that the acccess to Or that you access the variables that you need in Deno starts scripts without any permissions and then grants permissions as needed which is a huge security benefit. This is completely negated when I have to grant permission to access all environment variables. |
I'm not quite sure what the difference is; environment variables are still being accessed. How does delaying their access provide any security benefit? |
I'm not completely certain on how your module works, but I can see from glancing over the code, that Deno is designed in a way, that the end user, who is running the script can grant access per environment variable, which is useful if you have data in your ENV that you don't want exposed to potentially thousands of node modules that might be installed in a project. If a module access I'm not sure if I'm able to communicate clearly, what I mean... |
I mean I'm not really sure that anything I do is going to fix Deno's case. There are still millions of packages that will never upgrade to the latest version. This will always be a problem. It's also a questionable way to achieve security, if you ask me. |
Valid point.
I get that it's not that important to you. Would you consider it, if I'd open a PR with the changes I'm proposing? |
It really depends on the changes but sure, I can take a look. |
This would probably also solve another problem I'm encountering: I'm running a Node.js application bundled by Vite and want to configure debug logging for the The proposed delayed loading would be a great solution for this use case, since it would allow setting the debug configuration before the actual environment variable reading happens. |
I use
jsdom
in a project in Deno.jsdom
usesdebug
as a dependency:Deno asks for permission for access to environment variables. Unfortunately
debug
accessesprocess.env
directly and on requiring the module itself which leads to the following request by Deno.This goes against the principle of least privilege. Denying the request leads to an exception, because the code can't handle a rejection of that request with Deno's API.
Long story short: Could you please change the behaviour of your library, so that the
process.env
is not accessed on module load?The text was updated successfully, but these errors were encountered: