VYPR
High severity7.5NVD Advisory· Published May 4, 2026· Updated May 11, 2026

CVE-2026-42154

CVE-2026-42154

Description

Prometheus is an open-source monitoring system and time series database. Prior to versions 3.5.3 and 3.11.3, the remote read endpoint (/api/v1/read) does not validate the declared decoded length in a snappy-compressed request body before allocating memory. An unauthenticated attacker can send a small payload that causes a huge heap allocation per request. Under concurrent load this can exhaust available memory and crash the Prometheus process. This issue has been patched in versions 3.5.3 and 3.11.3.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
github.com/prometheus/prometheusGo
< 0.311.30.311.3

Affected products

2
  • Prometheus/Prometheusreferences2 versions
    (expand)+ 1 more
    • (no CPE)
    • cpe:2.3:a:prometheus:prometheus:*:*:*:*:*:*:*:*range: <3.5.3

Patches

2
04055ee19081

Merge pull request #18584 from roidelapluie/roidelapluie/snappylength

https://github.com/prometheus/prometheusJulienApr 27, 2026via nvd-ref
2 files changed · +20 0
  • storage/remote/codec.go+8 0 modified
    @@ -67,6 +67,14 @@ func DecodeReadRequest(r *http.Request) (*prompb.ReadRequest, error) {
     		return nil, err
     	}
     
    +	decodedLen, err := snappy.DecodedLen(compressed)
    +	if err != nil {
    +		return nil, err
    +	}
    +	if decodedLen > decodeReadLimit {
    +		return nil, fmt.Errorf("snappy: decoded length %d exceeds limit %d", decodedLen, decodeReadLimit)
    +	}
    +
     	reqBuf, err := snappy.Decode(nil, compressed)
     	if err != nil {
     		return nil, err
    
  • storage/remote/codec_test.go+12 0 modified
    @@ -18,6 +18,7 @@ import (
     	"errors"
     	"fmt"
     	"io"
    +	"net/http"
     	"sync"
     	"testing"
     
    @@ -729,6 +730,17 @@ func TestMergeLabels(t *testing.T) {
     	}
     }
     
    +func TestDecodeReadRequestTooLarge(t *testing.T) {
    +	// 5-byte snappy stream whose header claims 256 MiB decoded length,
    +	// well above decodeReadLimit (32 MiB).
    +	bomb := []byte{0x80, 0x80, 0x80, 0x80, 0x01}
    +	req, err := http.NewRequest(http.MethodPost, "/", bytes.NewReader(bomb))
    +	require.NoError(t, err)
    +
    +	_, err = DecodeReadRequest(req)
    +	require.ErrorContains(t, err, "exceeds limit")
    +}
    +
     func TestDecodeWriteRequest(t *testing.T) {
     	buf, _, _, err := buildWriteRequest(nil, writeRequestFixture.Timeseries, nil, nil, nil, nil, "snappy")
     	require.NoError(t, err)
    
3ac006347ae9

Merge pull request #18585 from roidelapluie/roidelapluie/snappylength-lts

https://github.com/prometheus/prometheusJulienApr 27, 2026via nvd-ref
2 files changed · +20 0
  • storage/remote/codec.go+8 0 modified
    @@ -67,6 +67,14 @@ func DecodeReadRequest(r *http.Request) (*prompb.ReadRequest, error) {
     		return nil, err
     	}
     
    +	decodedLen, err := snappy.DecodedLen(compressed)
    +	if err != nil {
    +		return nil, err
    +	}
    +	if decodedLen > decodeReadLimit {
    +		return nil, fmt.Errorf("snappy: decoded length %d exceeds limit %d", decodedLen, decodeReadLimit)
    +	}
    +
     	reqBuf, err := snappy.Decode(nil, compressed)
     	if err != nil {
     		return nil, err
    
  • storage/remote/codec_test.go+12 0 modified
    @@ -17,6 +17,7 @@ import (
     	"bytes"
     	"fmt"
     	"io"
    +	"net/http"
     	"sync"
     	"testing"
     
    @@ -616,6 +617,17 @@ func TestMergeLabels(t *testing.T) {
     	}
     }
     
    +func TestDecodeReadRequestTooLarge(t *testing.T) {
    +	// 5-byte snappy stream whose header claims 256 MiB decoded length,
    +	// well above decodeReadLimit (32 MiB).
    +	bomb := []byte{0x80, 0x80, 0x80, 0x80, 0x01}
    +	req, err := http.NewRequest(http.MethodPost, "/", bytes.NewReader(bomb))
    +	require.NoError(t, err)
    +
    +	_, err = DecodeReadRequest(req)
    +	require.ErrorContains(t, err, "exceeds limit")
    +}
    +
     func TestDecodeWriteRequest(t *testing.T) {
     	buf, _, _, err := buildWriteRequest(nil, writeRequestFixture.Timeseries, nil, nil, nil, nil, "snappy")
     	require.NoError(t, err)
    

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

7

News mentions

4