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

SSHFS gives full access to every user even with -o allow_other #182

Closed
ghost opened this issue Aug 15, 2019 · 5 comments
Closed

SSHFS gives full access to every user even with -o allow_other #182

ghost opened this issue Aug 15, 2019 · 5 comments

Comments

@ghost
Copy link

ghost commented Aug 15, 2019

I've found that the default SSHFS package in Debian 9 (says SSHFS 2.8, FUSE 2.9.7, fuserrmount 2.9.7, kernel interface 7.19) allows any user to write, delete, etc, regardless of permissions. I'd say if this is intentional, it's a bit unobvious from the benign looking man page. If it is unintentional, it's a pretty big security issue and should maybe get a CVE.

Not sure if this is fixed in later versions. I could work with this behavior if there was a -o read_only mode, but I see none. I think that would be a nice feature to have.

I know you said you're busy with other things, I completely understand. I would appreciate it if you can tell me if this was fixed in later versions, intentional or not, etc.

Thank you for your time.

@ghost
Copy link
Author

ghost commented Aug 15, 2019

One more thing, I am using -o slave. Maybe that has something to do with it. -o default_permissions doesn't seem to get it working how I'd like, either.

@jakobcornell
Copy link

Regarding your workaround, you can mount read-only using the mount option ro (the man page doesn't list these options):

sshfs -o ro user@host:path mountpoint

@Nikratio
Copy link
Contributor

Nikratio commented Sep 5, 2019

Thanks for the report. This is intentional on the SSHFS side. -o default_permissions (which is implemented purely in the kernel and libfuse) should work as expected, however and should give you the desired access checks. If this doesn't work, it's a bug.

@ghost
Copy link
Author

ghost commented Sep 5, 2019

Ah, nice. Looks like -o ro works as intended.

-o default_permissions does not allow any non-root read access (even though by permissions, it should).

Thanks for getting back to me.

@Nikratio Nikratio changed the title SSHFS 2.8 (maybe others) -o allow_other allows writes regardless of permissions SSHFS gives full access to every user even with -o allow_other Oct 19, 2019
@Nikratio Nikratio closed this as completed Nov 3, 2019
@Nikratio Nikratio reopened this Nov 3, 2019
@ghost
Copy link
Author

ghost commented Jan 18, 2020

I'm pretty confused with this.

$ id
uid=1984(user) gid=1984(user) groups=1984(user),29(audio)
$ whoami
user
$ pwd
/srv/files/software/gopath
$ ls
pkg/
$ mkdir test
$ ls -ld test
drwxr-xr-x 1 root root 4096 Jan 18 00:20 test/
$ cd test
$ touch foo
touch: cannot touch 'foo': Permission denied

Non-root users can make folders, but they get owned by root.

I'm using -o allow_other, -o default_permissions on 2.10.0. Debian Buster (10) now.

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