Skip to content

fix(sources): cap compressed and decompressed payload size to prevent OOM - #134

Open
harshvardhan-s1 wants to merge 5 commits into
masterfrom
cap_decompression_bombs_across_sources
Open

fix(sources): cap compressed and decompressed payload size to prevent OOM#134
harshvardhan-s1 wants to merge 5 commits into
masterfrom
cap_decompression_bombs_across_sources

Conversation

@harshvardhan-s1

@harshvardhan-s1 harshvardhan-s1 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Sources that decompress untrusted input fed client-controlled payloads into
unbounded read_to_end calls, letting a small upload drive an arbitrarily large
allocation and OOM-kill the daemon. Port upstream's CappedDecoder
(vectordotdev/vector#25819, commit 3162ed1a2e) into vector-common and apply it
at every affected call site.

The cap defaults to 100 MiB and is tunable with --max-decompressed-size-bytes /
VECTOR_MAX_DECOMPRESSED_SIZE_BYTES. Oversized payloads are rejected rather than
buffered. For zstd the decoder window is clamped as well, since a crafted frame
allocates its window before emitting any output and so escapes an output-size
cap entirely; under HTTP the clamp follows RFC 9659's 8 MB ceiling.

Tickets fixed:

  • OBE-11554
  • OBE-11237
  • OBE-11233
  • OBE-10708 — same call site as OBE-11233
  • OBE-10706
  • OBE-10711
  • OBE-10710
  • OBE-11557

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant