{"id":"RUSTSEC-2026-0619","aliases":["RUSTSEC-2026-0619"],"related":[],"kind":"vulnerability","state":"published","title":"`Local` (`Rc`) backed strings and byte strings are `Send`, allowing data races","summary":"Affected versions of this crate implemented `Send` for `HipByt<B>` (and so for\n`HipStr<B>`, `HipOsStr<B>` and `HipPath<B>`), and for the internal shared\npointer, whenever the backend `B` is `Send`. The thread-local backend `Local`\n(the `Local*` type aliases) keeps its reference count in a `Cell<usize>`, which\nis `Send` but not `Sync`: such a value could be sent to another thread while a\nclone stayed behind, and cloning, dropping or checking uniqueness on both\nthreads then updates or reads the count without synchronization.\n\nThis is a data race (undefined behavior) reachable from safe code, for example:\n\n```rust\nlet mut a = hipstr::LocalHipByt::with_capacity(62);\nlet b = a.clone();\nstd::thread::scope(|s| {\n    s.spawn(move || {\n        a.as_mut_ptr();\n    });\n    drop(b);\n});\n```\n\nThe default, thread-safe types (`HipStr`, `HipByt`, … with the `ThreadSafe`\nbackend) are not affected. Versions before 0.5.0 are not affected either: their\n`Local` backend was std's `Rc`, which is not `Send`.\n\nThe flaw was corrected in 0.8.1 by requiring the backend to be `Sync` in these\n`Send` implementations, so that `Local` values are no longer `Send`. The\naffected versions (0.5.0 to 0.8.0) have been yanked; 0.5, 0.6 and 0.7 users\nshould upgrade to 0.8.1.","summaryFormat":"markdown","summarySource":"rustsec","descriptions":[{"lang":"en","text":"Affected versions of this crate implemented `Send` for `HipByt<B>` (and so for\n`HipStr<B>`, `HipOsStr<B>` and `HipPath<B>`), and for the internal shared\npointer, whenever the backend `B` is `Send`. The thread-local backend `Local`\n(the `Local*` type aliases) keeps its reference count in a `Cell<usize>`, which\nis `Send` but not `Sync`: such a value could be sent to another thread while a\nclone stayed behind, and cloning, dropping or checking uniqueness on both\nthreads then updates or reads the count without synchronization.\n\nThis is a data race (undefined behavior) reachable from safe code, for example:\n\n```rust\nlet mut a = hipstr::LocalHipByt::with_capacity(62);\nlet b = a.clone();\nstd::thread::scope(|s| {\n    s.spawn(move || {\n        a.as_mut_ptr();\n    });\n    drop(b);\n});\n```\n\nThe default, thread-safe types (`HipStr`, `HipByt`, … with the `ThreadSafe`\nbackend) are not affected. Versions before 0.5.0 are not affected either: their\n`Local` backend was std's `Rc`, which is not `Send`.\n\nThe flaw was corrected in 0.8.1 by requiring the backend to be `Sync` in these\n`Send` implementations, so that `Local` values are no longer `Send`. The\naffected versions (0.5.0 to 0.8.0) have been yanked; 0.5, 0.6 and 0.7 users\nshould upgrade to 0.8.1.","format":"markdown","source":"rustsec"}],"published":"2026-10-14T12:00:00.000Z","modified":"2026-11-29T16:45:02.213Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.5.0","status":"affected","fixed":"0.8.1"}],"ecosystem":"crates.io","package":"hipstr","purl":"pkg:cargo/hipstr","source":"rustsec"}],"references":[{"url":"https://crates.io/crates/hipstr","tags":["package"],"sources":["rustsec"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0619.html","tags":["advisory"],"sources":["rustsec"]},{"url":"https://github.com/polazarus/hipstr/pull/54","tags":["web"],"sources":["rustsec"]},{"url":"https://github.com/polazarus/hipstr/releases/tag/0.8.1","tags":["web"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0619","url":"https://rustsec.org/advisories/RUSTSEC-2026-0619.html","licence":"CC0-1.0","modified":"2026-11-29T16:45:02.213Z"}],"updatedAt":"2026-11-29T17:17:24.642Z"}