Skip to content

crypto/x509: ExtKeyUsageAny bypasses policy validation #73612

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

Closed
rolandshoemaker opened this issue May 6, 2025 · 5 comments
Closed

crypto/x509: ExtKeyUsageAny bypasses policy validation #73612

rolandshoemaker opened this issue May 6, 2025 · 5 comments
Assignees
Labels
BugReport Issues describing a possible bug in the Go implementation. Security
Milestone

Comments

@rolandshoemaker
Copy link
Member

Due to how policy validation was implemented, passing VerifyOptions.KeyUsages containing ExtKeyUsageAny unintentionally disables policy validation. These two properties are unrelated, and disabling key usage validation shouldn't disable policy validation.

This is a security issue, but due to the rarity of policy validation, and because it requires the user to explicitly set ExtKeyUsageAny, which is also rare, we are treating this as a PUBLIC track security issue, per the Go Security policy.

Thanks to Krzysztof Skrzętnicki (@Tener) of Teleport for reporting this issue.

This is CVE-2025-22874.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/670375 mentions this issue: crypto/x509: decouple key usage and policy validation

@gabyhelp
Copy link

gabyhelp commented May 6, 2025

Related Code Changes

(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 May 6, 2025
@rolandshoemaker
Copy link
Member Author

@gopherbot please backport issue for Go 1.24.

@gopherbot
Copy link
Contributor

Backport issue(s) opened: #73700 (for 1.24).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/672316 mentions this issue: [release-branch.go1.24] crypto/x509: decouple key usage and policy validation

@dmitshur dmitshur added this to the Go1.25 milestone May 14, 2025
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. Security
Projects
None yet
Development

No branches or pull requests

4 participants