fsspec / fsspec/filesystem_spec

Using smb safely in multiuser environments

Open
#2,006 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.4k
Forks
490
Avg merge
2d 3h
Merged PRs (30d)
38

Description

I was considering to implement access to smb for the Galaxy project where we use fsspec a lot. Galaxy is a multi user environment where we would safely store the information needed to access a smb share (server, port, username, password, path ...). Then we connect via fsspec.implementations.smb.SMBFileSystem.

By chance I noticed that the underlying smbprotocol uses a connection cache which is shared between all connections in a python process. The cache seems to work on server + port as key (maybe username .. but I'm unsure). Hence to me it seems unsafe to use this in a multi user environment, since users might hijack other users sessions (involuntary or deliberately) since they only need to know the server+port+username.

Would you agree with this? Are there possibilities to fix this, e.g. by disabling the global connection cache (one can pass a dict that would be used) as outlined here. Are there maybe other fsspec implementations using different libraries?

Edit: Meanwhile I found the tests and verified my theory (I think) https://github.com/fsspec/filesystem_spec/pull/2007

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review fsspec.implementations.smb.SMBFileSystem and the smbprotocol connection-cache behavior described in issue 62, then compare it with the multiuser scenario here. Use the tests and filesystem_spec#2007 referenced in the issue as verification context; done should be an agreed safe handling or documented limitation backed by tests for separate credentials.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.