Replies: 6 comments 3 replies
-
Hi @kt3k, as you have shown interest in the |
Beta Was this translation helpful? Give feedback.
-
I'm not a rust dev, but from I see such thing could be implemented in wrapping the collecting of the env vars after the permission check: Line 105 in cc32a29 |
Beta Was this translation helpful? Give feedback.
-
@mechanoid Thanks for the suggestions!
Right, we also observe that a lot of npm modules access a lot of env vars even when they are not necessary for them to work correctly. Currently we also consider adding options like |
Beta Was this translation helpful? Give feedback.
-
Hey, If The prompt option seems also a really good idea, but again it leaves people without possibility to use those packages that ask for too much. I think a combination of both would be great though! Thanks a lot for your feedback, and happy to be able to contribute! |
Beta Was this translation helpful? Give feedback.
-
Hi @kt3k , @bartlomieju , sorry to interrupt you and approach you this directly. I think this topic is rather critical, as the adoption of |
Beta Was this translation helpful? Give feedback.
-
In a bit of a similar fashion, I'm running into this issue with This is common as libraries often do |
Beta Was this translation helpful? Give feedback.
-
While it is great that
--allow-env=*
raises an exception, when a program uses a not permitted env variable, I think in contrast to other--allow-*
Permissions ofdeno run
the pattern is not enough for env access.In the wild many libraries want to access possibly more Env-Variables than a programm writer want to grant access to. Especiall when you see lib-authors see using
Deno.env.toObject()
or similar. This results oft in providing access to all the Environment via--allow-env
possibly introducing more security vulnerabilities.I would love to see a
deno run
option like--grant-env
(or something similar), that actually silently does not give access to a variable without failing.Especially with the
npm
world becoming more accessible, the deno permission spirit faces lots of libraries written in a different mindset, eagerly reading all env variables without hesitation. I think a solution as described would improve the security of deno apps a lot.As an example:
So
--allow-env
would allow a user to ask forPORT
, but when--grant-env
is specified, but not definingPORT
, it is silently empty and result in an empty string.Beta Was this translation helpful? Give feedback.
All reactions