Skip to content

[Bug]: Prevent self-deletion of admin users in UserController#1086

Merged
kingjia90 merged 3 commits into2.3from
prevent-selfdelete
Jan 28, 2026
Merged

[Bug]: Prevent self-deletion of admin users in UserController#1086
kingjia90 merged 3 commits into2.3from
prevent-selfdelete

Conversation

@kingjia90
Copy link
Contributor

@kingjia90 kingjia90 commented Jan 28, 2026

Added a guard clause to prevent self-deletion of admin users.
Only relevant if the request was sent directly to the API, not through the UI (it's disabled in there)

Not a strict security issue, just a design/logic flaw
Resolves https://github.com/pimcore/pimcore/security/advisories/GHSA-x4vx-7h2p-c6f7

Added a guard clause to prevent self-deletion of admin users.
@kingjia90 kingjia90 added this to the 2.3.1 milestone Jan 28, 2026
@kingjia90 kingjia90 self-assigned this Jan 28, 2026
Copilot AI review requested due to automatic review settings January 28, 2026 11:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens the admin user deletion endpoint by preventing administrators from deleting their own accounts when calling the API directly, aligning backend behavior with the frontend.

Changes:

  • Added a self-deletion guard to UserController::deleteAction() alongside existing admin/folder deletion checks.
  • Updated inline comments to document the new guard behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 28, 2026 12:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud
Copy link

@kingjia90 kingjia90 merged commit ba67d35 into 2.3 Jan 28, 2026
12 checks passed
@kingjia90 kingjia90 deleted the prevent-selfdelete branch January 28, 2026 12:17
@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants