Skip to content

Add advisory for sized-chunks: panic-safety UAF/double-free in clear/drop_left/drop_right - #3111

Merged
djc merged 3 commits into
rustsec:mainfrom
tooson9010-spec:sized-chunks-panic-safety-advisory
Aug 12, 2026
Merged

Add advisory for sized-chunks: panic-safety UAF/double-free in clear/drop_left/drop_right#3111
djc merged 3 commits into
rustsec:mainfrom
tooson9010-spec:sized-chunks-panic-safety-advisory

Conversation

@tooson9010-spec

@tooson9010-spec tooson9010-spec commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Affected crate(s)

  • sized-chunks 0.7.0 (6,946,615 recent downloads per crates.io)

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

The repo is archived with issues/PRs disabled. I emailed the maintainer on 2026-04-22 with no response. Unmaintained status is tracked in #3058 / #3093.

Severity

Panic-safety unsoundness in Chunk, RingBuffer, and InlineArray (clear, drop_left, drop_right, InlineArray::clear). Elements are dropped before the length/boundary metadata is updated, so a panicking element Drop leaves stale metadata and the container's own Drop re-drops already-freed elements — use-after-free / double-free reachable from safe Rust, confirmed under AddressSanitizer. Distinct from RUSTSEC-2020-0041 (Chunk::clone / insert_from, fixed in 0.6.3); still affected in 0.7.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 (repo archived, issues disabled, emailed maintainer 2026-04-22 with no response — unreachable-author exception)

@djc

djc commented Aug 4, 2026

Copy link
Copy Markdown
Member

@tooson9010-spec

Copy link
Copy Markdown
Contributor Author

Thanks for the reply. I saw #3093 adds the unmaintained advisory for sized-chunks.

This PR (#3111) is the companion informational = "unsound" advisory you mentioned
wanting in #3058, so I think the two are complementary rather than overlapping:

Happy to adjust this to fit alongside #3093 however works best.
Please let me know how you'd like to proceed.

@tooson9010-spec

Copy link
Copy Markdown
Contributor Author

While doing research on panic-safety unsoundness, I found the same issue in
sp-sized-chunks (https://crates.io/crates/sp-sized-chunks), a fork of sized-chunks
by yatima-inc. It has the same bugs in Chunk::{clear, drop_left, drop_right} and
InlineArray::clear (confirmed under ASan); the repo is archived and it's still on
0.1.0 with no fix.

Since it's a separate crate under a different owner, would a separate unsound
advisory be the way to go? Thanks!

@djc

djc commented Aug 10, 2026

Copy link
Copy Markdown
Member

Yes, a separate advisory would be the way to go. Use the pull request template both for this advisory and for the other one.

Simplify sized-chunks advisory
@tooson9010-spec

Copy link
Copy Markdown
Contributor Author

Thanks. I've updated the PR description to follow the template. The separate advisory for sp-sized-chunks is filed in #3136.

Comment thread crates/sized-chunks/RUSTSEC-0000-0000.md Outdated
add affected.functions
@djc
djc merged commit e2d4c78 into rustsec:main Aug 12, 2026
1 check passed
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