---
id: CVE-2026-56874
aliases:
  - GO-2026-6173
title: >-
  Pre-protocol error reader permits unbounded memory consumption in
  github.com/lib/pq
summary: >-
  Pre-protocol error reader permits unbounded memory consumption in
  github.com/lib/pq
severity: none
vendor: lib
product: github.com/lib/pq
ecosystem: go
affected:
  - github.com/lib/pq >= 1.11.0
published: '2026-08-18'
updated: '2026-08-18'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GO-2026-6173'
references:
  - url: 'https://github.com/golang/vulndb/issues/6173'
tags:
  - osv
  - go
ingestedAt: '2026-08-18T19:21:39.202Z'
---

## Overview

The special-case parser for PostgreSQL pre-protocol plain-text errors in github.com/lib/pq calls bufio.Reader.ReadString(0) without a byte limit. A malicious PostgreSQL endpoint or active network attacker on an unauthenticated transport can send an error message response with non-NUL bytes continuously, causing the client to buffer an arbitrarily large string and crash with an unrecoverable out-of-memory error.

## Affected packages

- `github.com/lib/pq >= 1.11.0`

## Remediation

Refer to the advisory for the patched release.
