GHSA-q8x8-jrhj-fh9p Diesel: Possible unaligned data access for implementations of `SqliteAggregate`

Not scored Published

Unaligned memory access in Diesel's SQLite aggregate implementation can cause crashes or code execution when using custom aligned types.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Not stated
Victim action needed
Not needed
Fix
Available

What is GHSA-q8x8-jrhj-fh9p?

GHSA-q8x8-jrhj-fh9p is a memory corruption vulnerability in diesel, published on 24 Apr 2026.

Official description

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.

Which versions are affected by GHSA-q8x8-jrhj-fh9p?

3 open source packages ship an affected version, including diesel.

PackageAffectedFixed in
diesel crates.ioAll versions2.3.8
diesel crates.ioAll versions2.3.8
diesel crates.ioFrom 0.0.0-02.3.8

How do I fix GHSA-q8x8-jrhj-fh9p?

Upgrade diesel to 2.3.8 or later.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is GHSA-q8x8-jrhj-fh9p being exploited?

There is no known exploitation of GHSA-q8x8-jrhj-fh9p in the wild and no public exploit code.

Sources

Also known as RUSTSEC-2026-0137.

Is GHSA-q8x8-jrhj-fh9p in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free