---
id: RUSTSEC-2026-0405
title: 'Out-of-bounds read with an out-of-range `InBuffer::pos`'
summary: 'Out-of-bounds read with an out-of-range `InBuffer::pos`'
severity: none
vendor: zstd-safe
product: zstd-safe
ecosystem: rust
affected:
  - 'zstd-safe >= 8.0.0-0, < 8.2.0'
patched:
  - zstd-safe 8.2.0
published: '2026-10-16'
updated: '2026-11-02'
sourceUpdated: '2026-11-02T09:30:03.399517581Z'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/RUSTSEC-2026-0405'
references:
  - url: 'https://crates.io/crates/zstd-safe'
  - url: 'https://rustsec.org/advisories/RUSTSEC-2026-0405.html'
  - url: >-
      https://github.com/gyscos/zstd-rs/commit/20d397c0d68d8b4300c5493875ebfa10e355fcdd
  - url: 'https://github.com/gyscos/zstd-rs/pull/384'
tags:
  - osv
  - rust
ingestedAt: '2026-10-27T16:20:12.117Z'
---

## Overview

`InBuffer`'s fields are public, so safe code can set `pos` past the end of
`src`. The position was passed to the C library unchecked, and
`ZSTD_seekable_compressStream`, unlike the other streaming functions, does
not validate it: it read past the end of the input slice, by up to the
frame size, and compressed that memory into the output.

The flaw was corrected by checking the position before every call into the
C library.

## Affected packages

- `zstd-safe >= 8.0.0-0, < 8.2.0`

## Remediation

Upgrade to a patched release:

- `zstd-safe 8.2.0`
