GHSA-c8v3-jhv9-4ppc: Rust i18n support Use-after-free When Setting The Locale Vulnerability
MODERATEGHSA-c8v3-jhv9-4ppc is a MODERATE use-after-free when setting the locale vulnerability (CWE-416: Use After Free) affecting Rust i18n support libraries in the crates.io ecosystem. The issue involves use-after-free when setting the locale. Remediation is available by upgrading affected packages to version 3.0.1.
GHSA-c8v3-jhv9-4ppc at a Glance
How to Fix GHSA-c8v3-jhv9-4ppc
To remediate this vulnerability, upgrade all affected Rust i18n support dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade rust-i18n-support to 3.0.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for rust-i18n-support
How to Check if You Are Affected
To determine whether your application is affected by GHSA-c8v3-jhv9-4ppc, inspect your project dependencies for Rust i18n support:
inspect dependencies for rust-i18n-support
Analyze the terminal output to locate any version of Rust i18n support in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.0.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-416: Use After Free, where the product reuses or references memory after it has been freed. at some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer. In Rust i18n support, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-c8v3-jhv9-4ppc Affected Rust i18n support Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
rust-i18n-support
|
crates.io |
≥ 3.0.0
< 3.0.1
|
3.0.1
|
References
Frequently Asked Questions
What is GHSA-c8v3-jhv9-4ppc?
Which Rust i18n support versions are affected?
What version fixes GHSA-c8v3-jhv9-4ppc?
Is rust-i18n-support affected?
What CWE is associated with GHSA-c8v3-jhv9-4ppc?
How can I check crates.io dependencies for GHSA-c8v3-jhv9-4ppc?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-c8v3-jhv9-4ppc",
"modified" : "2024-01-23T20:10:48Z",
"published" : "2024-01-23T20:10:48Z",
"aliases" : [ ],
"summary" : "Use-after-free when setting the locale",
"details" : "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`.\n\nIf the locale is changed in one thread, another thread can have a stale -- possibly already freed -- reference to the stored string.\n",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "rust-i18n-support"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0"
}, {
"fixed" : "3.0.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/longbridgeapp/rust-i18n/issues/71"
}, {
"type" : "WEB",
"url" : "https://github.com/longbridgeapp/rust-i18n/commit/22e0609591a2c08930f52a0e6bc860f02a0e88c0"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/longbridgeapp/rust-i18n"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2024-0007.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-416" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-01-23T20:10:48Z",
"nvd_published_at" : null
}
}