openwisp / openwisp/openwisp-controller
[bug] Prevent renewing revoked X.509 certificates
@krrishnaik is already working on this.
Since Sep 15, 2026.
- Dominant language
- Python
- Stars
- 773
- Forks
- 315
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 14
Description
Describe the bug
The certificate renewal endpoint accepts revoked X.509 certificates. Cert.renew() generates a new serial number while leaving revoked=True, so the CA CRL subsequently contains the new serial instead of the serial from the certificate that was revoked. The original certificate can therefore no longer be matched by the current CRL.
Steps To Reproduce
- Create a CA and a certificate through the PKI API or Django admin.
- Revoke the certificate with
POST /api/v1/controller/cert/<id>/revoke/. - Record the revoked certificate serial from the CA CRL.
- Renew the same certificate with
POST /api/v1/controller/cert/<id>/renew/. - Download the CA CRL again.
Expected behavior
Renewal of a revoked certificate is rejected, and its original serial remains present in the CA CRL.
Screenshots
N/A.
System Information:
- OS: Linux
- Python Version: 3.10.19
- Django Version: 5.2.15
- Browser and Browser Version: N/A
The issue reproduces from the current master implementation of CertRenewView.post(). A regression test should revoke a certificate, attempt renewal, and assert that the request is rejected and that the original revoked serial remains in the CRL.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.