{"id":"GHSA-cx7h-h87r-jpgr","revision":"c8d4420482294249b5e0e9f564ad498f","records":[{"revision":"c8d4420482294249b5e0e9f564ad498f","observedAt":"2026-10-24T13:19:54.901+00:00","statement":{"source":"osv","id":"GHSA-cx7h-h87r-jpgr","aliases":["RUSTSEC-2024-0359"],"title":"The kstring integration in gix-attributes is unsound","description":"`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","state":0,"publishedAt":"2024-07-25T16:38:42+00:00","modifiedAt":"2026-09-10T03:50:16.5805557+00:00","affected":[{"ecosystem":"crates.io","name":"gix-attributes","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"0.22.3"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"Publisher rating","vector":null,"score":null,"severity":"LOW"}],"references":["https://github.com/Byron/gitoxide/issues/1460","https://github.com/GitoxideLabs/gitoxide/issues/1460","https://github.com/rustsec/advisory-db/commit/884aaa1646132bc3a27ba058197d6ef039bec294","https://github.com/Byron/gitoxide","https://rustsec.org/advisories/RUSTSEC-2024-0359.html"],"sourceUrl":"https://github.com/advisories/GHSA-cx7h-h87r-jpgr","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-cx7h-h87r-jpgr","identifiers":["GHSA-cx7h-h87r-jpgr","RUSTSEC-2024-0359"]},"retained":false,"historicalAffected":[]}],"coverage":[]}