# CVE-2021-28305: RUSTSEC-2021-0037 - Fix a use-after-free bug in diesels Sqlite backend

Source: https://junglewise.ai/threats/cve-2021-28305-fix-a-use-after-free-bug-in-diesels-sqlite-backend  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2021-03-05  
License: CC BY 4.0 with a link back

CVE-2021-28305 · Severity: low · CVSS 3.1 · Published 2021-03-05

Fix a use-after-free bug in diesels Sqlite backend

Technologies: [diesel (crates.io)](https://junglewise.ai/threats/technologies/diesel). Vendors: [crates.io](https://junglewise.ai/threats/vendors/crates-io).

## Quick answers

**Is CVE-2021-28305 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2021-28305 being exploited in the wild.

**How severe is CVE-2021-28305?** Low severity, with a CVSS score of 3.1, published 5 March 2021.

**Which products and versions are affected?** diesel (crates.io) SEMVER:introduced=0,fixed=1.4.6, SEMVER:introduced=0.0.0-0,fixed=1.4.6.

**Is there a fix for CVE-2021-28305?** Yes. diesel (crates.io): upgrade to 1.4.6 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2021-28305?** Check whether you run diesel (crates.io) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- diesel (crates.io): upgrade to 1.4.6 or later

  ```sh
  cargo update -p diesel
  ```


## Affected products

- diesel (crates.io) SEMVER:introduced=0,fixed=1.4.6, SEMVER:introduced=0.0.0-0,fixed=1.4.6

## Identifiers

- CVE-2021-28305
- GHSA-j8q9-5rp9-4mv9
- RUSTSEC-2021-0037

## Related threats

- [Diesel use after free in SqliteConnection deserialize_readonly_database](https://junglewise.ai/threats/diesel-use-after-free-in-sqliteconnection-deserialize-readonly-database-dadf7b98)
- [RUSTSEC-2026-0172 - Possible use after free when deserializing a SQLite database via…](https://junglewise.ai/threats/rustsec-2026-0172-possible-use-after-free-when-deserializing-a-sqlite-3bbb802d)
- [Diesel argument injection in PostgreSQL COPY FROM and COPY TO](https://junglewise.ai/threats/diesel-argument-injection-in-postgresql-copy-from-and-copy-to-1fd3966b)
- [Diesel unaligned data access in SqliteAggregate](https://junglewise.ai/threats/diesel-unaligned-data-access-in-sqliteaggregate-27fb382f)
- [Diesel SQLite backend UTF-8 corruption in deserialization](https://junglewise.ai/threats/diesel-sqlite-backend-utf-8-corruption-in-deserialization-42824b77)
