GHSA-q8x8-jrhj-fh9p: Diesel: Possible unaligned data access for implementations of `SqliteAggregate`
Diesel allows to register custom aggregate SQL functions for SQLite via the SqliteAggregate interface. To store an instance of the custom aggregate processor Diesel relied on the sqlite3aggregatecontext function provided by sqlite. This function doesn't provide any guarantees about alignment of the returned allocation, which in turn can lead to problems if the type implementing requires a special alignment, e.g.
Published May 19, 2026
Affected packages
diesel
- Ecosystem
- Rust (crates.io)
- Affected
- < 2.3.8
- Fixed in
- 2.3.8
- Check
cargo tree -i diesel
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Diesel allows to register custom aggregate SQL functions for SQLite via the SqliteAggregate interface.
To store an instance of the custom aggregate processor Diesel relied on the sqlite3_aggregate_context function provided by sqlite. This function doesn't provide any guarantees about alignment of the returned allocation, which in turn can lead to problems if the type implementing requires a special alignment, e.g. via a custom #[align(x)] attribute on the type implementing this trait. This affects any user of SqliteAggregate that registers the custom aggregate function with an SQLite connection, while using a non-standard alignment on the type implementing this trait.
Mitigation
The preferred mitigation to the outlined problem is to update to a Diesel version 2.3.8 or newer, which includes fixes for the problem.
Resolution
Diesel now allocates the corresponding memory on Rust side to get a correctly aligned allocation.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Rust (crates.io) vulnerabilities
All Rust (crates.io) entriesGHSA-ggxf-9f6j-w742
Diesel has possible use after free when deserializing a SQLite database via `SqliteConnection::deserialize_readonly_database`
medium6.9Jul 16, 2026GHSA-m9p2-fxp5-v3fp
Diesel: Command injection in Diesel's implementation of `COPY FROM`/`COPY TO`
medium6.9May 19, 2026GHSA-h5x4-m2qf-r4f2
Diesel's SQLite backend has possible UTF-8 corruption
high8.7May 5, 2026GHSA-wq9x-qwcq-mmgf
Diesel vulnerable to Binary Protocol Misinterpretation caused by Truncating or Overflowing Casts
high8.1Aug 23, 2024
