Email me

Rust advisories / gix-attributes

Unsound LowRUSTSEC-2024-0359 · gix-attributes

RUSTSEC-2024-0359: The kstring integration in gix-attributes is unsound

Short answergix-attributes has an API that can cause undefined behaviour from safe code: The kstring integration in gix-attributes is unsound. Fixed in 0.22.3.

Crategix-attributes
TypeUnsound
Affected versionsBefore 0.22.3.
Fixed in0.22.3
SeverityLow (GitHub rating)
Published2024-07-24
Last changed2025-01-19
Also known asGHSA-cx7h-h87r-jpgr

What to do

  1. See which version you have: cargo tree -i gix-attributes (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p gix-attributes. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example gix-attributes = "0.22.3") or update the dependency that pulls it in.
  3. Check again with cargo audit, or paste your Cargo.lock into our Cargo.toml checker.

Details from the advisory

gix-attributes (in state::ValueRef) 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:

// SAFETY: our API makes accessing that value as `str` impossible, so illformed UTF8 is never exposed as such.

The 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.

This is not sound, and it could cause further UB down the line in these places that can view the &str.

*Thanks to Devin Jeanpierre for discovering and reporting this issue.*

References

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 →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ