{"id":"GHSA-q8x8-jrhj-fh9p","aliases":["RUSTSEC-2026-0137"],"status":"published","title":"Diesel: Possible unaligned data access for implementations of `SqliteAggregate`","description":"Diesel allows to register custom aggregate SQL functions for SQLite via the `SqliteAggregate` interface.\n\nTo 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.\n\n## Mitigation\n\nThe preferred mitigation to the outlined problem is to update to a Diesel version 2.3.8 or newer, which includes fixes for the problem.\n\n## Resolution\n\nDiesel now allocates the corresponding memory on Rust side to get a correctly aligned allocation.","severity":{"version":"4.0","score":6.3,"vector":"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","level":"medium","from":"ghsa"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-188"],"published":"2026-04-24T12:00:00Z","modified":"2026-05-20T07:26:23Z","fixes":[{"ecosystem":"crates.io","package":"diesel","fixed_in":["2.3.8"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"diesel","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.8"}]}]},{"source":"osv","ecosystem":"crates.io","package":"diesel","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.3.8"}]}]},{"source":"osv","ecosystem":"crates.io","package":"diesel","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"2.3.8"}]}]}],"references":[{"url":"https://github.com/diesel-rs/diesel/pull/5042","tags":["web"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0137.html","tags":["web","advisory"]},{"url":"https://github.com/advisories/GHSA-q8x8-jrhj-fh9p"},{"url":"https://github.com/diesel-rs/diesel","tags":["package"]},{"url":"https://crates.io/crates/diesel","tags":["package"]}],"sources":{"ghsa":[{"id":"GHSA-q8x8-jrhj-fh9p","title":"Diesel: Possible unaligned data access for implementations of `SqliteAggregate`","description":"Diesel allows to register custom aggregate SQL functions for SQLite via the `SqliteAggregate` interface.\n\nTo 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.\n\n## Mitigation\n\nThe preferred mitigation to the outlined problem is to update to a Diesel version 2.3.8 or newer, which includes fixes for the problem.\n\n## Resolution\n\nDiesel now allocates the corresponding memory on Rust side to get a correctly aligned allocation.","status":"published","published":"2026-05-19T19:39:37Z","modified":"2026-05-19T19:39:39Z","cvss":[{"version":"4.0","score":6.3,"vector":"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","level":"medium"}],"cwes":["CWE-188"],"updated_at":"2026-11-02T14:40:12.430932Z"}],"osv":[{"id":"GHSA-q8x8-jrhj-fh9p","title":"Diesel: Possible unaligned data access for implementations of `SqliteAggregate`","description":"Diesel allows to register custom aggregate SQL functions for SQLite via the `SqliteAggregate` interface.\n\nTo 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.\n\n## Mitigation\n\nThe preferred mitigation to the outlined problem is to update to a Diesel version 2.3.8 or newer, which includes fixes for the problem.\n\n## Resolution\n\nDiesel now allocates the corresponding memory on Rust side to get a correctly aligned allocation.","status":"published","published":"2026-05-19T19:39:37Z","modified":"2026-05-20T07:26:23.800095769Z","cvss":[{"version":"4.0","score":6.3,"vector":"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","level":"medium"}],"cwes":["CWE-188"],"updated_at":"2026-11-02T15:46:54.40888Z"},{"id":"RUSTSEC-2026-0137","title":"Possible unaligned data access for implementations of `SqliteAggregate`","description":"Diesel allows to register custom aggregate SQL functions for SQLite via the `SqliteAggregate` interface.\n\nTo 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.\n\n## Mitigation\n\nThe preferred mitigation to the outlined problem is to update to a Diesel version 2.3.8 or newer, which includes fixes for the problem.\n\n## Resolution\n\nDiesel now allocates the corresponding memory on Rust side to get a correctly aligned allocation.","status":"published","published":"2026-04-24T12:00:00Z","modified":"2026-05-20T07:15:03.921524485Z","updated_at":"2026-11-02T15:53:40.430679Z"}]}}
