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

- Severity: Critical 9.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.32%, higher than 71% of CVEs (2026-12-01)
- Published: 2021-03-05T12:00:00.000Z
- Modified: 2026-06-17T03:46:07.997Z
- Also known as: GHSA-j8q9-5rp9-4mv9, RUSTSEC-2021-0037
- Weaknesses: CWE-416
- Assigned by: mitre

## Description

An issue was discovered in the diesel crate before 1.4.6 for Rust. There is a use-after-free in the SQLite backend because the semantics of sqlite3_column_name are not followed.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- diesel (crates.io): before 1.4.6; from 0.0.0-0 before 1.4.6
- diesel diesel: before 1.4.6

## Every score

- GitHub: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- RustSec Advisory Database: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 7.5 High `AV:N/AC:L/Au:N/C:P/I:P/A:P`

## References

- <https://rustsec.org/advisories/RUSTSEC-2021-0037.html> (advisory, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-28305> (advisory)
- <https://github.com/diesel-rs/diesel/pull/2663> (web)
- <https://github.com/diesel-rs/diesel> (package)
- <https://crates.io/crates/diesel> (package)

## Sources

- CVE List: [CVE-2021-28305](https://www.cve.org/CVERecord?id=CVE-2021-28305), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-j8q9-5rp9-4mv9](https://github.com/advisories/GHSA-j8q9-5rp9-4mv9), CC-BY-4.0, modified 2023-11-08
- RustSec Advisory Database: [RUSTSEC-2021-0037](https://rustsec.org/advisories/RUSTSEC-2021-0037.html), CC0-1.0, modified 2023-11-08
- NVD: [CVE-2021-28305](https://nvd.nist.gov/vuln/detail/CVE-2021-28305), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-28305 · Whole record: https://cve.day/CVE-2021-28305.json · Rebuilt by cve.day 2026-11-25T22:58:00.272Z
