HistoryEditJSON (OSV)

RUSTSEC-2025-0140

Non-utf8 String can be created with TimeBuf::as_str

Reported
Issued
Package
gix-date (crates.io)
Type
Vulnerability
Categories
Keywords
#utf8 #undefined-behavior
Aliases
References
Patched
  • >=0.12.0
Affected Functions
Version
gix_date::parse::TimeBuf::as_str
  • <=0.11.1

Description

The function gix_date::parse::TimeBuf::as_str can create an illegal string containing non-utf8 characters. This violates the safety invariant of TimeBuf and can lead to undefined behavior when consuming the string.

The bug can be prevented by adding str::from_utf8 to the function TimeBuf::write.

Advisory available under CC0-1.0 license.