Skip to content

object: unbounded allocation in Zstd-compressed section decompression - #3096

Open
scadastrangelove wants to merge 2 commits into
rustsec:mainfrom
scadastrangelove:object-zstd-decompress-dos
Open

object: unbounded allocation in Zstd-compressed section decompression#3096
scadastrangelove wants to merge 2 commits into
rustsec:mainfrom
scadastrangelove:object-zstd-decompress-dos

Conversation

@scadastrangelove

@scadastrangelove scadastrangelove commented Aug 1, 2026

Copy link
Copy Markdown

Affected crate(s)

  • object

Links to upstream issue(s) or PR(s)

Severity

Denial of service / resource exhaustion. A crafted ELF file with a small
compressed-section size but a Zstandard stream that expands much larger can
cause excessive allocation through Section::uncompressed_data() when the
compression feature is enabled.

Affected versions: >= 0.31.0, < 0.40.0. Zstandard support was added in
0.31.0; the issue was fixed in 0.40.0.

Checklist

  • Advisory filename(s) starts with RUSTSEC-0000-0000 as the ID
  • date field is set to the public disclosure date
  • Contains a concise and descriptive title after advisory metadata
  • Asked maintainer(s) if publishing an advisory is appropriate

Adds advisory for gimli-rs/object#950, fixed in 0.40.0 via PR rustsec#961.
Zstandard branch of CompressedData::decompress ignored the declared
size cap, allowing unbounded allocation from crafted ELF sections.
Affected versions >= 0.31.0 (when Zstd support was added).
@djc

djc commented Aug 1, 2026

Copy link
Copy Markdown
Member

You didn't use the PR template... did you get approval from the maintainer(s) to submit an advisory?

@scadastrangelove

scadastrangelove commented Aug 1, 2026

Copy link
Copy Markdown
Author

Thanks, you are right — I missed the PR template. I have updated the PR body to match it and pushed a follow-up commit that makes the advisory front matter follow the README template more closely.

On maintainer approval: the issue was reported publicly upstream and fixed by the maintainer in gimli-rs/object#961, but I have not separately asked whether they want a RustSec advisory published.

@djc

djc commented Aug 1, 2026

Copy link
Copy Markdown
Member

On maintainer approval: the issue was reported publicly upstream and fixed by the maintainer in gimli-rs/object#961, but I have not separately asked whether they want a RustSec advisory published.

Please do.

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