Summary
XueZhiSi Open Source Exam System contains an authorization flaw in the teacher-endpoint used to delete users. An authenticated teacher may be able to delete an administrator account by supplying its user ID because the endpoint does not verify whether the requester is authorized to perform that action.
Affected context
The issue occurs in deployments of XueZhiSi Open Source Exam System where the teacher-facing delete-user endpoint is accessible to authenticated teacher accounts. The risk is present when the endpoint accepts a target user ID, retrieves that account, marks it deleted, and updates it without enforcing role-based authorization for the requested operation.
Exploit preconditions
- Attack surface: Authenticated teacher-end interface and its user-deletion API
- Required access: A valid account with teacher-level privileges
- Trigger point: A request to the user deletion endpoint containing a target account identifier
- Why exploitation is possible: The endpoint performs the deletion workflow without checking whether the requesting teacher is authorized to delete the selected user, including an administrator account
Why this happens
The underlying bug is a missing server-side authorization check for a sensitive object-level operation. The endpoint trusts the submitted user identifier and proceeds through retrieval, deletion marking, and persistence without comparing the requester's role or permissions with the target account and requested action. This maps to CWE-639: Authorization Bypass Through User-Controlled Key, because a user-controlled identifier can be used to access or modify a protected object without adequate authorization enforcement.
Potential impact
- A teacher account may delete an administrator account
- Administrative access may be disrupted
- The application could become unavailable to authorized administrators
- Account-management integrity may be compromised
- Repeated abuse could cause broader denial-of-service effects
General mitigation guidance
Mitigation generally focuses on enforcing authorization at the server-side operation boundary rather than relying on the caller's interface or supplied identifier.
Common defensive patterns include:
- Apply explicit role- and permission-based checks before any user deletion is performed
- Deny lower-privileged users from deleting administrator or peer accounts unless a narrowly defined policy permits it
- Treat target identifiers as untrusted input and verify access to the referenced object
- Centralize authorization logic so all user-management paths apply consistent rules
- Use least-privilege roles and separate administrative account-management capabilities
- Prefer soft-delete workflows with recovery and audit controls for sensitive accounts
- Record and monitor authorization failures and high-impact account changes
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis and code review checks for update or delete operations that lack nearby authorization enforcement
- Review of endpoints that accept object IDs from lower-privileged users
- Tests that attempt cross-role access, including teacher-to-administrator account actions
- Policy checks requiring centralized permission checks before destructive operations
- Monitoring for account deletions initiated by roles that normally should not manage administrators
Automated application-security testing and code-review tools may help identify missing object-level authorization, but results should be validated against the intended role model.

