Email me

Rust advisories / aligned_box

VulnerabilityRUSTSEC-2026-0282 · aligned_box

RUSTSEC-2026-0282: Double free in `AlignedBox<[T]>::realloc_with_default` when an element's `Drop` panics

Short answerA security vulnerability in the aligned_box crate: Double free in `AlignedBox<[T]>::realloc_with_default` when an element's `Drop` panics. No severity score was published. Fixed in 0.3.1: update to a fixed version.

Cratealigned_box
TypeVulnerability (memory-corruption)
Affected versionsBefore 0.3.1.
Fixed in0.3.1
Severitynot scored
Published2026-09-09
Last changed2026-09-09
Also known asnone
Affected functionsaligned_box::AlignedBox::realloc_with_default

What to do

  1. See which version you have: cargo tree -i aligned_box (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p aligned_box. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example aligned_box = "0.3.1") or update the dependency that pulls it in.
  3. Check again with cargo audit, or paste your Cargo.lock into our Cargo.toml checker.

Details from the advisory

Shrinking an AlignedBox<[T]> takes ownership of the buffer out of self.container with ManuallyDrop::take, destroys the elements past the new length, and only then commits the new Box back into self.container. ManuallyDrop::take moves ownership but not the bits, so until that commit self.container still points at the original buffer.

T::drop runs inside the destruction loop and is user code , T carries no bound that would exclude a panicking Drop. If it unwinds, the commit is skipped and self.container is left pointing at the buffer whose tail has already been destroyed. AlignedBox's own destructor then reconstructs a Box from that pointer, drops every element again and deallocates , a double free (CWE-415) / use-after-free (CWE-416) reachable from safe Rust.

Growing the slice destroys nothing and is unaffected, as is realloc_with_value, which requires T: Copy and therefore a Drop that cannot run.

Mitigation

Update to 0.3.1.

References

From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.

Up next

Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ