Vulnerability DatabaseGHSA-wrw7-89jp-8q8g

GHSA-wrw7-89jp-8q8g
Rust vulnerability analysis and mitigation

Overview

The vulnerability (GHSA-wrw7-89jp-8q8g) affects the glib Rust package versions 0.15.0 through 0.20.0, involving unsoundness in the Iterator and DoubleEndedIterator implementations for glib::VariantStrIter. The issue was discovered on March 30, 2024, and officially published on December 23, 2024. This moderate severity vulnerability stems from improper handling of immutable references in the VariantStrIter::impl_get function (GitHub Advisory, RustSec Advisory).

Technical details

The vulnerability centers on the VariantStrIter::impl_get function passing an immutable reference &p to a *mut libc::c_char pointer (initialized to NULL) as an argument to a C function that mutates the pointer in-place. This violates Rust's safety invariants, particularly when the code is compiled with optimizations. The issue went undetected because the wrapped C function (glib_sys::g_variant_get_child) is variadic, and the problematic pointer was passed as one of the variadic arguments, resulting in reduced type checking. The vulnerability has a CVSS v4 score of 6.9, indicating moderate severity (GitHub Advisory).

Impact

When compiled with optimizations (either in release mode or with opt-level of 2 or 3), the unsound writes through &p are disregarded by recent Rust compiler versions. This leads to violations of safety requirements in the std::ffi::CStr::from_ptr function, ultimately resulting in crashes due to NULL pointer dereferences. The issue affects multiple functions including next(), next_back(), nth(), nth_back(), and last() (RustSec Advisory).

Exploitability

The vulnerability requires no special privileges or user interaction to exploit, with a low attack complexity. It can be triggered through network access, though the impact is primarily limited to integrity issues without affecting confidentiality or availability (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in version 0.20.0 of the glib crate. The fix involves explicitly passing the out-argument pointer as &mut p instead of &p in the VariantStrIter::impl_get function. Users are advised to upgrade to version 0.20.0 or later to resolve this issue (GitHub Advisory, RustSec Advisory).

Additional resources


SourceThis report was generated using AI

Related Rust vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-5x78-73v4-xg6wHIGH8.7
  • Rust logoRust
  • postgres-protocol
NoYesAug 24, 2026
GHSA-fx4f-mhw4-qm7jMEDIUM6.9
  • Rust logoRust
  • vibeio-http
NoYesAug 24, 2026
GHSA-3gjw-f78c-vvpwMEDIUM6.9
  • Rust logoRust
  • tokio-postgres
NoYesAug 24, 2026
GHSA-rgqc-3x5p-6gwgMEDIUM6.9
  • Rust logoRust
  • postgres-protocol
NoYesAug 24, 2026
RUSTSEC-2026-0267NONEN/A
  • Rust logoRust
  • stable-vec
NoYesAug 24, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management