Skip to content

Enhancement: reimplement "Share with private link" #105

Closed

Description

@Wikinaut

Like in Google Picasa and many other web services, it is often very useful to a pseudo-secret link to share files with someone.

I suggest to add a further file share possibility to the existing "share with link" method:

  • share with hash link

The hash of course salted.

Present shared links look like

Suggested is to have links like

Activity

  1. RandolfCarter commented on Oct 25, 2012

    @RandolfCarter
    Contributor

    Yes, #100 and #105 are related, but not the same. Both features were actually already there in 4.0.x, but are gone again in 4.5...

  2. Wikinaut commented on Oct 31, 2012

    @Wikinaut
    ContributorAuthor

    Actually this was called "Share with private link"

  3. butonic commented on Nov 2, 2012

    @butonic
    Contributor

    Sharing with Link should always use a token to identify the parent to the shared file or directory:
    If I have the following path in my ownCloud files:

    /Images/Events/2012/Developer Meeting
    

    and I share the "Developer meeting" folder the link should look like

    http://localhost/owncloud/public.php?service=files&token=GTx3gEW7yY7oxujQ35t5fbCnAdHNqGaF&file=/Developer Meeting
    

    This way my folder structure is not exposed. The token should work like a chroot.

    We can set a password for the token and even use it to identify contacts. This would allow us to use individual passwords for contacts. The token should even be used for public links to not reveal any other information of my folder structure.

    @MTGap what dou you think? I need this and if you think this is ok I'll start implementing it. Just checking that you haven't started anything here or have other plans...

  4. butonic commented on Nov 2, 2012

    @butonic
    Contributor

    @jancborchardt how does dropbox handle this? do they use a token? do they show the filename in the url?

  5. jancborchardt commented on Nov 2, 2012

    @jancborchardt
    Contributor

    Yeah, previously I cared about the cleartext filename being in the link somewhere, now I don’t even anymore.

    Just for the record: When I said the filename should be shown in the link, I never suggested to expose the whole path of a shared file. :)

  6. Wikinaut commented on Nov 3, 2012

    @Wikinaut
    ContributorAuthor

    For security reasons, I rather suggest never to have file- oder directory names in the hash and to construct links like (only the extension is preserved)

  7. philippefx commented on Nov 3, 2012

    @philippefx

    Supporting this,

    • current system is a security issue (it disclose the files and directory structure) (and this is an bad thing©)
    • in case the file is renamed, the link won't work anymore (and this is an bad thing©)
  8. jancborchardt commented on Nov 5, 2012

    @jancborchardt
    Contributor

    Right, the file renaming issue is a dealbreaker. Then let’s just fully tokenize it – including the extension, because that also is a security issue when sharing a password-protected file (because others would know it’s an image or text).

  9. Wikinaut commented on Nov 5, 2012

    @Wikinaut
    ContributorAuthor

    @jancborchardt I think the extension must stay intact like in my example

    to allow extension-based clients and servers and operating systems to auto-detect the correct handler for that file (text editor, image viewer, mp3 player ...)

  10. RandolfCarter commented on Nov 5, 2012

    @RandolfCarter
    Contributor

    an mp3 file in a subdirectory
    https://example.org/owncloud/public.php?service=files&file=GTx3gEW7yY7oxujQ35t5fbCnAdHNqGaF/bYtiKXjnCj9xgDskyKaixREJ8w2nzE9o.mp3

    That is not how it's supposed to work in my opinion - that way, you're not only leaking the file extension, but also how deep the directory structure is! And you will most probably have the same problems when directories are renamed... the only proper solution in my eyes is to use a single hash value, like this:
    https://example.org/owncloud/public.php?service=files&file=GTx3gEW7yY7oxujQ35t5fbCnAdHNqGaF
    no matter in how deep a subdirectory the actual file is. No extension should be necessary - the file type should be sent via mime type header as far as I know; it would have to be tested if every browser and OS is capable of determining the type from that, though.

    The hash value is stored in whatever table the share is stored in, mapping to the proper location of the file; and when a directory is moved/renamed while owncloud is watching, this share's location can be simply adapted by changing the table with the mapping!

  11. philippefx commented on Nov 5, 2012

    @philippefx

    I don't even think the extension is necessary - that should be sent via mime type header as far as I know; it would have to be determined if every browser and OS is capable of doing so, though.

    Yes, I think providing the link with hash but keep the extention seems a bad idea.
    And every browser is able to deal with with mime types.

  12. LukasReschke commented on Nov 5, 2012

    @LukasReschke
    Contributor

    We should also remove the "Foo shared the folder Bar with you", I don't see a reason to disclose the owner of the file.

    \cc @jancborchardt

    Edit: I opened a new issue for this #247

  13. butonic commented on Nov 7, 2012

    @butonic
    Contributor
    • I think we all agree that using a tokenized url Is needed to handle file renames correctly.
      ** While a token is only needed when sending links, I can imagine a "notify via email" button for owncloud users that would use a token as well to directly open the shared item when the user is logged in.
    • Apart from browsers being responsible to hande mimetype, using file extensions is not necessary, as the current sharing implementation presents an authorized guest an html page with a preview for images and a download button.
      ** nevertheless using a raw=true parameter like github uses to directly link to a file should be possible. See this image url: Favicon Something like https://example.tld/owncloud/public.php?service=files&t=GTx3gEW7yY7oxujQ35t5fbCnAdHNqGaF?raw=true to be able to directly link to public files
    • The "Foo shared the folder Bar with you" is a matter of preference of the owncloud administrator. We can move this decision to the theme. It should however be possible to greet e.g. contacts with their name.

    @MTGap I have been trying to figure out the best way how to re add tokenized urls to the sharing api. Basically a token is used to lookup the correct row in the oc_share table. Everyting else can then be read from there. I could store the token in the oc_share table by adding a column there and passing a random token to OC_Share::put(). put() does some magic for groups and I haven't had the time to understand generateTarget(). So I'm a little bit reluctant to touch that code. I could then use a token to lookup a share in public.php and load the parameters before using getShareWithByLink ... at least thats the plan. Any insight from you would be helpful. Thx!

  14. 1 remaining item

  15. DeepDiver1975 commented on Nov 12, 2012

    @DeepDiver1975
    Contributor

    @butonic cool - awaiting your pull request ;-)

  16. jancborchardt commented on Nov 15, 2012

    @jancborchardt
    Contributor

    On Thu, Nov 15, 2012 at 7:03 PM, RandolfCarter [email protected]:

    Do I see correctly that there is still the possibility to set a password?
    Why is that needed? In my opinion it provides no additional security. The
    token is such that it can't be guessed in reasonable time anyway, and if
    someone should get hold of the link he or she will by all chances also get
    the password (since they are distributed in the same email)...

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/105#issuecomment-10418550.

    (Did you delete your comment?)

    I’d agree that an additional password is not needed. I’d prefer we remove
    it, but I guess it was a customer request.

  17. MTGap commented on Nov 15, 2012

    @MTGap
    Contributor

    I’d agree that an additional password is not needed. I’d prefer we remove
    it, but I guess it was a customer request.

    What are you talking about? We both discussed this for a long time and agreed on it...

    The point is that normal users don't understand that it is secured because of the token and it is only security through obscurity.

  18. ghost assigned on Nov 15, 2012
  19. Wikinaut commented on Nov 16, 2012

    @Wikinaut
    ContributorAuthor

    @jancborchardt wrote "I’d agree that an additional password is not needed. I’d prefer we remove it, but I guess it was a customer request"

    In cases where someone revealed the "shared link" (e.g. published that, or used a link shortener like tinyurl), the shared link is not "secret" anymore.

    The alternative method to set a password adds a layer of security to any link, wether it is a shared link (hash) or a plain link to a fil.

    This is why I like to have both possibilities in ownCloud.

    i) shared link (hashed link)
    ii) optional: a password needed for this file

  20. RandolfCarter commented on Nov 16, 2012

    @RandolfCarter
    Contributor

    (Did you delete your comment?) I’d agree that an additional password is not needed. I’d prefer we remove it, but I guess it was a customer request.

    Yes I removed the comment, sorry for the confusion. I did so because after adding it I came up with two reasons why the password could be left in:

    • "Subjective" security (users feeling more secure because there is a password, as described by MTGap
    • It could make things more secure if the password is transmitted via a separate channel (e.g. the link via email and the password via telephone)
  21. jancborchardt commented on Nov 16, 2012

    @jancborchardt
    Contributor

    Yeah, sorry for the confusion @MTGap – the password should of course stay because it provides more perceived security and more actual security as well. So nevermind my comment.

  22. jancborchardt commented on Dec 4, 2012

    @jancborchardt
    Contributor

    This was fixed by @butonic in #380. Wohoo!

  23. srednax commented on Jan 22, 2013

    @srednax

    I wonder if it is possible for an outsider to see an unshared file if one knows the path? Silly probably, but is it stored/checked if a file is shared?

    I do not understand why sharing a file should mean sharing a webpage with access to that file. I'd rather see the direct link as the default, and if I really thought a webpage presenting the file could make sense, there'd be an excedption for that - "&raw=false" or stlt ;)

  24. RandolfCarter commented on Jan 22, 2013

    @RandolfCarter
    Contributor

    I wonder if it is possible for an outsider to see an unshared file if one knows the path?
    With the current share by link, there shouldn't be any path in the share link, and therefore no chance to just change the path...

    I do not understand why sharing a file should mean sharing a webpage with access to that file. I'd rather see the direct link as the default, and if I really thought a webpage presenting the file could make sense, there'd be an excedption for that - "&raw=false" or stlt ;)

    For a single file I tend to a agree with the direct file access, but for a directory, viewing the files (as it currently is) is the way to go ;)

  25. locked as resolved and limited conversation to collaborators on Aug 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions