You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enhancement: reimplement "Share with private link" #105
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...
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)
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).
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 ...)
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!
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.
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.
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!
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.
@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
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.
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 ;)
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 ;)
Activity
RandolfCarter commentedon Oct 25, 2012
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...
Wikinaut commentedon Oct 31, 2012
Actually this was called "Share with private link"
butonic commentedon Nov 2, 2012
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:
and I share the "Developer meeting" folder the link should look like
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...
butonic commentedon Nov 2, 2012
@jancborchardt how does dropbox handle this? do they use a token? do they show the filename in the url?
LukasReschke commentedon Nov 2, 2012
@butonic Token.
https://www.dropbox.com/sh/fsfkqd4kjflcuj2/Wge9KXDucU
jancborchardt commentedon Nov 2, 2012
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. :)
Wikinaut commentedon Nov 3, 2012
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)
philippefx commentedon Nov 3, 2012
Supporting this,
jancborchardt commentedon Nov 5, 2012
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).
Wikinaut commentedon Nov 5, 2012
@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 ...)
Wikinaut commentedon Nov 5, 2012
addition:
a subdirectory
an mp3 file in a subdirectory
RandolfCarter commentedon Nov 5, 2012
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!
philippefx commentedon Nov 5, 2012
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.
LukasReschke commentedon Nov 5, 2012
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
butonic commentedon Nov 7, 2012
** 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.
** nevertheless using a raw=true parameter like github uses to directly link to a file should be possible. See this image url:
@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!
1 remaining item
DeepDiver1975 commentedon Nov 12, 2012
@butonic cool - awaiting your pull request ;-)
jancborchardt commentedon Nov 15, 2012
On Thu, Nov 15, 2012 at 7:03 PM, RandolfCarter [email protected]:
(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.
MTGap commentedon Nov 15, 2012
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.
Wikinaut commentedon Nov 16, 2012
@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
RandolfCarter commentedon Nov 16, 2012
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:
jancborchardt commentedon Nov 16, 2012
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.
jancborchardt commentedon Dec 4, 2012
This was fixed by @butonic in #380. Wohoo!
srednax commentedon Jan 22, 2013
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 ;)
RandolfCarter commentedon Jan 22, 2013
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 ;)