GitHub advisory · PyPI
Lemur: Unchecked `replaces[]` lets any user silence notifications and hijack auto-rotation for arbitrary certificates
Description
Repo under test: https://github.com/Netflix/lemur
The certificate create and upload endpoints accept a replaces[] (alias replacements) array that is resolved to live Certificate ORM objects with no ownership or CertificatePermission check on the referenced certificates. The SQLAlchemy Certificate.replaces append listener then immediately sets victim.notify = False and populates victim.replaced. From that point the victim certificate is excluded from auto-reissue, its expiration notifications are silenced, and the periodic certificate_rotate Celery task deploys the attacker's certificate (endpoint.certificate.replaced[0]) onto every endpoint serving the victim certificate.
Any authenticated non-read-only user can therefore silently substitute their own certificate onto production load balancers and Kubernetes secrets they hold no role on, while suppressing the legitimate certificate's lifecycle automation.
POST /api/1/certificates
POST /api/1/certificates/upload
PUT /api/1/certificates/<id>
lemur/certificates/schemas.py:402 — replaces = fields.Nested(AssociatedCertificateSchema, missing=[], many=True) accepted on create/upload/editlemur/schemas.py:152 — AssociatedCertificateSchema resolves any certificate by id/name via fetch_objects(Certificate, data) with no permission checklemur/certificates/views.py:651 — only StrictRolePermission().can() gates /certificates/upload; no check on data['replaces']lemur/certificates/models.py:506 — @event.listens_for(Certificate.replaces, 'append') sets value.notify = False on the victim
-…Manual fix · PyPI
pip install --upgrade "lemur>=1.9.3"Sources