rustsec-2026-0138
Vulnerability from osv_rustsec
Published
2026-04-30 12:00
Modified
2026-05-13 14:16
Summary
Unsound access to padding bytes while serializing date/time values using the Mysql backend
Details

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.

While 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.

This vulnerability affects any user deserializing date/time values using the Mysql backend and diesel-async.

This affects any usage of the following functions with a AsyncMysqlConnection provided by diesel-async:

  • diesel::serialize::FromSql<Timestamp, Mysql>
  • diesel::serialize::FromSql<Time, Mysql>
  • diesel::serialize::FromSql<Date, Mysql>
  • diesel::serialize::FromSql<DateTime, Mysql>

Mitigation

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

Resolution

Diesel-async now just calls a safe serialization method provided by Diesel 2.3.9 and newer


{
  "affected": [
    {
      "database_specific": {
        "categories": [],
        "cvss": null,
        "informational": "unsound"
      },
      "ecosystem_specific": {
        "affected_functions": null,
        "affects": {
          "arch": [],
          "functions": [],
          "os": []
        }
      },
      "package": {
        "ecosystem": "crates.io",
        "name": "diesel-async",
        "purl": "pkg:cargo/diesel-async"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.0.0-0"
            },
            {
              "fixed": "0.9.0"
            }
          ],
          "type": "SEMVER"
        }
      ],
      "versions": []
    }
  ],
  "aliases": [],
  "database_specific": {
    "license": "CC0-1.0"
  },
  "details": "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\u003cTimestamp, Mysql\u003e`\n* `diesel::serialize::FromSql\u003cTime, Mysql\u003e`\n* `diesel::serialize::FromSql\u003cDate, Mysql\u003e`\n* `diesel::serialize::FromSql\u003cDateTime, Mysql\u003e`\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",
  "id": "RUSTSEC-2026-0138",
  "modified": "2026-05-13T14:16:31Z",
  "published": "2026-04-30T12:00:00Z",
  "references": [
    {
      "type": "PACKAGE",
      "url": "https://crates.io/crates/diesel-async"
    },
    {
      "type": "ADVISORY",
      "url": "https://rustsec.org/advisories/RUSTSEC-2026-0138.html"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/diesel-rs/diesel_async/security/advisories/GHSA-ff9q-rm55-q7qr"
    }
  ],
  "related": [],
  "severity": [],
  "summary": "Unsound access to padding bytes while serializing date/time values using the Mysql backend"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…