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

lib: add security warning on io full access #53609

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

LeoDog896
Copy link

Adds #53598, warning about access granted to all files.

Should there be a note in the docs, or should that be inlined into the warning?

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/security-wg

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. process Issues and PRs related to the process subsystem. labels Jun 27, 2024
Comment on lines 589 to 591
When `--allow-fs-write=*` is permitted, it may inadvertently lead to invalidating
the permission model because of unintended file access, like full write access
to memory with `/proc/self/mem`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does it apply in a Node.js application? I understand the motivation, but I can't see how this could be exposable.

At this point I don't think we need a runtime warning for that. I think adding a doc warning is ok.

Copy link
Author

@LeoDog896 LeoDog896 Jun 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many projects and programs may recommend permitting all IO operations - and even if they don't, users may do it anyways (like an 'issue' raised in node with pm2, where the author permitted all read operations). A doc warning might be noticed by some, but the immediate jump for libraries that need access to system files outside of the current directory might grant all IO permissions instead of properly checking which ones to grant, which was very common in Deno CLIs (example 1 - inside deno, example 2 - slack install script)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, I think this section might be too specific. There are many paths that users should probably never grant (read or write) access to.

Also, /proc/self/mem is a super specific example, and /proc is only one of many problematic things. (And yet, many applications will want to access /proc because it's the only way to implement many monitoring mechanisms on Linux.)

@RafaelGSS RafaelGSS added the permission Issues and PRs related to the Permission Model label Jun 27, 2024
@RafaelGSS
Copy link
Member

Thanks for the PR!

@LeoDog896
Copy link
Author

@RafaelGSS @tniessen did those two previous commits address your concerns?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run. permission Issues and PRs related to the Permission Model process Issues and PRs related to the process subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants