---
id: CVE-2026-56871
aliases:
  - GO-2026-6170
title: Malformed backend frame length causes panic in github.com/lib/pq
summary: Malformed backend frame length causes panic in github.com/lib/pq
severity: none
vendor: lib
product: github.com/lib/pq
ecosystem: go
affected:
  - github.com/lib/pq >= 1.0.0
published: '2026-08-18'
updated: '2026-08-18'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GO-2026-6170'
references:
  - url: 'https://github.com/golang/vulndb/issues/6170'
tags:
  - osv
  - go
ingestedAt: '2026-08-18T19:21:39.096Z'
---

## Overview

github.com/lib/pq trusts the unsigned 32-bit length in every PostgreSQL backend frame and subtracts four without first checking that the wire length is at least four. A backend frame whose length is zero through three produces a negative payload length. recvMessage then slices the connection scratch buffer with that negative bound, causing an unrecovered runtime panic that terminates the calling goroutine and process.

## Affected packages

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

## Remediation

Refer to the advisory for the patched release.
