GHSA-c8v3-jhv9-4ppc Use-after-free when setting the locale
A use-after-free vulnerability in a Rust locale library allows attackers to cause crashes or execute arbitrary code via concurrent locale changes.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Not stated
- Victim action needed
- Not needed
- Fix
- Available
What is GHSA-c8v3-jhv9-4ppc?
GHSA-c8v3-jhv9-4ppc is an use after free vulnerability in rust-i18n-support, published on 19 Jan 2024.
Official description
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.
Which versions are affected by GHSA-c8v3-jhv9-4ppc?
3 open source packages ship an affected version, including rust-i18n-support.
| Package | Affected | Fixed in |
|---|---|---|
rust-i18n-support crates.io | From 3.0.0 | 3.0.1 |
rust-i18n-support crates.io | From 3.0.0 | 3.0.1 |
rust-i18n-support crates.io | From 3.0.0 | 3.0.1 |
How do I fix GHSA-c8v3-jhv9-4ppc?
Upgrade rust-i18n-support to 3.0.1 or later.
Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.
Is GHSA-c8v3-jhv9-4ppc being exploited?
There is no known exploitation of GHSA-c8v3-jhv9-4ppc in the wild and no public exploit code.
Sources
Also known as RUSTSEC-2024-0007.