Summary
A server-side request forgery vulnerability in Lemur's ACME certificate workflow allows authenticated users to influence the ACME directory URL used by the backend. If the destination is not restricted server-side, Lemur may make requests to cloud metadata endpoints or internal services, potentially exposing credentials; related authorization behavior may also preserve access to certificate private keys after ownership or role changes.
Affected context
The issue can arise in Lemur deployments where authenticated users can supply or influence an ACME authority URL and the backend uses that value to initialize an ACME client. Risk is higher when the Lemur service can reach cloud instance metadata, internal administrative services, or sensitive network locations. Separately, creator-based authorization decisions and limited key-export audit context may allow access to certificate private-key material to persist after ownership or role changes.
Exploit preconditions
- Attack surface: Lemur's authenticated certificate-management and ACME integration workflow
- Required access: An authenticated account with permission to initiate or configure certificate operations
- Trigger point: Backend initialization of the ACME client using an attacker-influenced
acme_url - Network condition: The Lemur backend must be able to reach the selected internal or metadata destination
- Authorization condition: Certificate key access may remain available when authorization relies on creator equality rather than current ownership or role state
- Why exploitation is possible: Server-side destination restrictions may be ineffective, allowing backend requests to attacker-selected locations, while authorization and audit context may not fully reflect current ownership
Why this happens
The primary flaw is a server-side request forgery condition mapped to CWE-918. The backend treats an ACME directory URL supplied through an authenticated workflow as a trusted destination without enforcing a sufficiently strict server-side allowlist, allowing the application network context to perform requests chosen by the user.
The related authorization weakness maps to CWE-285 and CWE-639. Authorization decisions based on creator identity can remain valid after ownership or role changes, creating a mismatch between historical creation context and current authorization state. Insufficient context in private-key export audit events can further limit the ability to distinguish legitimate access from access retained through this logic.
Potential impact
- The backend could access cloud instance metadata services.
- Cloud credentials or temporary tokens could be disclosed.
- Internal services may be queried from the Lemur network context.
- Network segmentation controls could be bypassed through the trusted backend.
- Certificate private keys could remain accessible after ownership or role changes.
- Attackers could use exposed credentials or keys for broader infrastructure or PKI compromise.
General mitigation guidance
Mitigation generally focuses on enforcing destination trust at the server boundary and making authorization depend on current ownership and privileges.
Common defensive patterns include:
- Restricting ACME directory destinations with a strict server-side host allowlist.
- Validating scheme, hostname, resolution behavior, ports, redirects, and resolved network ranges.
- Blocking access to cloud metadata endpoints, loopback addresses, link-local ranges, and private network destinations unless explicitly required.
- Avoiding reliance on user-supplied URLs as trusted backend destinations.
- Re-evaluating certificate ownership and role authorization at every private-key export.
- Applying least privilege to service identities and limiting network egress from Lemur workers.
- Recording creator, current owner, requesting principal, and authorization decision context in key-export audit events.
- Protecting private-key material with narrowly scoped access policies and secure storage controls.
How teams detect issues like this
Detection programs commonly combine application, network, and authorization monitoring.
Useful approaches include:
- Static analysis for HTTP client construction from request parameters or persisted user-controlled URL fields.
- Code review checks for missing host allowlists, unsafe redirect handling, DNS rebinding exposure, and private-address filtering.
- Tests that verify ACME requests cannot reach metadata, loopback, link-local, or unauthorized internal destinations.
- Network telemetry and egress policies that alert on Lemur connections to metadata services and unexpected private hosts.
- Review of certificate key-export events for creator, current owner, requester, role, and authorization-decision mismatches.
- Policy enforcement requiring explicit destination validation and current-owner authorization before sensitive operations.
- Automated security review tools can help identify SSRF sinks and creator-based authorization decisions, but findings should be validated against deployment network paths.

