Advisory

RUSTSEC-2026-0134

Also known as: None

Summary

Unsound access to padding bytes while serializing date/time values using the Mysql backend

Details

Diesel relies on libmysqlclient for interacting with Mysql compatible databases. This library requires to provide date/time values according to the byte layout of their MYSQL_TIME type.

Diesel replicated this type as #[repr(C)] struct, populated all the fields of this struct and then casted this value to an array of bytes. As this cast exposes padding bytes contained in this struct, this is undefined behaviour.

This vulnerability affects any user serializing date/time values using the Mysql backend.

Mitigation

The preferred mitigation to the outlined problem is to update to Diesel version 2.3.8 or newer, which includes fixes for the problem.

Resolution

Diesel now manually serializes the relevant data without accessing the padding bytes.

Severity

Not rated by the source.

Dates

Published
2026-04-24 12:00 UTC
Modified
2026-05-13 14:30 UTC

Affected packages and fixes

diesel

crates.io · All systems

Affected

  • introduced 0.0.0-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: RustSec Advisory Database · CC0-1.0

Sources & licences