Skip to main content
Vulnerability Database/CVE-2026-63209

CVE-2026-63209: compress Library Buffer Overflow Vulnerability

CVE-2026-63209 is a buffer overflow flaw in the compress library that allows attackers to trigger out-of-bounds memory access. This post explains its technical details, affected versions, impact, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-63209 Overview

CVE-2026-63209 is a signed integer overflow vulnerability [CWE-190] in the klauspost/compress Go library, affecting the S2 compression package. The flaw resides in s2.NewDict(), where a uvarint-encoded repeat value exceeding MaxInt64 bypasses repeat index validation. When Dict.Encode() is later called, the overflowed negative repeat value triggers an out-of-bounds memory access through unsafe.Pointer arithmetic, crashing the process with a SIGSEGV. The issue was patched in version 1.18.7.

Critical Impact

A remote attacker can craft a malicious S2 dictionary that causes any Go application using vulnerable versions of klauspost/compress to terminate with a segmentation fault, resulting in denial of service.

Affected Products

  • github.com/klauspost/compress Go module, s2 subpackage
  • All versions prior to v1.18.7
  • Any Go application or service embedding vulnerable versions of the library for S2 compression

Discovery Timeline

  • 2026-09-29 - CVE-2026-63209 published to NVD
  • 2026-09-30 - Last updated in NVD database

Technical Details for CVE-2026-63209

Vulnerability Analysis

The klauspost/compress library provides Go implementations of several compression algorithms, including the S2 format, an extension of Snappy. The s2.NewDict() constructor parses dictionary metadata that includes a repeat index encoded as an unsigned varint. This value is stored in a signed 64-bit integer without validating that the parsed value fits within the positive range of int64.

When a uvarint decodes to a value larger than MaxInt64, the assignment wraps to a negative number. Subsequent validation checks on the repeat index pass because the compare logic assumes non-negative input. The corrupted value is then persisted inside the returned Dict object.

During later invocation of Dict.Encode(), the negative repeat index is used in pointer arithmetic performed through unsafe.Pointer. The computed address falls outside the allocated buffer, and the Go runtime aborts the process with SIGSEGV. Because Go does not recover from segmentation faults, the crash affects the entire process, not just the calling goroutine.

Root Cause

The root cause is missing bounds validation on a uvarint-decoded field before it is cast to a signed type. The parser accepts values up to 2^64 - 1, but the destination type only accommodates 2^63 - 1 as a positive value. The signed overflow produces a negative offset that downstream code treats as trusted and non-negative.

Attack Vector

An attacker who can supply an S2 dictionary to a target application can trigger the crash. Any network-facing service that accepts user-controlled compressed data or dictionary inputs, and later calls Dict.Encode(), is exposed. Exploitation requires no authentication or user interaction and results in process termination.

go
// Security patch context from s2/cmd/_s2sx/_unpack/main.go
// Note: this diff hardens symlink handling in the s2sx unpacker
// distributed alongside the v1.18.7 release that fixes CVE-2026-63209.

			f.Close()
		case tar.TypeSymlink:
			target = path.Clean(target)
+			// A symlink target is resolved relative to the link's own
+			// directory (or used as-is when absolute); reject any that
+			// escape dst so the link cannot point outside the archive root.
+			linkTarget := header.Linkname
+			if !filepath.IsAbs(linkTarget) {
+				linkTarget = filepath.Join(filepath.Dir(target), linkTarget)
+			}
+			if !within(dst, linkTarget) {
+				return fmt.Errorf("illegal link target: %s", header.Linkname)
+			}
			if !*quiet {
				fmt.Println(target)
			}
// Source: https://github.com/klauspost/compress/commit/539243b8823ee8f03e49969823d57c348c917536

Detection Methods for CVE-2026-63209

Indicators of Compromise

  • Unexpected SIGSEGV terminations of Go processes that ingest compressed data, with stack traces referencing s2.Dict.Encode or unsafe.Pointer arithmetic inside the s2 package.
  • Repeated abnormal restarts of services that accept user-supplied S2 dictionaries or streams, especially correlated with specific client IPs.
  • Runtime panics logged with runtime.sigpanic originating from github.com/klauspost/compress/s2 frames.

Detection Strategies

  • Perform software composition analysis (SCA) on Go modules and flag any dependency on github.com/klauspost/compress at versions below v1.18.7, including transitive dependencies.
  • Enable Go crash dumping (GOTRACEBACK=crash) in non-production environments to capture faulting stack frames and confirm the offending package path.
  • Correlate application crashes with inbound requests containing compressed payloads to identify attacker-controlled inputs.

Monitoring Recommendations

  • Instrument services with process supervision and alert on abnormal exit codes tied to segmentation faults.
  • Log the size and origin of S2 dictionaries provided by external callers and rate-limit anomalous submissions.
  • Ship application logs and crash telemetry to a centralized data lake to enable retroactive hunting across the fleet.

How to Mitigate CVE-2026-63209

Immediate Actions Required

  • Upgrade github.com/klauspost/compress to v1.18.7 or later in every affected Go module and rebuild all downstream binaries.
  • Inventory production services that call s2.NewDict() or Dict.Encode() with externally sourced dictionaries and prioritize their remediation.
  • Restart long-running processes after the upgrade to ensure vulnerable code is fully unloaded from memory.

Patch Information

The fix landed in klauspost/compressv1.18.7. Refer to the GitHub Security Advisory GHSA-259r-337f-4rfw, the v1.18.7 release notes, and the upstream commit for full details. The patch adds validation ensuring the uvarint-decoded repeat value cannot exceed MaxInt64 before it is used in pointer arithmetic.

Workarounds

  • Reject or pre-validate S2 dictionaries received from untrusted sources before passing them to s2.NewDict().
  • Enforce an upper bound on the size of incoming compressed payloads and dictionary blobs at the network or application boundary.
  • Isolate compression workloads inside supervised worker processes so a SIGSEGV does not take down the parent service.
bash
# Upgrade the vulnerable dependency in a Go project
go get github.com/klauspost/compress@v1.18.7
go mod tidy

# Verify no vulnerable versions remain in the dependency graph
go list -m -json all | grep -A2 'klauspost/compress'

# Scan the module for known vulnerabilities
govulncheck ./...

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.