fix(settings): pass target user ID to sendEmail in setMailAddress subadmin path#41574
fix(settings): pass target user ID to sendEmail in setMailAddress subadmin path#41574DeepDiver1975 wants to merge 3 commits into
Conversation
…admin path In setMailAddress, the subadmin/non-admin code path was calling sendEmail($userId, ...) where $userId is the session caller's UID instead of $id (the target user's UID). This caused the verification token and confirmation link to be associated with the caller rather than the target, so clicking the link changed the caller's email instead of the target's. The admin path was already corrected in commit 3ff2884; this fixes the remaining subadmin path (GHSA-5945-5fp8-4283). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Code ReviewSecurity fix for GHSA-5945-5fp8-4283 (subadmin path). +84/−1, 3 files. Overview
The non-admin verification branch was calling Correctness — fix is right ✅Traced the full chain (
In the buggy subadmin path the token + link were stored under the subadmin, so the confirmation email went to the new address but the link carried Sanity checks that confirm it's safe and complete:
Test quality — catches the regression ✅The test fails pre-fix, not just passes post-fix: Suggestions (optional, non-blocking)
RiskLow. One-character logic change on a narrow branch, covered by a targeted regression test, with self-service and admin paths provably unaffected. VerdictCorrect, minimal, well-tested security fix. Ready to merge — suggestions above are optional hardening. 🤖 Generated with Claude Code |
Summary
UsersController::setMailAddresswhich was passing$userId(the caller's session UID) tosendEmail()instead of$id(the target user's UID)testSetMailAddressSubadminSendsEmailToTargetNotCallerthat asserts the token is stored and the confirmation link is generated with the target user's IDFixes GHSA-5945-5fp8-4283 (subadmin path).
Test plan
tests/Settings/Controller/UsersControllerTest.php::testSetMailAddressSubadminSendsEmailToTargetNotCaller— verifiessetUserValueandlinkToRouteAbsoluteare called with the target user's ID, not the caller'stestSetEmailAddresssuite to confirm no regression in admin path🤖 Generated with Claude Code