How to fix: Certificate serial number has too little entropy
The leaf certificate's serial number is shorter than sixteen hexadecimal digits. That is below the 64 bits of CSPRNG output the CA/Browser Forum has required since ballot 164 in 2016.
Why it matters
Serial-number entropy is the defence against a chosen-prefix collision attack on the certificate signature: an attacker who can predict the serial can prepare a colliding certificate before it is issued. It is the property that kept SHA-1 issuance survivable while it was being phased out, and it protects any hash whose margin narrows later in the same way.
A short serial almost always means a private CA or an appliance generating certificates from a counter rather than a random source. A well-known 2019 incident forced the mass revocation of millions of publicly trusted certificates issued with 63 bits instead of 64, which is how narrowly this requirement is read.
How to fix it
- 1Configure the issuing CA to draw serial numbers from at least 64 bits of CSPRNG output.
- 2Reissue certificates that were generated with counter-based or short serials.
- 3For a private CA built on OpenSSL, stop using a plain incrementing serial file and generate random serials instead.
Code examples
Read the serial
openssl s_client -connect example.com:443 </dev/null 2>/dev/null \
| openssl x509 -noout -serialPrivate CA: random serial instead of a counter
openssl rand -hex 16 > ca.srl
openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key \
-CAserial ca.srl -sha256 -days 397 -out server.crtReferences
Detected automatically by VulnRadar. The check id is tls-cert-serial-low-entropy, stable across every scan so you can filter or diff on it.
More tls checks
Questions
- How severe is Certificate serial number has too little entropy?
- VulnRadar rates this low severity in the tls category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
- Does VulnRadar check for this automatically?
- Yes. It runs as part of every scan under the check id tls-cert-serial-low-entropy, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does Certificate serial number has too little entropy map to?
- It maps to CWE-331. In the OWASP Top 10 it falls under A02:2021.
Missing a check?
The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.