Skip to content
Fencer Intel
medium —

GHSA-q8x8-jrhj-fh9p json

Diesel: Possible unaligned data access for implementations of `SqliteAggregate`

published 6mo ago modified 5mo ago also RUSTSEC-2026-0137

cvss
—
not scored
cisa kev
Not listed
not in CISA's catalog
epss
—
no score, EPSS covers CVEs only
public exploits
0
none known

Summary

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.

Patch / fix

  • crates.io diesel 2.3.8

Is GHSA-q8x8-jrhj-fh9p in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.

Check with Fencer

Affected packages

ecosystem package affected fixed in
crates.io diesel
<2.3.8
>=0.0.0-0, <2.3.8
2.3.8

Classification

Weakness
  • CWE-188 Reliance on Data/Memory Layout

References

Sources

Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.