-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
What exactly does it mean to have --allow-write but not --allow-read? #4423
Comments
Here's a systematic list of the ops in
The preceding already require
These currently only require
These are covered by my proposal above.
Perhaps these should also require Note that link does currently require Note also that symlink doesn't currently require
Currently only requires
Not sure about these. Currently they only require
Currently doesn't require any permissions to |
It's very unclear to me that this is a security hole worth trying to close. Especially if it's not feasible to close it completely, as I suspect it may not be. Consider So there'd always at least be this way to tell whether there's a file at Given that, maybe the best thing to do is to make no attempts to close this security leakage, and just document that someone with |
I think this is an error. Raising a new issue #4437 for it. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Say I have a directory
/writeonly
to which I have--allow-write
permissions but not--allow-read
permissions. Some of the things I might want to do inside that directory should clearly be out of bounds (and this is already enforced). For instance, I can't create a file with read-write access there, or open a file for reading. Nor can Istat
a path inside that directory to get any information about the existence, mtime, size, etc of its files.However, there are other things I might try to do that arguably also should be out of bounds, but which aren't currently enforced. For example, although I can't
stat
a path there to see if a file exists, I'm not prevented from telling whether the file exists by other means. I could for instance try to create a file there with open modex
(or{createNew: true, read:false}
), and if the attempt fails, then I know there's a file there. There are other similar possibilities, and the possible exploits (if this is in fact undesirable) will be multiplied when some of the commits I have queued for #4017 are merged.It's easy enough to block these attempts: one just has to add an extra
state.check_read(&path)?;
incli/ops/fs.rs
in the right circumstances. The tricky thing is to decide what those circumstances are. So I'm raising this issue for discussion.Here's a proposal: if I don't have
--allow-read
access to a path, then I shouldn't be able to open a file at that path with{create:false}
or{createNew:true}
options, as that involves checking for the file's existence. The same goes for analogous options forwriteFile
,copyFile
,truncate
, andrename
(most of these are in the queued commits for #4017). Nor should I be able tomkdir
at that path without{recursive:true}
.Still have to review/think about other ops (
symlink
,link
, ...).What about
chdir
? Should I be permitted tochdir
to/writable/subdir
if I don't have --allow-read access to/writable
?The text was updated successfully, but these errors were encountered: