GHSA-cx7h-h87r-jpgr: Gix attributes The Kstring Integration Vulnerability
LOWGHSA-cx7h-h87r-jpgr is a LOW the kstring integration vulnerability (CWE-172: Encoding Error) affecting Gix attributes libraries in the crates.io ecosystem. The issue involves the kstring integration in gix-attributes is unsound. Remediation is available by upgrading affected packages to version 0.22.3.
GHSA-cx7h-h87r-jpgr at a Glance
How to Fix GHSA-cx7h-h87r-jpgr
To remediate this vulnerability, upgrade all affected Gix attributes 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 gix-attributes to 0.22.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for gix-attributes
How to Check if You Are Affected
To determine whether your application is affected by GHSA-cx7h-h87r-jpgr, inspect your project dependencies for Gix attributes:
inspect dependencies for gix-attributes
Analyze the terminal output to locate any version of Gix attributes in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.22.3), 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-172: Encoding Error, where the product does not properly encode or decode the data, resulting in unexpected values. In Gix attributes, 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-cx7h-h87r-jpgr Affected Gix attributes Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
gix-attributes
|
crates.io |
< 0.22.3
|
0.22.3
|
References
Frequently Asked Questions
What is GHSA-cx7h-h87r-jpgr?
Which Gix attributes versions are affected?
What version fixes GHSA-cx7h-h87r-jpgr?
Is gix-attributes affected?
What CWE is associated with GHSA-cx7h-h87r-jpgr?
How can I check crates.io dependencies for GHSA-cx7h-h87r-jpgr?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cx7h-h87r-jpgr",
"modified" : "2025-01-21T18:18:40Z",
"published" : "2024-07-25T16:38:42Z",
"aliases" : [ ],
"summary" : "The kstring integration in gix-attributes is unsound",
"details" : "`gix-attributes` (in [`state::ValueRef`](https://github.com/Byron/gitoxide/blob/gix-attributes-v0.22.2/gix-attributes/src/state.rs#L19-L27)) unsafely creates a `&str` from a `&[u8]` containing non-UTF8 data, with the justification that so long as nothing reads the `&str` and relies on it being UTF-8 in the `&str`, there is no UB:\n\n```rust\n// SAFETY: our API makes accessing that value as `str` impossible, so illformed UTF8 is never exposed as such.\n```\n\nThe problem is that the non-UTF8 `str` **is** exposed to outside code: first to the `kstring` crate itself, which requires UTF-8 in its documentation and may have UB as a consequence of this, but also to `serde`, where it propagates to e.g. `serde_json`, `serde_yaml`, etc., where the same problems occur.\n\nThis is not sound, and it could cause further UB down the line in these places that can view the `&str`.\n",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "gix-attributes"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.22.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Byron/gitoxide/issues/1460"
}, {
"type" : "WEB",
"url" : "https://github.com/GitoxideLabs/gitoxide/issues/1460"
}, {
"type" : "WEB",
"url" : "https://github.com/rustsec/advisory-db/commit/884aaa1646132bc3a27ba058197d6ef039bec294"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Byron/gitoxide"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2024-0359.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-172" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2024-07-25T16:38:42Z",
"nvd_published_at" : null
}
}