Summary
JeecgBoot versions up to 3.9.1 contain an improper access control flaw in the LoginController.selectDepart endpoint, exposed at /sys/selectDepart.
Under certain conditions, remote users may be able to access or manipulate department-related login context without adequate authorization checks, potentially leading to unauthorized access to organizational resources.
Affected context
The vulnerability occurs in JeecgBoot deployments that expose the /sys/selectDepart endpoint as part of the login or post-login flow.
It primarily affects multi-department or multi-tenant setups where users can switch or select departments, and where the department selection logic influences permissions, data visibility, or session context.
The issue is present when authorization checks around department selection are incomplete, missing, or rely solely on client-supplied identifiers without robust server-side validation.
Exploit preconditions
- Attack surface: Remote HTTP access to the JeecgBoot application, specifically the /sys/selectDepart route.
- Required access: Ability to reach the login or department selection functions; in many cases, this may be available to unauthenticated or minimally authenticated users depending on configuration.
- Trigger point: Sending crafted requests to LoginController.selectDepart to influence which department or context is bound to a user session.
- Why exploitation is possible: The controller does not consistently enforce fine-grained access checks for the department being selected, allowing a user to bind or reference departments beyond their authorized scope.
Why this happens
The root cause aligns with CWE-284: Improper Access Control and CWE-266: Incorrect Privilege Assignment.
The LoginController.selectDepart function appears to trust user-supplied department identifiers or context without fully enforcing server-side authorization that ensures the caller is entitled to access the requested department.
This pattern results from missing or incomplete checks on who can select which department, and how that selection translates into privileges, leading to scenarios where user sessions may inherit access to resources they should not control.
Potential impact
- Unauthorized viewing of data associated with other departments or tenants.
- Escalation of privileges by switching into a department with broader permissions.
- Bypassing intended segregation of duties or tenant isolation boundaries.
- Indirect compromise of sensitive business workflows that rely on department scoping for access control.
General mitigation guidance
Mitigation typically focuses on ensuring that department or context selection is always subject to strict server-side authorization.
Common defensive patterns include:
- Binding department selection strictly to the authenticated user's allowed department list, resolved on the server side rather than from client input.
- Implementing centralized access control checks that evaluate whether a user is permitted to enter or operate within a given department context.
- Treating all context-switching endpoints (such as tenant or department selectors) as privileged operations requiring explicit authorization and auditing.
- Applying the principle of least privilege so that selecting or switching departments never results in broader permissions than necessary.
How teams detect issues like this
Organizations can detect similar access control weaknesses via:
- Static analysis rules that flag controller methods which change security context (e.g., department, tenant, role) without explicit authorization checks.
- Code reviews focusing on login and context-switch logic, verifying that every transition in department or tenant state passes through centralized access control enforcement.
- Runtime logging and monitoring of department selection events, looking for anomalous patterns such as frequent cross-department switches by the same user.
- Automated security testing (e.g., authorization testing tools) that attempt to select departments outside the user's normal scope and flag positive responses.

