Skip to content

crypto/x509: ParseRevocationList incorrect handling of the CRL Number field #73029

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

Open
onepeople158 opened this issue Mar 25, 2025 · 3 comments
Labels
BugReport Issues describing a possible bug in the Go implementation. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@onepeople158
Copy link

Go version

go version go1.24.1 linux/amd64

Output of go env in your module/workspace:

CN=US,OU=US,O=US,L=US,ST=US,C=US
2025-01-01 00:00:00 +0000 UTC
2025-12-01 00:00:00 +0000 UTC
-36
1

What did you do?

Hello Developer, I have a CRL file with a CRL number value of -36. According to RFC5280, the CRL number should be a non-negative integer, but Go successfully parsed the CRL Number field of this CRL without any errors.

What did you see happen?

Go successfully parsed the CRL Number field of this CRL without any errors.

What did you expect to see?

crl_file_test_.zip

@gabyhelp
Copy link

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@gabyhelp gabyhelp added the BugReport Issues describing a possible bug in the Go implementation. label Mar 25, 2025
@dmitshur dmitshur changed the title crypto/X509:Go incorrectly handles the CRL Number field crypto/x509: incorrect handling of the CRL Number field Mar 25, 2025
@dmitshur
Copy link
Member

CC @golang/security.

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 25, 2025
@seankhliao seankhliao changed the title crypto/x509: incorrect handling of the CRL Number field crypto/x509: ParseRevocationList incorrect handling of the CRL Number field Apr 10, 2025
@cpu
Copy link
Member

cpu commented Apr 18, 2025

I agree with the premise that a negative CRL number extension is out of spec, but I'm not sure there's a strong motivator for making it a parse-time error. The extension is described as non-critical, and AIUI largely serves as a hint for when one CRL super-cedes another. It doesn't feel like a case worth wiring up a GODEBUG for.

Perhaps we leave ParseRevocationList alone but make CreateRevocationList error for an invalid RevocationList.Number in the input template?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugReport Issues describing a possible bug in the Go implementation. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants