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

env privilege escalation through postscript protocol #216

Closed
dherman opened this issue Dec 13, 2018 · 0 comments · Fixed by #559
Closed

env privilege escalation through postscript protocol #216

dherman opened this issue Dec 13, 2018 · 0 comments · Fixed by #559
Labels

Comments

@dherman
Copy link
Collaborator

dherman commented Dec 13, 2018

The "postscript" protocol conveys read/write access to the user's console environment by executing an arbitrary script provided by the delegated notion executable in the user's console environment. If there are any places where this access is granted to untrusted code (such as via notion exec), that access could potentially be leaked to the untrusted code.

I'm not sure how much damage can be done with full access to the console's environment, but we shouldn't ever give more privileges than necessary.

I believe we should be able to lock this down by only using the protocol when the wrapper script detects that the command is activate or deactivate, which are the only commands that require this access. We should also document in those commands that they must never invoke untrusted code since they have increased env privileges.

This should have the additional benefit of shaving some boot time latency off, since generating the random bits for the postscript variable takes time, which we can limit to only the (off-the-beaten-path) activate/deactivate commands.

If we want a bit more paranoia, we could add extra logic to any commands that call untrusted code to censor the NOTION_POSTSCRIPT environment variable first. (I doubt that should affect measurable performance.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant