Summary
Lemur contains an authorization bypass in permission checks protecting certificate, authority, notification, and domain management actions. When the relevant strict-enforcement settings are not enabled, authenticated read-only users may pass authorization gates and perform administrative operations.
Affected context
The issue occurs in Lemur deployments where ADMIN_ONLY_AUTHORITY_CREATION and LEMUR_STRICT_ROLE_ENFORCEMENT are unset or configured as false. In that state, permission objects may contain no required Need objects, causing Flask-Principal authorization checks to allow any authenticated identity, including users assigned a read-only role.
Exploit preconditions
- Attack surface: Authenticated Lemur API endpoints for authorities, certificates, notifications, and domains
- Required access: A valid authenticated account, including an account with read-only privileges
- Trigger point: A protected API request evaluated through the affected permission classes
- Why exploitation is possible: Empty permission requirements are treated as automatically satisfied, so the authorization gate does not enforce the intended role or administrative privilege
Why this happens
The underlying bug is an authorization configuration and implementation failure. StrictRolePermission and AuthorityCreatorPermission can initialize Flask-Principal permission objects without any Need objects when their controlling feature flags are false or unset. Because Permission.allows() treats an empty set of requirements as allowed, the application confuses the absence of authorization requirements with a valid authorization decision. This maps to CWE-863: Incorrect Authorization, because access-control checks fail to restrict sensitive operations to appropriately privileged users.
Potential impact
- Unauthorized users could create root Certificate Authorities
- Attackers may upload arbitrary certificates
- Attackers could create or modify notifications that reach an SSRF-capable sink
- Unauthorized domain entries could be created
- Certificate-management workflows and trust relationships could be manipulated
- The application could experience data integrity, confidentiality, or availability impacts
General mitigation guidance
Mitigation generally focuses on making authorization requirements explicit and fail closed.
Common defensive patterns include:
- Define non-empty permission requirements for every administrative operation
- Treat unset, disabled, or malformed authorization settings as secure denial rather than unrestricted access
- Separate read-only and administrative capabilities through explicit role and privilege checks
- Apply centralized authorization policies consistently across all certificate, authority, notification, and domain endpoints
- Minimize service-account and user privileges according to least-privilege principles
- Add authorization tests for each sensitive endpoint using authenticated users with different roles
- Reduce trust in user-controlled notification destinations and apply SSRF-resistant outbound request controls
How teams detect issues like this
Detection can combine static analysis, code review, runtime monitoring, and policy enforcement:
- Search for permission constructors or policy objects created with empty requirement collections
- Review boolean feature flags that alter authorization behavior, especially when false or unset values broaden access
- Identify authorization checks that default to allow when roles, scopes, or permissions are missing
- Add regression tests verifying that read-only identities receive denial responses for every administrative endpoint
- Monitor audit logs for privileged API actions performed by non-administrative roles
- Enforce API authorization policies in CI and deployment configuration checks
- Automated code review and security scanning tools may help identify fail-open access-control patterns

