RustSec logo

HistoryEditJSON (OSV)

RUSTSEC-2026-0294

Unsoundness in UTF-8 'String' trait

Reported
Issued
Package
iceoryx2-bb-container (crates.io)
Type
INFO Unsound
Keywords
#unsound
Aliases
References
Patched
  • ^0.10.0
Affected Functions
Version
iceoryx2_bb_container::string::String::as_mut_bytes
  • <0.10.0
iceoryx2_bb_container::string::String::deref_mut
  • <0.10.0
iceoryx2_bb_container::string::polymorphic_string::PolymorphicString::as_mut_bytes
  • <0.10.0
iceoryx2_bb_container::string::polymorphic_string::PolymorphicString::deref_mut
  • <0.10.0
iceoryx2_bb_container::string::relocatable_string::RelocatableString::as_mut_bytes
  • <0.10.0
iceoryx2_bb_container::string::relocatable_string::RelocatableString::deref_mut
  • <0.10.0
iceoryx2_bb_container::string::static_string::StaticString::as_mut_bytes
  • <0.10.0
iceoryx2_bb_container::string::static_string::StaticString::deref_mut
  • <0.10.0

Description

The String API in iceoryx2-bb-container exposes its contents as mutable bytes through safe APIs, while String::as_str() converts those bytes into a Rust string slice without validating UTF-8. An application can therefore create an invalid &str and trigger undefined behavior using entirely safe Rust.

The API methods as_mut_bytes and deref_mut where removed from the String API and their implementations (PolymorphicString, RelocatableString, and StaticString ) without replacement. Link to Pull-Request: https://github.com/eclipse-iceoryx/iceoryx2/pull/1956

Advisory available under CC0-1.0 license.