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

Symlinks and Security #5161

Open
Stebalien opened this issue Jun 27, 2018 · 1 comment
Open

Symlinks and Security #5161

Stebalien opened this issue Jun 27, 2018 · 1 comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature need/community-input Needs input from the wider community

Comments

@Stebalien
Copy link
Member

Currently, you can add any arbitrary symlink to IPFS. Now, the gateway won't traverse a random symlink into the filesystem but any tool that simply downloads a directory out of IPFS to the local disk might. This could turn into a security foot gun.

Unfortunately, symlinks are kind of important. The naive solution would be to require that symlinks only point to other files on IPFS or other files within the same archive. However, the former won't work without /ipfs mounted as a fuse filesystem (unless we resolve them on ipfs get which'll remove the symlink) and the latter precludes many valid use-cases for symlinks.

One solution is to add a flag to ipfs get that restricts symlinks. Currently, I'm thinking: --symlinks={all,relative,resolve}. That is:

  • all is the default and allows all symlinks
  • relative only allows symlinks relative to the root of the IPFS directory.
  • resolve resolves symlinks before extracting the files from IPFS (only allowing them to point to other files in IPFS).

Many tools will actually want to use --symlinks=resolve.

@iacore
Copy link

iacore commented May 19, 2022

Maybe just disallow symlink altogether. Having potentially cyclic graph supported in DAG is weird. IMO linking should be handled in a higher layer.

Currently there is no way to tell symlink apart from common file. ipfs cat works on symlink that points nowhere.

Applications need to use their own link format. HTML has <a>. Having on symlink in proclaimed "immutable" storage - IPFS - in a footgun.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature need/community-input Needs input from the wider community
Projects
None yet
Development

No branches or pull requests

3 participants