Skip to content

Using smb safely in multiuser environments #2006

@bernt-matthias

Description

@bernt-matthias

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) #2007

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions