Diesel SQLite backend UTF-8 corruption in deserialization

Severity: high · CVSS 8.7 · Published 2026-05-05

Diesel, a popular database tool for the Rust programming language, contains a flaw in how it handles data from SQLite databases. If a database contains specifically formatted invalid data, it can cause the application to process information incorrectly, potentially leading to data corruption or application instability. Developers using Diesel with SQLite should update to the latest version to ensure their applications remain reliable and secure.

Technologies: diesel (crates.io). Vendors: crates.io.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
High severity, with a CVSS score of 8.7, published 5 May 2026.
Which products and versions are affected?
diesel (crates.io) < 2.3.8.
Is there a fix for This vulnerability?
A patch was published on 2026-05-05: Fixed in version 2.3.8 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is This vulnerability attacked?
It is attacked over the network, in a software library.
Am I affected?
Check whether you run diesel (crates.io) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

Diesel's SQLite backend incorrectly assumed that the `sqlite3_value_text` function always returns valid UTF-8 encoded strings. Based on this assumption, the library used `str::from_utf8_unchecked` to construct Rust string slices. However, if an underlying SQLite column contains `BLOB` data with arbitrary bytes, this unchecked conversion violates Rust's safety contract that all `str` types must be valid UTF-8. An attacker who can influence the data stored in the SQLite database could trigger undefined behavior or memory corruption. The issue is fixed in version 2.3.8 by implementing proper UTF-8 validation.

Affected products

  • diesel-rs diesel < 2.3.8

Timeline

  • 2026-05-05: disclosed
  • 2026-05-05: advisory
  • 2026-05-05: patched: Fixed in version 2.3.8

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.