Summary
Mailu contains a missing authorization check in its admin REST API, allowing an unauthenticated attacker to alter properties of existing user tokens. When the REST API is enabled, an attacker may remove IP restrictions or change token comments without proving ownership of the affected token.
Affected context
The vulnerability occurs in Mailu deployments that expose or enable the admin REST API and use user tokens with IP restrictions or comment metadata. The affected operations may accept a token identifier or related token information without adequately verifying that the requester is authorized to manage it.
Exploit preconditions
- Attack surface: Mailu admin REST API
- Required access: No authenticated account is required when the API is enabled
- Trigger point: An API operation that modifies an existing user token
- Why exploitation is possible: The endpoint does not consistently enforce authorization before allowing IP restrictions or comments to be changed
Why this happens
The underlying defect is an authorization enforcement failure. A REST endpoint performs a state-changing operation on an existing user token without verifying that the requester has permission to administer that token. This behavior maps to CWE-306, which covers missing authentication for critical functions; in this case, the missing access-control check allows unauthenticated requests to reach administrative functionality.
Potential impact
- An attacker could remove IP-based restrictions from user tokens
- An attacker could weaken controls that limit token use to trusted networks
- Token metadata could be altered, reducing administrative visibility
- Mail administration workflows could be disrupted or manipulated
- The change could support follow-on unauthorized access if other token protections are bypassed
General mitigation guidance
Mitigation generally focuses on ensuring that every state-changing administrative
endpoint applies authentication and object-level authorization before processing
a request.
Common defensive patterns include:
- Requiring authenticated administrative sessions or equivalent strong credentials
- Verifying that the requester is authorized to modify the specific token
- Denying administrative API access by default when it is not required
- Applying network controls that limit the API to trusted management sources
- Preserving restrictive token settings unless an authorized change is explicitly confirmed
- Recording and reviewing token-property changes through centralized audit logging
How teams detect issues like this
Organizations can identify similar issues through:
- Static analysis and API security rules for unauthenticated state-changing routes
- Code review checks that trace authentication and object-level authorization to each handler
- Integration tests that submit token-management requests without credentials
- Policy enforcement requiring authentication and authorization middleware on administrative APIs
- Monitoring for unexpected removal of IP restrictions or changes to token metadata
Automated application security testing can help validate that unauthorized requests are rejected consistently.

