Skip to content

fix(e2ee): omit users from encrypted subfolder metadata - #18052

Open
xO-ox-ai wants to merge 1 commit into
nextcloud:masterfrom
xO-ox-ai:fix/e2ee-omit-subfolder-users
Open

xO-ox-ai wants to merge 1 commit into
nextcloud:masterfrom
xO-ox-ai:fix/e2ee-omit-subfolder-users

Conversation

@xO-ox-ai

Copy link
Copy Markdown

Writing metadata for an encrypted subfolder currently sets encryptedUsers to an empty list. Gson serializes that as "users": [], although the E2EE RFC requires subfolders to omit users and inherit the topmost metadata key. The web client can misclassify these directories as roots and fail the parent listing with Current user has no access to this folder.

Set the subfolder's encrypted users to null so the existing Gson configuration omits the field. Root recipients and encrypted metadata keys remain present. Existing metadata is deserialized without normalizing the signed representation, so both omitted users and an existing empty array can still be verified.

The separate web compatibility fix for metadata already stored on servers is nextcloud/end_to_end_encryption#2312.

Validation: the new regression fails against the unmodified upstream source and all three tests pass after the fix. The tests cover inheriting the root key and omitting users for subfolders, retaining root recipients, and preserving the serialized representation of existing metadata. spotlessKotlinCheck, Detekt, and lintGplayDebug pass. The Gradle SpotBugs launcher could not start its Java process on Windows; direct SpotBugs analysis of EncryptionUtilsV2 and its nested classes completed with no missing classes or analysis errors, and found no new report identities compared with the unmodified upstream bytecode (15 existing reports on each side).

AI assistance: Codex (GPT-6) assisted with diagnosis, implementation, and testing. The contributor explicitly authorized submitting this pull request.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant