{"id":"RUSTSEC-2026-0138","aliases":["RUSTSEC-2026-0138"],"related":[],"kind":"vulnerability","state":"published","title":"Unsound access to padding bytes while serializing date/time values using the Mysql backend","summary":"Diesel-async uses the mysql-async crate for interacting with Mysql compatible databases. This library already provides access to deserialized data for date/time releated types. Diesel-async then translated these deserialized data back to their serialized binary representation to hook into diesels desearialization framework.\n\nWhile serializing these data/time values again Diesel-async relied on a cast between the `MysqlTime` `#[repr(C)]` struct (defined by Diesel) and a byte array. As this cast exposes padding bytes contained in this struct, this is undefined behaviour.\n\nThis vulnerability affects any user deserializing date/time values using the Mysql backend and diesel-async.\n\nThis affects any usage of the following functions with a `AsyncMysqlConnection` provided by diesel-async:\n\n* `diesel::serialize::FromSql<Timestamp, Mysql>`\n* `diesel::serialize::FromSql<Time, Mysql>`\n* `diesel::serialize::FromSql<Date, Mysql>`\n* `diesel::serialize::FromSql<DateTime, Mysql>`\n\n\n## Mitigation\n\nThe preferred mitigation to the outlined problem is to update to Diesel-async version 0.9.0 or newer, which includes fixes for the problem.\n\n## Resolution\n\nDiesel-async now just calls a safe serialization method provided by Diesel 2.3.9 and newer","summaryFormat":"markdown","summarySource":"rustsec","descriptions":[{"lang":"en","text":"Diesel-async uses the mysql-async crate for interacting with Mysql compatible databases. This library already provides access to deserialized data for date/time releated types. Diesel-async then translated these deserialized data back to their serialized binary representation to hook into diesels desearialization framework.\n\nWhile serializing these data/time values again Diesel-async relied on a cast between the `MysqlTime` `#[repr(C)]` struct (defined by Diesel) and a byte array. As this cast exposes padding bytes contained in this struct, this is undefined behaviour.\n\nThis vulnerability affects any user deserializing date/time values using the Mysql backend and diesel-async.\n\nThis affects any usage of the following functions with a `AsyncMysqlConnection` provided by diesel-async:\n\n* `diesel::serialize::FromSql<Timestamp, Mysql>`\n* `diesel::serialize::FromSql<Time, Mysql>`\n* `diesel::serialize::FromSql<Date, Mysql>`\n* `diesel::serialize::FromSql<DateTime, Mysql>`\n\n\n## Mitigation\n\nThe preferred mitigation to the outlined problem is to update to Diesel-async version 0.9.0 or newer, which includes fixes for the problem.\n\n## Resolution\n\nDiesel-async now just calls a safe serialization method provided by Diesel 2.3.9 and newer","format":"markdown","source":"rustsec"}],"published":"2026-04-30T12:00:00.000Z","modified":"2026-05-13T14:32:26.464Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.9.0"}],"ecosystem":"crates.io","package":"diesel-async","purl":"pkg:cargo/diesel-async","source":"rustsec"}],"references":[{"url":"https://crates.io/crates/diesel-async","tags":["package"],"sources":["rustsec"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0138.html","tags":["advisory"],"sources":["rustsec"]},{"url":"https://github.com/diesel-rs/diesel_async/security/advisories/GHSA-ff9q-rm55-q7qr","tags":["advisory"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0138","url":"https://rustsec.org/advisories/RUSTSEC-2026-0138.html","licence":"CC0-1.0","modified":"2026-05-13T14:32:26.464Z"}],"updatedAt":"2026-11-25T22:56:43.352Z"}