Summary
n8n contains an authorization bypass in the custom project-role deletion and reassignment workflow. A user with only the narrow role:manageProject global scope could affect custom roles in projects they were not authorized to manage, potentially causing users to receive the built-in project:admin role and gaining administrative control over those projects.
Affected context
The vulnerability occurs in n8n deployments that support custom project roles and allow a role-management operation to reassign role holders during deletion. The affected authorization path verifies that the reassignment target exists and is project-scoped, but may not verify that the acting user is authorized for the specific project associated with the custom role. Risk depends on the availability of the role-management permission and the presence of affected custom roles.
Exploit preconditions
- Attack surface: n8n project role management functionality
- Required access: An authenticated user holding the narrow
role:manageProjectglobal scope - Trigger point: Deletion of a custom project role with a reassignment target
- Authorization gap: The workflow checks target-role existence and scope but does not adequately enforce authorization for the affected project
- Resulting condition: Role holders may be reassigned to the built-in
project:adminrole, including the initiating user
Why this happens
The underlying bug is an authorization decision based on incomplete object-level validation. The deletion and reassignment path validates properties of the selected role but fails to bind the operation to the project on which the requester is authorized to act. This maps to CWE-639: Authorization Bypass Through User-Controlled Key, because an insufficiently authorized user can influence the identifier or object relationship used in an access-control decision.
Potential impact
- An attacker may delete custom project roles outside their authorized scope.
- Existing role holders could be reassigned to a more privileged built-in role.
- The attacker could gain administrative control over otherwise inaccessible projects.
- Unauthorized users could modify project permissions and access sensitive project data.
- Project ownership, workflows, credentials, or operational settings could be altered.
General mitigation guidance
Mitigation generally focuses on enforcing object-level authorization at every stage of role deletion and reassignment.
Common defensive patterns include:
- Verify that the requester is authorized for the specific project associated with the custom role.
- Re-check authorization for both the role being deleted and the reassignment target.
- Avoid treating global role-management scopes as implicit access to every project.
- Apply least privilege to role-management capabilities and separate administrative duties where practical.
- Use secure-by-default reassignment behavior that does not grant broader privileges than the deleted role.
- Make authorization checks server-side, centralized, and independent of client-supplied identifiers.
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis and code review rules requiring project-scope checks before role mutations.
- Review of endpoints that accept project, role, or reassignment identifiers from callers.
- Tests that attempt cross-project role deletion and reassignment with narrowly scoped accounts.
- Audit-log analysis for role deletions followed by unexpected assignment to built-in administrative roles.
- Policy enforcement requiring authorization decisions to be based on server-resolved resource ownership and scope.
Automated application-security review tools may help identify missing object-level authorization checks, but authorization behavior should also be verified with focused integration tests.

