Skip to content

Add advisory for stack_collections - #3246

Merged
LawnGnome merged 3 commits into
rustsec:mainfrom
OverwrittenCode:add-stack-collections-advisory
Sep 22, 2026
Merged

LawnGnome merged 3 commits into
rustsec:mainfrom
OverwrittenCode:add-stack-collections-advisory

Conversation

@OverwrittenCode

Copy link
Copy Markdown
Contributor

Affected crate(s)

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

Severity

StackVec::retain committed its new length only after its internal loop
completed. If the retain predicate or a removed element's Drop panicked
before the loop finished, unwinding proceeded with the vector's length
still equal to the original length, leaving either a duplicated or an
already-destroyed element inside 0..len. StackVec's own Drop then
revisited that slot, causing a double-drop - and for any T owning a
heap allocation or other resource, a double-free.

Requires T: Drop with a predicate or destructor capable of panicking,
on builds with unwinding enabled (panic = "unwind"); not exploitable
under panic = "abort".

I am the maintainer of stack_collections; this advisory is self-filed
following the fix merged in the linked PR.

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

@LawnGnome LawnGnome left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@LawnGnome
LawnGnome merged commit 9ff7053 into rustsec:main Sep 22, 2026
1 check passed
@OverwrittenCode
OverwrittenCode deleted the add-stack-collections-advisory branch September 22, 2026 21:00
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