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·20 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

•5 minutes ago•CVE-2026-62297
7.5

CVE-2026-62297: Uncontrolled Memory Allocation and Denial of Service in ag-psd

An uncontrolled memory allocation vulnerability exists in ag-psd versions prior to 31.0.0. When parsing Adobe Photoshop Document (PSD) files, the readPsd() function reads image dimensions and color depth directly from the file header and allocates off-heap typed arrays without validating whether the requested memory size is proportional to the input stream or bounded by operational thresholds. An unauthenticated attacker can supply a crafted 52-byte PSD payload that triggers an immediate 3.35 GB memory allocation, resulting in process termination via the operating system Out-Of-Memory (OOM) killer.

Amit Schendel
Amit Schendel
0 views•10 min read
•about 1 hour ago•CVE-2026-126297
7.5

CVE-2026-126297: Algorithmic Complexity Denial of Service in NLTK ConllCorpusReader

CVE-2026-126297 (GHSA-v8f3-6phw-6mh9) is an uncontrolled resource consumption and algorithmic complexity vulnerability in the Natural Language Toolkit (NLTK) prior to version 3.10.4. Located in the Semantic Role Labeling (SRL) parser within `nltk/corpus/reader/conll.py`, the flaw allows an attacker to trigger quadratic O(N^2) CPU processing overhead by providing crafted CoNLL-formatted corpus inputs containing decoy span columns or nested full-width verb spans. Applications parsing untrusted linguistic corpora can experience prolonged CPU exhaustion and application-level Denial of Service (DoS).

Amit Schendel
Amit Schendel
2 views•12 min read
•about 2 hours ago•CVE-2026-126298
7.5

CVE-2026-126298: Quadratic Algorithmic Complexity Denial of Service in NLTK Tree.chomsky_normal_form

CVE-2026-126298 (also tracked as GHSA-r53h-rw34-8h97) is an algorithmic complexity Denial of Service (DoS) vulnerability in the Natural Language Toolkit (NLTK) Python library affecting all versions prior to 3.10.4. The vulnerability resides in the nltk.tree.transforms.chomsky_normal_form function and its corresponding public method Tree.chomsky_normal_form(). When transforming a parse tree into Chomsky Normal Form using the default right-factoring strategy, the function repeatedly invokes list.pop(0) inside a loop iterating over all children of a node. In CPython, removing the initial element of a standard list requires an O(N) memory shift operation, causing the overall binarization algorithm to degrade to O(N^2) quadratic time complexity relative to the width of a node. Furthermore, converting horizontal node width into vertical tree depth bypasses initial parsing depth bounds, triggering subsequent stack exhaustion (RecursionError) when recursive methods traverse the mutated structure. Unauthenticated remote attackers who can submit bracketed tree strings to applications invoking this transformation can exhaust single-threaded CPU resources or induce unhandled application exceptions.

Alon Barad
Alon Barad
5 views•12 min read
•about 3 hours ago•CVE-2026-126299
7.5

CVE-2026-126299: Quadratic Algorithmic Complexity Denial of Service in NLTK CCG Lexicon Parser

An algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) before version 3.10.4 allows remote unauthenticated attackers to cause a denial of service via crafted Combinatory Categorial Grammar (CCG) lexicon strings. The parser in nltk.ccg.lexicon.fromstring performs repeated immutable string slicing, concatenation, and regex tail capturing, resulting in O(n^2) CPU consumption when processing wide, flat category definitions.

Alon Barad
Alon Barad
4 views•10 min read
•about 4 hours ago•CVE-2026-126295
7.1

CVE-2026-126295: Path Traversal and Unconfined File Access in NLTK BllipParser

CVE-2026-126295 (also tracked as GHSA-fg9w-wfp5-j933) is a path confinement bypass vulnerability in the Natural Language Toolkit (NLTK) affecting versions 3.10.0 prior to 3.10.4. The flaw resides in nltk/parse/bllip.py within the BllipParser class and its factory method BllipParser.from_unified_model_dir(). Unlike sibling tool wrappers in NLTK that enforce data-root confinement via the nltk.pathsec module, BllipParser passes caller-supplied filesystem paths directly into the third-party bllipparser native C extension without validation. When an application passes untrusted input as model paths or directories to BllipParser, an attacker can force the native extension to open arbitrary files on the local filesystem. This leads to information disclosure through parser diagnostic oracles, local model tampering via shared directories, and denial of service by hanging worker threads on blocking special files (such as FIFOs or device nodes) or exhausting memory via oversized files.

Amit Schendel
Amit Schendel
2 views•11 min read
•about 5 hours ago•CVE-2026-126300
5.3

CVE-2026-126300: Algorithmic Complexity Denial of Service in NLTK TreebankWordTokenizer.span_tokenize

CVE-2026-126300 (GHSA-ffr9-mgrr-wcvr) is an inefficient algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) Python library affecting versions 3.2.5 prior to 3.10.4. The flaw resides in the quote-restoration routine of TreebankWordTokenizer.span_tokenize and NLTKWordTokenizer.span_tokenize, where repeated calls to list.pop(0) over matched quote tokens introduce quadratic O(n^2) time complexity. An unauthenticated remote attacker who supplies input containing long sequences of double-quote characters can exhaust CPU resources and degrade service availability.

Amit Schendel
Amit Schendel
3 views•10 min read