Rust advisories / rust-i18n-support
Unsound MediumRUSTSEC-2024-0007 · rust-i18n-support
RUSTSEC-2024-0007: Use-after-free when setting the locale
Short answerrust-i18n-support has an API that can cause undefined behaviour from safe code: Use-after-free when setting the locale. Fixed in 3.0.1.
| Crate | rust-i18n-support |
|---|---|
| Type | Unsound (memory-exposure) |
| Affected versions | From 3.0.0 before 3.0.1. |
| Fixed in | 3.0.1 |
| Severity | Medium (GitHub rating) |
| Published | 2024-01-19 |
| Last changed | 2024-02-10 |
| Also known as | GHSA-c8v3-jhv9-4ppc |
| Affected functions | rust_i18n_support::AtomicStr::as_str |
What to do
- See which version you have:
cargo tree -i rust-i18n-support(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p rust-i18n-support. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplerust-i18n-support = "3.0.1") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
Version 3.0.0 introduced an AtomicStr type, that is used to store the current locale. It stores the locale as a raw pointer to an Arc<String>. The locale can be read with AtomicStr::as_str(). AtomicStr::as_str() does not increment the usage counter of the Arc.
If the locale is changed in one thread, another thread can have a stale -- possibly already freed -- reference to the stored string.
References
- Package: crates.io/crates/rust-i18n-support
- Advisory: rustsec.org/advisories/RUSTSEC-2024-0007.html
- Report: github.com/longbridgeapp/rust-i18n/issues/71
- Web: github.com/longbridgeapp/rust-i18n/pull/72
- Web: github.com/longbridgeapp/rust-i18n/releases/tag/v3.0.1
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 →Also worth your time
Did this answer your question?