VDB
Sign up
MEDIUM

GHSA-9pwq-gcrx-wghh

Buffa has a Use-After-Free in OwnedView via Unsound 'static Lifetime Promotion in Deref

Details

A soundness bug in `buffa`'s `OwnedView<V>` allowed safe Rust code to trigger a use-after-free. The `OwnedView::decode` constructor transmuted a borrowed slice to `&'static [u8]`, and the `Deref` implementation exposed the promoted `'static` lifetime on borrowed view fields (such as `&'static str` and `&'static [u8]`) to callers. Because these references appeared to be `'static`, the borrow checker permitted them to outlive the `OwnedView`; once the `OwnedView` was dropped and its backing buffer freed, those references became dangling, enabling memory corruption, information disclosure of freed heap contents, and cross-thread misuse — all without any `unsafe` code in the calling application. Users are advised to update to the latest patched version of buffa.

Thank you to hackerone.com/suul for reporting this issue.

Are you affected?

Enter the version of the package you're using.

Affected packages

crates.io/buffa
Introduced in: 0Fixed in: 0.7.0

Upgrade buffa to 0.7.0 or newer (ecosystem crates.io).

References