Skip to content

Files get has no way to specify the name of the file once it is retrieved #48

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

Open
whereswaldon opened this issue Aug 3, 2016 · 5 comments

Comments

@whereswaldon
Copy link
Contributor

In the IPFS CLI, you can use ipfs get -o <hash> to get a file and save it with a given name, but the ipfsApi.Client().get() function does not have this capability right now.

@lordcirth
Copy link
Contributor

I intend to fix this issue.

@ntninja
Copy link
Contributor

ntninja commented Jan 30, 2019

@lordcirth: Any help is appreciated! Please make sure that you develop against the py-ipfs-http-client branch however as that is the code that will become the new master soonish. Thanks for the heads up and your help!

@lordcirth
Copy link
Contributor

lordcirth commented Jan 30, 2019 via email

@lordcirth
Copy link
Contributor

lordcirth commented Feb 2, 2019

From the docs for tarfile.extractall [1]

Never extract archives from untrusted sources without prior inspection. It is possible that files are created outside of path, e.g. members that have absolute filenames starting with "/" or filenames with two dots "..".

Is this something we ought to be concerned about? Would this attack allow a malicious IPFS object to overwrite files, or only a malicious IPFS daemon? Is tar formatting applied by the IPFS daemon? In that case it's not a big deal.

EDIT: API docs imply that the tar format is created by the IPFS daemon. [2]

[1] https://docs.python.org/2/library/tarfile.html#tarfile.TarFile.extractall
[2] https://ipfs.docs.apiary.io/#reference/get/get/get

@ntninja
Copy link
Contributor

ntninja commented Feb 13, 2019

@lordcirth: Didn't see your message yet. The tarfile is indeed assembled by the IPFS daemon, not part of some IPFS file.

It'd be still be good to guard against this since there is no guarantee that this library will be used with a trusted daemon. Maybe this can be done as part of #158? 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants