Skip to content

fix(share): check the share password hash for authenticated public shares - #9634

Open
juliusknorr wants to merge 1 commit into
mainfrom
fix/public-share-session-hash
Open

juliusknorr wants to merge 1 commit into
mainfrom
fix/public-share-session-hash

Conversation

@juliusknorr

@juliusknorr juliusknorr commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

📝 Summary

Use the server's PublicAuth::isShareInSession() to check public share sessions, so access follows the current share password.

  • One helper FileService::isShareAuthenticated(), used by FileService, WorkspaceController and AttachmentController::getAuth()
  • Attachment endpoints check it in getAuth(), so the duplicate check in AttachmentService is gone

🏁 Checklist

  • Code is properly formatted (composer run cs:check)
  • Sign-off message is added to all commits
  • Tests: unit tests for FileService, WorkspaceController and AttachmentController
  • Documentation is not required

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI tools
  • The AI-generated content was reviewed, comprehended and tested by a human

@nextcloud-command nextcloud-command added the AI assisted This PR contains AI-assisted commits label Nov 18, 2026
@juliusknorr
juliusknorr marked this pull request as ready for review November 18, 2026 21:41
@juliusknorr
juliusknorr force-pushed the fix/public-share-session-hash branch from 1d22b63 to 6003dad Compare November 18, 2026 21:44
@juliusknorr

Copy link
Copy Markdown
Member Author

/backport to stable35

@juliusknorr

Copy link
Copy Markdown
Member Author

/backport to stable34

@juliusknorr

Copy link
Copy Markdown
Member Author

/backport to stable33

@blizzz

blizzz commented Nov 19, 2026

Copy link
Copy Markdown
Member

Guarded with is_callable, so servers without the public static helper fall back without errors

Not necessary as we bundle text and don't ship it any other way?

@blizzz blizzz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment

…ares

Use PublicAuth::isShareInSession() from the server, so access follows the current share password.

Signed-off-by: Julius Knorr <jus@bitgrid.net>
Assisted-by: ClaudeCode:claude-opus-5-5
@juliusknorr
juliusknorr force-pushed the fix/public-share-session-hash branch from 6003dad to e6216f4 Compare November 20, 2026 10:57
@juliusknorr

Copy link
Copy Markdown
Member Author

Right, dropped the guard and the fallback tests. All supported server branches (stable33+) have the public static helper.

@juliusknorr
juliusknorr requested a review from blizzz November 20, 2026 11:10

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

3. to review AI assisted This PR contains AI-assisted commits backport-request bug Something isn't working feature: sharing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants