-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crypto/x509: Verify allows serialNumber larger than 20 octets #72076
Comments
See CL 589615. |
The GnuTLS results I provide as a comparison are based on gnutls-3.8.9 (2025-02-08) |
@golang/security |
There is unfortunately not really anything we can do here. We tried restricting serials to 20 octets, and the public PKI works fine, but far far too many private PKIs get this horribly wrong and the breakage we saw was not worth enforcing this constraint. |
Thanks for your reply. |
It is possible, but every configuration knob is an expense for maintenance, testing, and code comprehension. We wouldn't do it just because we can. We would only do it if there is a good reason for it. |
Go version
go version go1.23.2 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Perform certificate verification
go run go_verify.go
The execution result is passed verification
Certificate is valid!
I provide the test case used:certs&program.zip
What did you see happen?
RFC5280 states: Conforming CAs MUST NOT use serialNumber values longer than 20 octets.
GnuTLS performs this check during validation and refuses to accept such certificates.
What did you expect to see?
Validation failed
The text was updated successfully, but these errors were encountered: