Advisory

GHSA-q8x8-jrhj-fh9p

Also known as: RUSTSEC-2026-0137

Summary

Diesel: Possible unaligned data access for implementations of SqliteAggregate

Details

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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2026-05-19 19:39 UTC
Modified
2026-05-20 07:26 UTC

Affected packages and fixes

diesel

crates.io · All systems

Affected

  • introduced 0, fixed 2.3.8 (semver)

Fixed versions

2.3.8

Fix

  • Fixed version 2.3.8
    cargo update -p diesel --precise 2.3.8

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences