镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

fix(share): trim pasted public-share passwords before auth - #65241

Open
whoalin1 wants to merge 2 commits into
nextcloud:masterfrom
whoalin1:fix/public-share-trim-pasted-password
Open

whoalin1 wants to merge 2 commits into
nextcloud:masterfrom
whoalin1:fix/public-share-trim-pasted-password

Conversation

@whoalin1

@whoalin1 whoalin1 commented Oct 7, 2026

Copy link
Copy Markdown

Summary

Closes #24141

Recipients paste share passwords from mail and often include leading/trailing spaces or newlines, so auth fails even with the correct secret.

  • Trim the password in AuthPublicShareController::authenticate before verifyPassword (covers all interactive public-share auth).
  • Also trim on submit in PublicShareAuth.vue so the POSTed field is clean.

Test plan

  • Open a password-protected public share
  • Paste the password with a leading/trailing space or newline → auth succeeds
  • Wrong password still fails
  • PHPUnit / existing AuthPublicShareController tests still pass

Signed-off-by: whoalin1 <whoalin414@gmail.com>
Signed-off-by: whoalin1 <whoalin414@gmail.com>
@whoalin1
whoalin1 requested review from a team as code owners October 7, 2026 01:56
@whoalin1
whoalin1 requested review from Altahrim, kristian-zendato, leftybournes, provokateurin, skjnldsv and sorbaugh and removed request for a team October 7, 2026 01:56
@skjnldsv
skjnldsv requested review from susnux and removed request for sorbaugh October 7, 2026 03:40

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.

[sharebymail] Before password validation, clean pasted password with whitespace before/after and \

1 participant