Skip to content

Comments

fix(minidump): Enforce max_attachment_size during decompression#5613

Merged
jjbayer merged 6 commits intomasterfrom
fix/minidump-decompression-size-limit
Feb 24, 2026
Merged

fix(minidump): Enforce max_attachment_size during decompression#5613
jjbayer merged 6 commits intomasterfrom
fix/minidump-decompression-size-limit

Conversation

@jjbayer
Copy link
Member

@jjbayer jjbayer commented Feb 4, 2026

When a minidump comes with Content-Encoding, we stop decompressing when we hit the size limit. However, if a multipart field contains a compressed minidump, we decompress the full item and only remove it later in check_envelope_size_limits. This causes unnecessary memory usage.


// With a limit smaller than the decompressed size, decoding should fail with Overflow
let result = decode_minidump(compressed, 50);
assert!(matches!(result, Err(BadStoreRequest::Overflow(_))));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assertion fails without the new logic.

jjbayer and others added 3 commits February 24, 2026 10:05
Stop decoding compressed minidumps when the decompressed size exceeds
max_attachment_size, preventing decompression bombs from exhausting memory.
This applies the same limit that Content-Encoding decompression uses.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jjbayer jjbayer marked this pull request as ready for review February 24, 2026 09:07
@jjbayer jjbayer requested a review from a team as a code owner February 24, 2026 09:07
@jjbayer jjbayer force-pushed the fix/minidump-decompression-size-limit branch from 8458738 to 74458a4 Compare February 24, 2026 09:12
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@jjbayer jjbayer enabled auto-merge February 24, 2026 12:53
@jjbayer jjbayer added this pull request to the merge queue Feb 24, 2026
Merged via the queue into master with commit dd61057 Feb 24, 2026
29 checks passed
@jjbayer jjbayer deleted the fix/minidump-decompression-size-limit branch February 24, 2026 13:29
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.

2 participants