Summary
Snipe-IT contains an authorization flaw where an authenticated user with only the users.edit permission can escalate their own privileges to admin via the user update API.
By abusing insufficient permission checks on the /api/v1/users/{id} PATCH endpoint, a non-admin user can modify their permission set and gain full administrative capabilities.
Affected context
This vulnerability occurs in Snipe-IT deployments where:
- Role and permission management is handled via the REST API
- Users with limited roles are granted the ability to edit user records (
users.edit) - The backend controller for
/api/v1/users/{id}trusts client-supplied permission arrays, stripping only thesuperuserkey while allowing other permission flags (includingadmin) to be set
The issue is exposed when user accounts are managed programmatically or via clients that call the API directly, not just through the web UI.
Exploit preconditions
- Attack surface: Authenticated Snipe-IT REST API (
/api/v1/users/{id}) for user management - Required access: A valid account with
users.editcapability or equivalent permission to update user records via PATCH - Trigger point: Sending a crafted PATCH request that includes
permissions[admin]=1(and potentially other permission keys) for the attacker's own user ID - Why exploitation is possible: The authorization logic only strips the
superuserkey from the permission payload and does not enforce server-side checks to prevent non-admin users from assigning themselvesadminor additional permissions
Why this happens
The underlying issue is a broken access control pattern where authorization decisions are made too coarsely and rely on client-controlled data.
Specifically, the API endpoint responsible for updating user records accepts a permissions array from the client and only removes the superuser entry before saving the remainder.
This maps to CWE-863: Incorrect Authorization, because the system fails to ensure that only appropriately privileged actors can assign or modify high-privilege roles like admin.
It is also related to CWE-281: Improper Preservation of Permissions, as the design does not safeguard the integrity of permission assignments when updates are processed.
Instead of deriving effective roles solely from trusted server-side logic, the API trusts the user's submitted permission flags, allowing privilege escalation via crafted requests.
Potential impact
- A regular user can escalate their account to an admin role
- Attackers may gain full control over Snipe-IT configuration, assets, and license data
- Unauthorized creation, modification, or deletion of users, assets, and audit records
- Potential exposure or tampering of sensitive inventory and license information managed in Snipe-IT
- Indirect impact on connected systems through misconfigured assets or altered integrations
General mitigation guidance
Risk reduction centers on enforcing strict, server-side authorization for role and permission changes and minimizing trust in client-supplied permission structures.
Common defensive patterns include:
- Defining a clear separation between "edit user details" and "manage roles/permissions," with the latter restricted to highly privileged roles only
- Enforcing server-side checks that prevent any user from assigning roles or permissions that exceed their own effective privilege level
- Treating permissions and roles as server-managed attributes, ignoring or strictly validating any client-supplied permission arrays
- Implementing whitelists of editable fields per role or per endpoint, and rejecting updates to fields outside that whitelist
- Applying least-privilege principles when assigning management capabilities such as
users.edit, ensuring they are only granted where strictly necessary
These patterns help ensure that even if users can edit certain account details, they cannot independently elevate their privileges.
How teams detect issues like this
Detection typically focuses on identifying both insecure patterns in code and anomalous permission changes in runtime logs:
- Static analysis and code review:
- Flag endpoints that accept and persist permission or role data directly from client input
- Look for controllers that modify authorization-related fields without explicit, role-based guard checks
- Review any logic that filters or strips specific permission flags while leaving others unchecked
- Policy and configuration checks:
- Enforce secure coding guidelines that prohibit trusting client-supplied role or permission arrays
- Implement mandatory reviews for API endpoints that change user roles, groups, or permission sets
- Operational monitoring:
- Log all changes to user roles and permissions, including who made the change and from where
- Set alerts for unusual patterns, such as non-admin users gaining admin privileges or multiple rapid permission changes for a single account
- Automated tooling:
- Use application security testing tools (DAST/IAST) configured to probe for privilege escalation by modifying permission-related parameters
- Integrate automated checks into CI/CD pipelines to detect regressions in access control logic

