CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-3GJW-F78C-VVPW

GHSA-3GJW-F78C-VVPW: Denial of Service via Unhandled Out-of-Bounds Indexing Panic in tokio-postgres

Alon Barad
Alon Barad
Software Engineer

Aug 24, 2026·6 min read·17 visits

Executive Summary (TL;DR)

Unvalidated DataRow field counts in tokio-postgres allow a rogue or compromised database server to crash client applications via an out-of-bounds panic.

An issue was discovered in the tokio-postgres library for Rust prior to version 0.7.18. A trust assumption mismatch between the PostgreSQL protocol messages sent by a server and how they are parsed and indexed by the client-side library allows a rogue or compromised database server to trigger a Denial of Service (DoS) crash via an unhandled out-of-bounds slice indexing panic.

Vulnerability Overview

tokio-postgres is an asynchronous, pure-Rust client implementation for the PostgreSQL database. It is widely deployed across high-performance Rust web backends, microservices, and data pipelines to manage database connection pools and execute SQL statements asynchronously. The library communicates directly with PostgreSQL backends using the standard PostgreSQL frontend/backend protocol.

A trust assumption mismatch exists within the library regarding messages sent by the database server. Specifically, the client assumes that the database server will only transmit well-formed row data that strictly matches the previously declared query schema. This architectural trust exposes an attack surface where a rogue or manipulated database server can trigger unexpected state transitions on the client.

The vulnerability manifests as an unhandled out-of-bounds slice indexing panic. This occurs when the client attempts to access fields of a row that contains fewer fields than the columns advertised in the query's metadata. Because the panic is unhandled, it typically terminates the executing thread or aborts the entire Rust process, leading to a Denial of Service (DoS) of the client application.

Root Cause Analysis

To understand the root cause of this vulnerability, we must examine the sequence of messages in the PostgreSQL backend-to-frontend protocol. When a client issues a query, the backend server first sends a RowDescription (type 'T') message. This message contains metadata about each column, including its name, table OID, attribute number, data type, size, and modifier. This message establishes the structure and column count N of the expected output.

Following the description, the backend transmits one or more DataRow (type 'D') messages containing the actual query results. A DataRow starts with a two-byte integer indicating the number of fields M present in that row, followed by length-value pairs for each field. Under normal conditions, the field count M must equal the column count N defined in the RowDescription message.

Prior to version 0.7.18, tokio-postgres did not validate that M is equal to N during row construction. The constructor parsed the DataRow into an internal vector of byte ranges representing each field's offset. When an application later attempted to access a column at index I (where 0 <= I < N), the library mapped the index to the corresponding range in the vector. If M < N and the application requested an index I >= M, the program attempted to access an element beyond the bounds of the parsed ranges vector, causing an indexing panic.

Code Analysis

We can analyze the vulnerability by inspecting the code inside tokio-postgres/src/row.rs prior to the patch.

// Vulnerable Row constructor
impl Row {
    pub(crate) fn new(statement: Statement, body: DataRowBody) -> Result<Row, Error> {
        let ranges = body.ranges().collect().map_err(Error::parse)?;
        Ok(Row {
            statement,
            body,
            ranges,
        })
    }
}

In this implementation, ranges is populated directly from the DataRowBody without evaluating its length against the number of expected columns in statement.columns(). The application retrieves data using column indexes, which are bounds-checked against the Statement columns, not the actual ranges vector.

The patch introduces strict validation in both Row::new and SimpleQueryRow::new functions:

// Patched Row constructor
impl Row {
    pub(crate) fn new(statement: Statement, body: DataRowBody) -> Result<Row, Error> {
        let ranges = body.ranges().collect().map_err(Error::parse)?;
        let row = Row {
            statement,
            body,
            ranges,
        };
        // The DataRow field count is sent by the server independently of the
        // RowDescription column count; a mismatch would make column accessors
        // index `ranges` out of bounds and panic, so reject it up front.
        if row.ranges.len() != row.statement.columns().len() {
            return Err(Error::parse(io::Error::new(
                io::ErrorKind::InvalidData,
                "DataRow field count does not match the number of columns",
            )));
        }
        Ok(row)
    }
}

This validation converts an inevitable out-of-bounds panic into a standard, recoverable Rust Result::Err wrapping an io::Error of type InvalidData.

Exploitation Mechanics

An attacker can exploit this vulnerability through three main vectors: hosting a rogue PostgreSQL database, compromising an existing database server, or executing a Man-in-the-Middle (MitM) attack to alter network packets. The vulnerability requires no authentication on the application side beyond standard database access configuration.

In a typical exploit scenario, the client application initiates a query expecting a multi-column result. The attacker-controlled server sends a valid RowDescription defining two columns but returns a DataRow with only one field.

When the client receives the data, the row is instantiated successfully because there is no constructor-level validation. The crash occurs when the application attempts to process the row, specifically when indexing into the ranges vector during column value extraction.

Impact Assessment & Security Context

The security impact of this vulnerability is a complete Denial of Service (DoS) of the client application. Because Rust's asynchronous execution model often routes multiple client requests through a shared thread pool, an unhandled panic can abort the task and, depending on panic behavior configurations (such as panic = "abort"), crash the entire executable.

The attack requires low complexity if the target application connects to external or user-provided database sources. In managed cloud environments where database endpoints are strictly controlled, exploitation requires either network-level interception (MitM) or prior compromise of the database host.

As this issue is tracked exclusively under the GitHub Advisory Database (GHSA-3GJW-F78C-VVPW) and does not have an assigned CVE identifier, standard scoring metrics like CVSS or EPSS percentiles from NVD are not available. However, a qualitative risk assessment places this at High severity because of the low effort required to crash consumer services once database communication is intercepted.

Remediation & Detection Guidance

Remediation requires upgrading the tokio-postgres library to version 0.7.18 or later. This can be verified by analyzing the dependency tree using the Cargo build tool.

cargo tree -p tokio-postgres

To prevent network-level exploitation such as packet manipulation, database connections must enforce strict TLS validation. Applications should avoid connecting to database servers over unencrypted connections or with disabled certificate checks.

// Secure connection configuration
let mut builder = native_tls::TlsConnector::builder();
// Ensure strict verification of the server's identity
builder.danger_accept_invalid_certs(false);
builder.danger_accept_invalid_hostnames(false);

Additionally, applications should handle database queries within structured boundaries that can recover from runtime errors, ensuring that database parsing failures do not lead to application crashes.

Official Patches

rust-postgresOfficial commit patch fixing the out-of-bounds row indexing vulnerability

Fix Analysis (1)

Technical Appendix

CVSS Score
7.5/ 10
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

Affected Systems

tokio-postgres library client applications

Affected Versions Detail

Product
Affected Versions
Fixed Version
tokio-postgres
rust-postgres
< 0.7.180.7.18
AttributeDetail
CWE IDCWE-129
Attack VectorNetwork / Man-in-the-Middle / Malicious Database Connection
CVSS Score7.5 (Qualitative Assessment)
EPSS ScoreN/A (No CVE Assigned)
ImpactDenial of Service (DoS)
Exploit Statusnone
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1499Endpoint Denial of Service
Impact
T1557Man-in-the-Middle
Credential Access / Lateral Movement
CWE-129
Improper Validation of Array Index

The product uses an input value to index an array, but it does not validate that the index is within the valid range.

Vulnerability Timeline

Vulnerability patched in rust-postgres repository
2026-06-12
Release tokio-postgres 0.7.18 published to crates.io
2026-06-12
GitHub Security Advisory GHSA-3GJW-F78C-VVPW published
2026-06-12

References & Sources

  • [1]GitHub Security Advisory GHSA-3GJW-F78C-VVPW
  • [2]Fix Commit
  • [3]tokio-postgres v0.7.18 Release Notes

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•2 minutes ago•CVE-2026-109619
9.2

CVE-2026-109619: Remote Code Execution in PHP Core via Stale Global State Memory Corruption (PHP2Shell)

CVE-2026-109619 (PHP2Shell) is a critical Use-After-Free vulnerability in the core PHP engine caused by improper global state cleanup during out-of-memory exception handling across persistent worker requests.

Alon Barad
Alon Barad
1 views•6 min read
•5 minutes ago•CVE-2026-113721
4.5

CVE-2026-113721: Unsafe Link Resolution in virtualenv File Generation

In Python virtualenv prior to version 21.14.9, activation script generators and configuration writers use Path.exists() before writing files. Because Path.exists() resolves symbolic links, it returns False for dangling symlinks. Consequently, virtualenv skips unlinking pre-planted symbolic links or hard links, writing data directly to target locations outside the intended virtual environment directory.

Amit Schendel
Amit Schendel
1 views•5 min read
•9 days ago•CVE-2026-87697
8.8

CVE-2026-87697: Untrusted Deserialization in .NET PresentationCore Clipboard Handling

A remote code execution vulnerability exists in Microsoft .NET due to untrusted data deserialization within the PresentationCore component. The flaw stems from implicit auto-conversion flags during clipboard data retrieval operations.

Alon Barad
Alon Barad
31 views•5 min read
•9 days ago•CVE-2026-70007
8.8

CVE-2026-70007: Out-of-Bounds Write Vulnerability in .NET Framework and WPF Subsystem

An out-of-bounds write vulnerability in Microsoft .NET Framework, .NET runtime, and Visual Studio allows unauthenticated remote attackers to execute arbitrary code via crafted pixel-shader bytecode or auto-converted clipboard payloads.

Amit Schendel
Amit Schendel
19 views•6 min read
•10 days ago•CVE-2026-70186
7.5

CVE-2026-70186: ASP.NET Core Denial of Service Vulnerability via Framework Deadlock

ASP.NET Core contains a thread deadlock vulnerability (CWE-833) that allows an unauthenticated remote attacker to cause a denial of service over the network by exhausting server thread pool resources.

Amit Schendel
Amit Schendel
18 views•5 min read
•10 days ago•CVE-2026-70035
8.8

CVE-2026-70035: Insecure Deserialization Remote Code Execution in Microsoft .NET Framework and .NET Runtime

CVE-2026-70035 is a high-severity Remote Code Execution (RCE) vulnerability in Microsoft .NET Framework, .NET runtime, and Visual Studio caused by improper handling during the deserialization of untrusted data (CWE-502). An unauthenticated attacker can execute arbitrary code within the context of the affected process by delivering a crafted serialized payload.

Amit Schendel
Amit Schendel
24 views•6 min read