Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS1jeDdoLWg4N3ItanBncs4AA-Hz

The kstring integration in gix-attributes is unsound

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.

Permalink: https://github.com/advisories/GHSA-cx7h-h87r-jpgr
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1jeDdoLWg4N3ItanBncs4AA-Hz
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Low
Classification: General
Published: about 2 months ago
Updated: about 2 months ago


Identifiers: GHSA-cx7h-h87r-jpgr
References: Repository: https://github.com/Byron/gitoxide
Blast Radius: 0.0

Affected Packages

cargo:gix-attributes
Dependent packages: 7
Dependent repositories: 380
Downloads: 4,381,797 total
Affected Version Ranges: < 0.22.3
Fixed in: 0.22.3
All affected versions: 0.8.2, 0.8.3, 0.9.0, 0.10.0, 0.11.0, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.15.0, 0.16.0, 0.17.0, 0.18.0, 0.19.0, 0.20.0, 0.20.1, 0.21.0, 0.21.1, 0.22.0, 0.22.1, 0.22.2
All unaffected versions: 0.22.3, 0.22.4, 0.22.5