CVE-2026-4427
Received Received - Intake
Input Validation Flaw in pgproto3 Causes PostgreSQL DoS Panic

Publication date: 2026-03-19

Last updated on: 2026-03-30

Assigner: Red Hat, Inc.

Description
Rejected reason: Duplicate of CVE-2026-32286
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-03-19
Last Modified
2026-03-30
Generated
2026-05-07
AI Q&A
2026-03-19
EPSS Evaluated
2026-03-29
NVD
EUVD
Affected Vendors & Products
Showing 2 associated CPEs
Vendor Product Version / Range
jackc pgproto3 v2.0.0
jackc pgproto3 v2.3.3
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-129 The product uses untrusted input when calculating or using an array index, but the product does not validate or incorrectly validates the index to ensure the index references a valid position within the array.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

[{'type': 'paragraph', 'content': "CVE-2026-4427 is a vulnerability in the Go module github.com/jackc/pgproto3/v2, specifically in the DataRow.Decode function. The flaw occurs because the function improperly handles field lengths in DataRow messages received from a PostgreSQL server. If a malicious or compromised PostgreSQL server sends a DataRow message with a negative field length (encoded as a negative int32), the code's bounds check fails to detect this due to how it compares lengths, allowing the code to attempt slicing with a negative length."}, {'type': 'paragraph', 'content': 'This improper validation leads to a runtime panic caused by a slice bounds out of range error, crashing the Go application using this library. The vulnerability affects all versions from 2.0.0 onward and remains unpatched upstream. The issue corresponds to CWE-129: Improper Validation of Array Index.'}] [1, 2, 4]


How can this vulnerability impact me? :

This vulnerability can be exploited by a malicious or compromised PostgreSQL server to cause a denial of service (DoS) on any Go application using the pgproto3 library. By sending a single crafted DataRow message with a negative field length, the server can trigger a runtime panic that crashes the client application.

No special privileges or user interaction are required to exploit this vulnerability, and it can be triggered remotely over the network. The impact is high availability loss, as the application will terminate unexpectedly, but there is no impact on confidentiality or integrity.


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

I don't know


How can this vulnerability be detected on my network or system? Can you suggest some commands?

This vulnerability is triggered by a malicious or compromised PostgreSQL server sending a DataRow message with a negative field length, causing a denial of service via a runtime panic in applications using the pgproto3 library.

Detection involves monitoring network traffic between your client and PostgreSQL servers for unusual or malformed DataRow messages, specifically those containing negative field lengths encoded as signed int32 values.

Since the issue is in the DataRow.Decode function of the Go pgproto3 library, you can detect attempts by capturing and inspecting PostgreSQL protocol messages for invalid field lengths.

No specific ready-made commands are provided in the resources, but you can use packet capture tools like tcpdump or Wireshark to capture PostgreSQL traffic and analyze DataRow messages for negative field lengths.

  • Use tcpdump to capture PostgreSQL traffic on port 5432: tcpdump -i <interface> port 5432 -w pgsql_traffic.pcap
  • Analyze the capture with Wireshark or a custom parser to inspect DataRow messages for negative field length values.

Additionally, monitoring application logs for unexpected panics or crashes related to pgproto3 DataRow decoding can help detect exploitation attempts.


What immediate steps should I take to mitigate this vulnerability?

The immediate mitigation is to prevent the application from crashing by ensuring that the pgproto3 library properly validates the field length in DataRow messages.

Since the vulnerability arises from missing a check for negative field lengths, the recommended fix is to add an explicit guard condition rejecting negative values before slicing the buffer.

If you maintain the affected Go application, apply the following patch to the DataRow.Decode function:

  • Add a check: if msgSize == -1 { dst.Values[i] = nil } else if msgSize < 0 || len(src[rp:]) < msgSize { return error } else { proceed }

If you are using a version of pgproto3 that is unpatched and no official fix is available, consider:

  • Avoid connecting to untrusted or potentially compromised PostgreSQL servers.
  • Monitor for updates or patches from the pgproto3 maintainers or downstream consumers like jackc/pgx.
  • Implement network-level protections such as firewall rules to restrict connections to trusted PostgreSQL servers.

Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart