Skip to content

chore(deps): update module github.com/klauspost/compress to v1.20.2 [security] - #126

Open
deckhouse-BOaTswain wants to merge 1 commit into
mainfrom
renovate/go-github.com-klauspost-compress-vulnerability
Open

deckhouse-BOaTswain wants to merge 1 commit into
mainfrom
renovate/go-github.com-klauspost-compress-vulnerability

Conversation

@deckhouse-BOaTswain

@deckhouse-BOaTswain deckhouse-BOaTswain commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
github.com/klauspost/compress v1.18.5 -> v1.20.2 age confidence

GitHub Vulnerability Alerts

CVE-2026-63209

Signed Integer Overflow in s2.NewDict

Summary

A signed integer overflow vulnerability in s2.NewDict() allows an attacker to bypass repeat index validation by supplying a dictionary with a uvarint-encoded repeat value exceeding MaxInt64. When Dict.Encode() is subsequently called, the overflowed negative repeat value causes an out-of-bounds memory access via unsafe.Pointer arithmetic, crashing the process with SIGSEGV.

Package

  • Name: github.com/klauspost/compress/s2
  • Ecosystem: Go
  • Affected versions: <= v1.18.6 (all versions with NewDict function)

Severity

High (7.5) — CVSS v3.1: AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Vulnerability

Type

  • CWE-190: Integer Overflow or Wraparound
  • CWE-787: Out-of-bounds Write (via unsafe.Pointer)

Description

The NewDict() function reads a uvarint from dictionary data and converts it to int:

r, n := binary.Uvarint(dict)
// ...
d.repeat = int(r)
if d.repeat > len(dict) {
    return nil
}

When r exceeds MaxInt64 (9223372036854775807), int(r) overflows to a negative value. Since a negative number is never greater than a positive length, the validation check is bypassed.

When Dict.Encode() is called, the negative repeat value causes an integer overflow in encodeBlockDictGo():

repeat := len(dict.dict) - dict.repeat  // overflows: 62 - (-5758978476775341977) = huge positive
candidate := len(dict.dict) - repeat + s // underflows to negative
load32(dict.dict, candidate)             // OOB via unsafe.Pointer

load32 calls le.Load32 which uses unsafe.Pointer arithmetic without bounds checking:

func Load32[I Indexer](b []byte, i I) uint32 {
    return *(*uint32)(unsafe.Add(unsafe.Pointer(unsafe.SliceData(b)), i))
}

This causes a segmentation fault (SIGSEGV) when the negative index is dereferenced.

PoC

package main

import (
    "encoding/binary"
    "fmt"
    "github.com/klauspost/compress/s2"
)

func main() {
    var dictData []byte
    buf := make([]byte, binary.MaxVarintLen64)
    n := binary.PutUvarint(buf, 12687765596934209639) // > MaxInt64
    dictData = append(dictData, buf[:n]...)
    dictData = append(dictData, make([]byte, 16)...) // minimum dict size

    dict := s2.NewDict(dictData)
    // dict is non-nil despite invalid repeat value (overflow bypassed validation)

    src := make([]byte, 64)
    for i := range src { src[i] = byte(i) }
    dict.Encode(nil, src) // SIGSEGV: OOB access via unsafe.Pointer
}

Impact

  • Denial of Service: The process crashes immediately with SIGSEGV

Attack Vector

Any application that:

  1. Accepts user-supplied S2 dictionary data via s2.NewDict()
  2. Calls Dict.Encode() on any data ≥32 bytes

Suggested Fix

Validate the uvarint value before converting to int:

if r > math.MaxInt64 {
    return nil
}
d.repeat = int(r)

Or use uint for the repeat field and validate against uint(len(dict)).

References

  • Source: s2/dict.go lines 59-61 (vulnerability), s2/encode_all.go line 947 (crash site)
  • Commit: 539243b (v1.18.6 + 4 commits)

Credits

Christopher Linke / https://github.com/celinke97/


Compress/s2: Integer Overflow or Wraparound and Out-of-bounds Write in compress

CVE-2026-63209 / GHSA-259r-337f-4rfw / GO-2026-5841

More information

Details

Signed Integer Overflow in s2.NewDict
Summary

A signed integer overflow vulnerability in s2.NewDict() allows an attacker to bypass repeat index validation by supplying a dictionary with a uvarint-encoded repeat value exceeding MaxInt64. When Dict.Encode() is subsequently called, the overflowed negative repeat value causes an out-of-bounds memory access via unsafe.Pointer arithmetic, crashing the process with SIGSEGV.

Package
  • Name: github.com/klauspost/compress/s2
  • Ecosystem: Go
  • Affected versions: <= v1.18.6 (all versions with NewDict function)
Severity

High (7.5) — CVSS v3.1: AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Vulnerability
Type
  • CWE-190: Integer Overflow or Wraparound
  • CWE-787: Out-of-bounds Write (via unsafe.Pointer)
Description

The NewDict() function reads a uvarint from dictionary data and converts it to int:

r, n := binary.Uvarint(dict)
// ...
d.repeat = int(r)
if d.repeat > len(dict) {
    return nil
}

When r exceeds MaxInt64 (9223372036854775807), int(r) overflows to a negative value. Since a negative number is never greater than a positive length, the validation check is bypassed.

When Dict.Encode() is called, the negative repeat value causes an integer overflow in encodeBlockDictGo():

repeat := len(dict.dict) - dict.repeat  // overflows: 62 - (-5758978476775341977) = huge positive
candidate := len(dict.dict) - repeat + s // underflows to negative
load32(dict.dict, candidate)             // OOB via unsafe.Pointer

load32 calls le.Load32 which uses unsafe.Pointer arithmetic without bounds checking:

func Load32[I Indexer](b []byte, i I) uint32 {
    return *(*uint32)(unsafe.Add(unsafe.Pointer(unsafe.SliceData(b)), i))
}

This causes a segmentation fault (SIGSEGV) when the negative index is dereferenced.

PoC
package main

import (
    "encoding/binary"
    "fmt"
    "github.com/klauspost/compress/s2"
)

func main() {
    var dictData []byte
    buf := make([]byte, binary.MaxVarintLen64)
    n := binary.PutUvarint(buf, 12687765596934209639) // > MaxInt64
    dictData = append(dictData, buf[:n]...)
    dictData = append(dictData, make([]byte, 16)...) // minimum dict size

    dict := s2.NewDict(dictData)
    // dict is non-nil despite invalid repeat value (overflow bypassed validation)

    src := make([]byte, 64)
    for i := range src { src[i] = byte(i) }
    dict.Encode(nil, src) // SIGSEGV: OOB access via unsafe.Pointer
}
Impact
  • Denial of Service: The process crashes immediately with SIGSEGV
Attack Vector

Any application that:

  1. Accepts user-supplied S2 dictionary data via s2.NewDict()
  2. Calls Dict.Encode() on any data ≥32 bytes
Suggested Fix

Validate the uvarint value before converting to int:

if r > math.MaxInt64 {
    return nil
}
d.repeat = int(r)

Or use uint for the repeat field and validate against uint(len(dict)).

References
  • Source: s2/dict.go lines 59-61 (vulnerability), s2/encode_all.go line 947 (crash site)
  • Commit: 539243b (v1.18.6 + 4 commits)
Credits

Christopher Linke / https://github.com/celinke97/

Severity

  • CVSS Score: 7.5 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References

This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).


OOB read in github.com/klauspost/compress/s2

CVE-2026-63209 / GHSA-259r-337f-4rfw / GO-2026-5841

More information

Details

Providing a specially crafted dictionary to s2.NewDict and using it to encode data can make the encoder read out of bounds.

Severity

Unknown

References

This data is provided by OSV and the Go Vulnerability Database (CC-BY 4.0).


Panic on two-block frames in github.com/klauspost/compress

CVE-2026-116591 / GHSA-fpmh-frq8-7rj8 / GO-2026-6865

More information

Details

Panic on two-block frames in github.com/klauspost/compress

Severity

Unknown

References

This data is provided by OSV and the Go Vulnerability Database (CC-BY 4.0).


Release Notes

klauspost/compress (github.com/klauspost/compress)

v1.20.2

Compare Source

Full Changelog: klauspost/compress@v1.20.1...v1.20.2

v1.20.1

Compare Source

What's Changed
New Contributors

Full Changelog: klauspost/compress@v1.20.0...v1.20.1

v1.20.0

Compare Source

What's Changed
New Contributors

Full Changelog: klauspost/compress@v1.19.2...v1.20.0

v1.19.2

Compare Source

What's Changed
New Contributors

Full Changelog: klauspost/compress@v1.19.1...v1.19.2

v1.19.1

Compare Source

What's Changed
New Contributors

Full Changelog: klauspost/compress@v1.19.0...v1.19.1

v1.19.0

Compare Source

What's Changed
New Contributors

Full Changelog: klauspost/compress@v1.18.6...v1.19.0

v1.18.7

Compare Source

  • Fix s2.NewDict OOB read.

Security release without other changes.

Full Changelog: klauspost/compress@v1.18.6...v1.18.7

v1.18.6

Compare Source

What's Changed
New Contributors

Full Changelog: klauspost/compress@v1.18.5...v1.18.6


Configuration

📅 Schedule: Branch creation - "" in timezone UTC, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@deckhouse-BOaTswain deckhouse-BOaTswain added dependencies Pull requests that update a dependency file renovate security labels Jul 27, 2026
@deckhouse-BOaTswain deckhouse-BOaTswain changed the title chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] - autoclosed Aug 12, 2026
@deckhouse-BOaTswain
deckhouse-BOaTswain deleted the renovate/go-github.com-klauspost-compress-vulnerability branch August 12, 2026 18:00
@deckhouse-BOaTswain deckhouse-BOaTswain changed the title chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] - autoclosed chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] Aug 12, 2026
@deckhouse-BOaTswain
deckhouse-BOaTswain force-pushed the renovate/go-github.com-klauspost-compress-vulnerability branch 2 times, most recently from 66c425a to cd7f7bc Compare August 12, 2026 22:48
@deckhouse-BOaTswain deckhouse-BOaTswain changed the title chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] - autoclosed Sep 17, 2026
@deckhouse-BOaTswain deckhouse-BOaTswain changed the title chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] - autoclosed chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] Sep 17, 2026
@deckhouse-BOaTswain
deckhouse-BOaTswain force-pushed the renovate/go-github.com-klauspost-compress-vulnerability branch 3 times, most recently from 7c470b3 to 9cc942e Compare September 19, 2026 03:44
@deckhouse-BOaTswain deckhouse-BOaTswain changed the title chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] - autoclosed Sep 21, 2026
@deckhouse-BOaTswain deckhouse-BOaTswain changed the title chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] - autoclosed chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] Sep 21, 2026
@deckhouse-BOaTswain
deckhouse-BOaTswain force-pushed the renovate/go-github.com-klauspost-compress-vulnerability branch from 9cc942e to b69cbff Compare September 21, 2026 16:30
@deckhouse-BOaTswain
deckhouse-BOaTswain force-pushed the renovate/go-github.com-klauspost-compress-vulnerability branch from b69cbff to c78aef6 Compare September 30, 2026 13:08
@deckhouse-BOaTswain deckhouse-BOaTswain changed the title chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] - autoclosed Oct 3, 2026
@deckhouse-BOaTswain deckhouse-BOaTswain changed the title chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] - autoclosed chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] Oct 3, 2026
@deckhouse-BOaTswain
deckhouse-BOaTswain force-pushed the renovate/go-github.com-klauspost-compress-vulnerability branch from c78aef6 to 35ed289 Compare October 3, 2026 15:28
@deckhouse-BOaTswain
deckhouse-BOaTswain force-pushed the renovate/go-github.com-klauspost-compress-vulnerability branch from 35ed289 to d7c0ee7 Compare October 16, 2026 14:09
@deckhouse-BOaTswain deckhouse-BOaTswain changed the title chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] - autoclosed Oct 19, 2026
@deckhouse-BOaTswain deckhouse-BOaTswain changed the title chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] - autoclosed chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] Oct 19, 2026
@deckhouse-BOaTswain
deckhouse-BOaTswain force-pushed the renovate/go-github.com-klauspost-compress-vulnerability branch from d7c0ee7 to 78b562c Compare October 19, 2026 01:12
@deckhouse-BOaTswain
deckhouse-BOaTswain force-pushed the renovate/go-github.com-klauspost-compress-vulnerability branch from 78b562c to 55bdf44 Compare November 6, 2026 00:37
@deckhouse-BOaTswain deckhouse-BOaTswain changed the title chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] chore(deps): update module github.com/klauspost/compress to v1.20.2 [security] Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file renovate security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants