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
Encryption key names conflicts in very specific cases with user name inside file name #11297
Create three users: "user1" and "test.user1" and "user2"
As "user2" create or upload a non-empty file called "file.test" (without extension)
As "user2" create or upload a non-empty file called "file" (without extension)
Share "file.test" with "user1"
Share "file" with "test.user1".
Login as "user1" and try to download the file
Login as "test.user1" and try to download the file
Expected result
Both users can read the file
Actual result
One of the user has broken files
Versions
ownCloud 7 git master f46e495
Likely to happen on OC 6.0.5 and OC 7.0.2 as well due to similar logic.
More information
This is due to the fact that the encryption key is called file.test.user1.shareKey for both files.
One is concatening "file.test" with "user1" and the other one is concatening "file" with "test.user1" resulting in the same key file name.
Note: even though this can lead to data loss it is very unlikely to happen in a production environment, especially noting that the file have no extensions. Setting severity to medium.
@schiesbn and I did not find any short term solution for this as all solution involve changing the format of the key name. Any format change will require migration steps.
One idea would be to store the share keys in a folder that has the name of the file in question.
In this example above there would be two folders:
share-keys/file/
share-keys/file/test.user1.shareKey
share-keys/file/user2.shareKey (the owner)
share-keys/file.test/
share-keys/file.test/user1.shareKey
share-keys/file.test/user2.shareKey (the owner)
Also please note that this case was inferred by reading the code and trying to find ways to break it.
Activity