fix(files): Prevent corruption of files when moving from encrypted to unencrypted folders within the same object storage - #62364
Open
DerDreschner wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
/backport to stable34 |
Contributor
Author
|
/backport to stable33 |
Contributor
Author
|
/backport to stable32 |
miaulalala
approved these changes
Jul 22, 2026
… unencrypted folders within the same object storage Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: David Dreschner <david.dreschner@nextcloud.com>
DerDreschner
force-pushed
the
fix/prevent-s3-corruption
branch
from
July 24, 2026 10:44
54078e2 to
672542f
Compare
Contributor
Author
|
/backport! to stable32 |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When using server-side encryption (SSE), not all folders are encrypted by default. For example, when using
groupfolders, the encryption must be enabled separately. This is described in the admin manual, but might not always being recognized by the administrators. This can then lead to situations where the personal folders are encrypted, but group folders might not.This will lead to a bug when both folders are inside the same object storage (since #47986). In this case, the current code will try to speed up things by only copying the metadata in the filecache. This breaks the encryption, as the encryption key depends on the path of the file and isn't being moved in this case, nor any re-encryption happens for the new path. Before #62255, the user might be even served the raw file with the ciphertext in some cases.
To fix the issue, I'll let the global functions handle those cases rather then try to duplicate any logic into the object storage overwrite.
Checklist
3. to review, feature component)stable32)AI (if applicable)