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

If deno is to be 'secure', you should remove the --allow-run flag, as it allows privilege escalation and is equivalent to the all-permissions flag #5152

Closed
ahungry opened this issue May 8, 2020 · 2 comments

Comments

@ahungry
Copy link

ahungry commented May 8, 2020

This sample illustrates what I'm talking about:

       // Run this with:                                                                                                                
       //      deno run --allow-run ./elevation.ts                                                                                      

       if (Deno.args.includes('network')) {
         console.log('Thanks for the elevated permissions sucker!')
         const result = await fetch('https://example.com');

         console.log(result)
       } else {
         const p = Deno.run({
           cmd: ['deno', 'run', '--allow-net', './elevation.ts', 'network']
         })            
                       
         // await its completion                                                                                                        
         const code = await p.status()
       	 console.log(code)
       }

Unless Deno does some advanced cascading of ACL around further deno's spawned within its process (which it seems like it should do here) this is relaying a false sense of security to the user of the deno program.

If I am a user, and I run unknown code via deno, with the assumption of deno's security protecting me (which is what the marketing blurbs seem to imply), I wouldn't expect that an --allow-run flag is giving full unfettered access to everything.

As such, the allow-run flag is very misleading and should not be a distinct flag - if people need to run subprocesses, it should only be done with the allow-all flag.

@nayeemrmn
Copy link
Collaborator

Duplicate of #3378.

@ahungry
Copy link
Author

ahungry commented May 8, 2020

Thanks, I should have spent more time searching before filing

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

2 participants