Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions crates/fragile/RUSTSEC-0000-0000.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
```toml
[advisory]
id = "RUSTSEC-0000-0000"
package = "fragile"
date = "2025-03-23"
url = "https://github.com/mitsuhiko/fragile/issues/34"
informational = "unsound"
categories = ["memory-corruption"]
keywords = ["fragile", "sticky"]

[versions]
patched = []
unaffected = []

[affected]
```

# Possible use after free when using `slab` feature of `fragile`.

When the `slab` feature of `fragile` is enable it allows for dropping values still referenced.
The following example is taken from https://github.com/mitsuhiko/fragile/issues/34 .

```rust
fn main() {
let dummy_sticky = thread::spawn(|| Sticky::new(())).join().unwrap();

let sticky_string = ManuallyDrop::new(Sticky::new(String::from("Hello World")));
stack_token!(t);

let hello: &str = sticky_string.get(t);

println!("now it exists: {hello}");
drop(dummy_sticky);
println!("now it's gone: {hello}");
}
```
```
now it exists: Hello World
now it's gone: -[L\�Jx
```

Recommended fix is to disable the `slab` feature or switch to another crate like [`send_wrapper`](https://crates.io/crates/send_wrapper).