Write-scoped service tokens could mutate administrator accounts
Description
Nginx UI service tokens with api:write scope were allowed through the secure-session middleware for API automation. The user-management mutation routes relied on that middleware but did not additionally require an interactive administrator. A holder of a write-scoped service token could therefore create, modify, delete, or recover users and obtain persistent administrator access.
Read-only access to the user list remains available to api:read service tokens as an intentional API capability. Only user mutations now require an authenticated interactive administrator and the existing secure-session check.
Impact
An attacker who obtained a valid api:write service token could create or alter an enabled administrator account, converting an automation credential into persistent interactive access. The issue is not reachable with an api:read token or without authentication.
Remediation and compatibility
User-management create, modify, delete, and recover operations now require RequireInteractiveUser() in addition to RequireSecureSession(). This intentionally removes user-administration support from service-token clients. CLI or automation workflows that previously managed users with a service token must use an interactive administrator session instead. Read-only user listing remains compatible with api:read tokens.
Fixed by cb27607c77e4bcca586181038d7a33281710e5d2.