Summary
NocoBase plugin-ai has an authorization bypass that can let authenticated users access AI employees that have not been assigned to them. Depending on the available tools and permissions, a user may be able to run those employees or read their prompts and tool configuration.
Affected context
The issue is described in NocoBase plugin-ai versions 2.1.0 through 2.2.41, in the getAccessibleAIEmployee() authorization check. It becomes relevant when an authenticated user can supply a username that overrides the role-derived access filter. The dispatch-sub-agent-task and get-ai-employee tools are identified as paths for invoking or inspecting unassigned AI employees.
Exploit preconditions
- Attack surface: AI employee access and task-dispatch functionality in the plugin
- Required access: An authenticated account able to invoke the relevant tools
- Trigger point: A request to access or dispatch a task to an AI employee, with a supplied username
- Why exploitation is possible: The supplied username can override the role-derived filter instead of being constrained by the user's authorized assignments
Why this happens
The authorization check derives an access filter from the user's role but allows user-supplied identity data to override that filter. This is an authorization enforcement failure: access is not reliably constrained to the resources assigned to the authenticated user. It maps to CWE-863: Incorrect Authorization.
Potential impact
- Authenticated users may access AI employees they are not assigned to.
- Users may be able to invoke ungranted AI employees and their available tools.
- Prompts and tool configuration may be exposed.
- Actions performed through an AI employee's tools may exceed the user's intended privileges.
General mitigation guidance
Defensive patterns include enforcing authorization server-side using the authenticated user's trusted identity and role, and ensuring caller-supplied usernames cannot broaden access. Apply deny-by-default checks to each employee and tool operation, validate access before dispatch or disclosure, and grant AI employees and their tools only the minimum necessary permissions. Treat request parameters as untrusted and keep identity and authorization decisions separate from user-controlled data.
How teams detect issues like this
Review access-control code for cases where request parameters replace or weaken role-derived filters. Use static analysis and code review to trace authorization checks from the authenticated identity through employee lookup, task dispatch, and configuration reads. Test that users cannot access unassigned employees by changing identity-related inputs, and enforce policies requiring server-side authorization checks on every sensitive operation. Monitor for denied or unusual employee-access and task-dispatch patterns.

