Skip to content

Business Logic Flaw: Role Deletion Without User Assignment Cleanup

Low
unocelli published GHSA-cqww-jqx5-p32v Jul 22, 2026

Package

No package listed

Affected versions

< 1.3.3

Patched versions

>= 1.3.3

Description

Summary

The DELETE /api/roles endpoint removes role definitions from the database but does not clean up user assignments that reference the deleted role. This leaves orphaned role IDs in users' info.roles arrays. If permission configurations still reference those role IDs, affected users may retain authorization rights that should have been revoked, leading to inconsistent permission states. The vulnerability has a CVSS score of 2.3 (Low). The provided PoC did not execute successfully due to missing runtime arguments, but the code logic clearly demonstrates the flaw.

Details

Affected Endpoint

  • Route: DELETE /api/roles
  • Key files involved:
    • Route handler: server/api/users/index.js (from line 166)
    • Business logic: server/runtime/users/index.js, line 143
    • Database operations: server/runtime/users/usrstorage.js, lines 236–237
    • Permission checks: server/runtime/index.js, line 669

Root Cause
When an administrator deletes a role via DELETE /api/roles, the system only executes DELETE FROM roles WHERE name = ? to remove the role definition. It does not iterate through the user table to remove the corresponding role ID from each user's info.roles array. Subsequent permission checks (e.g., userPermission.info.roles.some()) verify whether a user's role array contains any of the allowed role IDs. If a deleted role ID remains present in the user's assignment and the permission policy has not been updated, the user may continue to possess the original role's privileges.

Suggested Fix
When a role is deleted, the system should also update all users to remove the deleted role ID from their info.roles arrays. Alternatively, foreign key constraints with cascading actions could enforce data consistency.

Impact

The business logic flaw can lead to the following security issues:

  • Residual Privilege and Unauthorized Access: If a deleted role is still referenced in permission configurations, users holding that role ID may continue to access restricted resources or functions, resulting in unauthorized actions.
  • Management Confusion and Audit Failure: Administrators may believe that a role and its associated rights have been completely removed, while in reality some users still retain those rights. This undermines access control management and complicates security audits.
  • Compliance Risks: In environments requiring strict access control and periodic reviews, such inconsistent permission states may violate the principle of least privilege and relevant audit requirements.

Although the CVSS score is low, for systems that depend on precise role-based access control, this issue could be exploited to maintain unauthorized access over time. Remediation is recommended to ensure role deletion fully revokes all related permissions.

Severity

Low

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
High
User interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:N/A:N

CVE ID

CVE-2026-67442

Weaknesses

Improper Access Control

The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. Learn more on MITRE.

Incomplete Cleanup

The product does not properly clean up and remove temporary or supporting resources after they have been used. Learn more on MITRE.

Credits