Rust advisories / gettext-rs
UnsoundRUSTSEC-2026-0244 · gettext-rs
RUSTSEC-2026-0244: `setlocale` and `TextDomain::init` are unsound as they access environment with no synchronization
Short answergettext-rs has an API that can cause undefined behaviour from safe code: `setlocale` and `TextDomain::init` are unsound as they access environment with no synchronization. Fixed in 0.8.0.
| Crate | gettext-rs |
|---|---|
| Type | Unsound (memory-corruption, thread-safety) |
| Affected versions | Before 0.8.0. |
| Fixed in | 0.8.0 |
| Severity | not scored |
| Published | 2026-08-06 |
| Last changed | 2026-08-09 |
| Also known as | none |
| Affected functions | gettext_rs::TextDomain::init, gettext_rs::setlocale |
What to do
- See which version you have:
cargo tree -i gettext-rs(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p gettext-rs. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplegettext-rs = "0.8.0") 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
setlocale and TextDomain::init are unsound and may allow safe code to exhibit undefined behavior when called in a multi-threaded program.
The flaw is fixed in 0.8.0 by marking these functions unsafe and documenting the conditions under which they can be called safely.
References
- Package: crates.io/crates/gettext-rs
- Advisory: rustsec.org/advisories/RUSTSEC-2026-0244.html
- Report: github.com/gettext-rs/gettext-rs/issues/64
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?