glpi-project / glpi

GLPI is a Free Asset and IT Management Software package, Data center management, ITIL Service Desk, licenses tracking and software auditing.
https://glpi-project.org
GNU General Public License v3.0
4.34k stars 1.3k forks source link

Fix(LockedField): prevent purge of lockedField without authorization on the linked object entity #18353

Open stonebuzz opened 5 days ago

stonebuzz commented 5 days ago

Checklist before requesting a review

Please delete options that are not relevant.

Description

GLPI does not respect the current user's permissions when deleting (purging) a LockedField.

This allows a LockedField linked to an object from another entity to be deleted.

I am also questioning the handling of global LockedFields. Currently, anyone with the UPDATE permission can delete a global lock (with or without this PR), regardless of the entity, as the LockedField object does not include an entities_id.

Screenshots (if appropriate):

trasher commented 5 days ago

Seems correct, could you add a test please?