Security Vulnerability Report
中文
CVE-2026-32286 CVSS 7.5 HIGH

CVE-2026-32286

Published: 2026-03-26 20:16:12
Last Modified: 2026-04-02 20:16:23

Description

The DataRow.Decode function fails to properly validate field lengths. A malicious or compromised PostgreSQL server can send a DataRow message with a negative field length, causing a slice bounds out of range panic.

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)

No configuration data available.

jackc/pgx < 4.x.x (具体版本请参考官方GHSA公告)
pgproto3 < 4.x.x (具体版本请参考官方GHSA公告)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
package main import ( "fmt" "github.com/jackc/pgx/v5/pgproto3" ) func main() { // Simulate a malicious DataRow message with a negative field length // This PoC demonstrates the parsing logic that leads to panic backend := pgproto3.NewBackend([]byte{}, nil) // Construct a malicious DataRow message manually or trigger via network // Normally, the server sends: DataRow [len1, bytes1, len2, bytes2...] // Here we simulate receiving a message with a negative length in the stream // which causes the panic in vulnerable versions. fmt.Println("Attempting to parse malicious DataRow...") // Actual exploitation requires a malicious server connection. // This code represents the vulnerability context. // Example of the vulnerable function call context: // msg := &pgproto3.DataRow{} // msg.Decode(backend) // If backend stream contains negative length, panic occurs fmt.Println("PoC requires a malicious Postgres server connection.") }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-32286", "sourceIdentifier": "[email protected]", "published": "2026-03-26T20:16:12.303", "lastModified": "2026-04-02T20:16:23.443", "vulnStatus": "Awaiting Analysis", "cveTags": [], "descriptions": [{"lang": "en", "value": "The DataRow.Decode function fails to properly validate field lengths. A malicious or compromised PostgreSQL server can send a DataRow message with a negative field length, causing a slice bounds out of range panic."}, {"lang": "es", "value": "La función DataRow.Decode no valida correctamente las longitudes de los campos. Un servidor PostgreSQL malicioso o comprometido puede enviar un mensaje DataRow con una longitud de campo negativa, causando un pánico de desbordamiento de límites de slice."}], "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}]}, "references": [{"url": "https://github.com/advisories/GHSA-jqcq-xjh3-6g23", "source": "[email protected]"}, {"url": "https://github.com/golang/vulndb/issues/4518", "source": "[email protected]"}, {"url": "https://github.com/jackc/pgx/issues/2507", "source": "[email protected]"}, {"url": "https://pkg.go.dev/vuln/GO-2026-4518", "source": "[email protected]"}, {"url": "https://securityinfinity.com/research/memory-safety-vulnerabilities-in-go-postgresql-wire-protocol-parsers-pgproto3-pgx", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0"}]}}