GHSA-q8x8-jrhj-fh9p

Suggest an improvement
Source
https://github.com/advisories/GHSA-q8x8-jrhj-fh9p
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-q8x8-jrhj-fh9p/GHSA-q8x8-jrhj-fh9p.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-q8x8-jrhj-fh9p
Aliases
Published
2026-05-19T19:39:37Z
Modified
2026-05-20T07:26:23Z
Severity
  • 6.3 (Medium) CVSS_V4 - CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N CVSS Calculator
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.

Database specific
{
    "cwe_ids":  [
        "CWE-188"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-05-19T19:39:37Z",
    "nvd_published_at":  null,
    "severity":  "MODERATE"
}
References

Affected packages

crates.io / diesel

Package

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
2.3.8

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-q8x8-jrhj-fh9p/GHSA-q8x8-jrhj-fh9p.json"