CVE-2025-22874 Overview
Calling Verify with a VerifyOptions.KeyUsages that contains ExtKeyUsageAny unintentionally disabled policy validation. This only affected certificate chains that contain policy graphs, which are relatively uncommon.
Critical Impact
This vulnerability can lead to a bypass in certificate policy validation, posing significant security risks for affected applications.
Affected Products
- Go Programming Language
Discovery Timeline
- 2025-06-11 - CVE CVE-2025-22874 published to NVD
- 2025-06-12 - Last updated in NVD database
Technical Details for CVE-2025-22874
Vulnerability Analysis
The vulnerability arises from a misconfiguration in the VerifyOptions.KeyUsages. By including ExtKeyUsageAny, policy validation gets unintentionally disabled, potentially allowing unauthorized certificate chains to be accepted.
Root Cause
The inclusion of ExtKeyUsageAny in VerifyOptions.KeyUsages without proper handling leads to the bypass of policy validation.
Attack Vector
Network
// Example exploitation code (sanitized)
package main
import (
"crypto/x509"
"crypto/tls"
"log"
)
func verifyConnection() {
certPool := x509.NewCertPool()
opts := x509.VerifyOptions{
KeyUsages: []x509.ExtKeyUsage{x509.ExtKeyUsageAny},
}
chain, err := certPool.Verify(opts)
if err != nil {
log.Fatal("Policy validation bypassed")
}
// Further processing
}
Detection Methods for CVE-2025-22874
Indicators of Compromise
- Presence of ExtKeyUsageAny in VerifyOptions
- Unusual certificate acceptance logs
- Debugging messages related to policy validation
Detection Strategies
Monitor and review certificate verification processes for any instances where ExtKeyUsageAny is included in KeyUsages. Regularly audit logs for anomalies in certificate validation.
Monitoring Recommendations
Use advanced network monitoring tools to track and alert on unexpected certificate chains being trusted. SentinelOne provides robust detection features to identify such anomalies through behavior analysis.
How to Mitigate CVE-2025-22874
Immediate Actions Required
- Update the Go programming environment to the latest secure version.
- Ensure VerifyOptions are correctly configured.
- Review and audit any certificate validation logic.
Patch Information
Consult the Go advisory for guidance on patched versions and security recommendations.
Workarounds
Review the VerifyOptions implementation to exclude ExtKeyUsageAny unless explicitly necessary. Consider custom policy validation logic.
# Configuration example
# Ensure that ExtKeyUsageAny is handled appropriately in the source code
find . -type f -name '*.go' -exec grep -Hn 'ExtKeyUsageAny' {} \;
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

