fix: use the right user id when changing the email#41539
Conversation
|
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. |
DeepDiver1975
left a comment
There was a problem hiding this comment.
unit testable? Thank you
Previously, the test only used one user, so it was difficult to verify that the mail was changed for the user2 instead of user1
c594d46 to
5e57b95
Compare
Code ReviewOverviewThis PR fixes a bug in Source Fix
- $this->setEmailAddress($userId, $mailAddress);
+ $this->setEmailAddress($id, $mailAddress);Correct and minimal. The fix is exactly right — Test ChangesImprovements:
Concerns:
Process
Summary
The core fix is sound. I'd suggest:
|
* fix: use the right user id when changing the email * test: adjust unit test to ensure the mail is set for the user2 Previously, the test only used one user, so it was difficult to verify that the mail was changed for the user2 instead of user1 * docs: add changelog entry for PR #41539 * fix: include test to ensure the mail of the caller isn't changed --------- Co-authored-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> (cherry picked from commit 3ff2884) Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
* fix(security): OC10-75 - restrict AppConfigController read methods to full admins only (#41550) * fix(security): restrict AppConfigController read methods to full admins only OC10-75: Subadmins could read all oc_appconfig values including SMTP passwords and LDAP credentials via getApps/getKeys/getValue endpoints. Remove @NoAdminRequired so AdminMiddleware enforces full-admin-only access, consistent with the write methods. CVSS: 7.7 Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> * fix: replace OC.AppConfig.getValue in users.js with server-rendered checkbox state The umgmt_set_password value is already rendered server-side into #CheckBoxPasswordOnUserCreate's checked attribute. Remove the redundant AJAX call which would now return 403 for Subadmins after the security fix. Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> * chore: add changelog entry for OC10-75 (#41550) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> --------- Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(comments): prevent IDOR in WebDAV comments API (#41558) * test(comments): stub objectType/objectId in EntityCollection happy-path tests Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> * test(comments): add failing IDOR regression tests for EntityCollection Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> * fix(comments): prevent IDOR in WebDAV comments API by checking comment ownership An authenticated user could PROPFIND/DELETE/PROPPATCH any comment by supplying an arbitrary comment_id paired with any file_id they own. EntityCollection::getChild() and childExists() now verify that the fetched comment's objectType and objectId match the collection's own entity type and file ID before returning or confirming the node. Fixes OC10-53 Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> * docs: add changelog entry for OC10-53 IDOR fix in WebDAV comments API Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> --------- Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(security): update phpseclib/phpseclib to 3.0.52 for CVE-2026-40194 CVE-2026-40194: timing attack in SSH binary packet processing fixed in 3.0.51. Also picks up 3.0.52 correctness fixes (ASN.1 hardening, OpenSSL 3.2+ RSA compat). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> * fix(security): update symfony/routing to 5.4.52 for CVE-2026-45065 CVE-2026-45065: UrlGenerator regex alternation anchoring bypass allowing off-site URL injection via route requirement validation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> * fix: check for the identifier alias for the storage backend (#41538) * fix: check for the identifier alias for the storage backend * test: add unit tests to local external storage * chore: add changelog entry * fix: move backend checks to a different place * fix: adjust unit tests * fix: visibility for local storage for the admin based on flag Without the visibility, the admin won't be able to create local storages, and the previously created local mounts will be hidden and inaccessible * fix: review comments * fix: remove user mounting check in controller and rely on validation * fix: adjust code based on reviews (cherry picked from commit 5c7dfc0) Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> * fix: use the right user id when changing the email (#41539) * fix: use the right user id when changing the email * test: adjust unit test to ensure the mail is set for the user2 Previously, the test only used one user, so it was difficult to verify that the mail was changed for the user2 instead of user1 * docs: add changelog entry for PR #41539 * fix: include test to ensure the mail of the caller isn't changed --------- Co-authored-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> (cherry picked from commit 3ff2884) Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> * chore: add changelog for 10.16.3 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> * ci: fix lint pipeline and sync with master * chore: set version properly and generate changelog Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> --------- Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Juan Pablo Villafañez <jpvillafanez@izertis.com>
Description
Change the email of the right user. Note that the code path isn't reachable from the web UI.
Note that there are checks some lines above for the existence of the user, so if we reach this particular line we know that there is an existing user with that id, no need to check it again.
Related Issue
Motivation and Context
How Has This Been Tested?
Manually tested using curl. It now changes the target user's email instead of the admin's (requester) email.
Screenshots (if appropriate):
Types of changes
Checklist: