openwisp / openwisp/openwisp-controller

[bug] Prevent renewing revoked X.509 certificates

Open
#1,467 9 comments 0 reactions 1 assignee View on GitHub

@krrishnaik is already working on this.

Since Sep 15, 2026.

bug
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

  1. Create a CA and a certificate through the PKI API or Django admin.
  2. Revoke the certificate with POST /api/v1/controller/cert/<id>/revoke/.
  3. Record the revoked certificate serial from the CA CRL.
  4. Renew the same certificate with POST /api/v1/controller/cert/<id>/renew/.
  5. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.