GHSA-m9p2-fxp5-v3fp: Diesel: Command injection in Diesel's implementation of `COPY FROM`/`COPY TO`
Diesel allows users to configure various options for PostgreSQL's COPY FROM and COPY TO statements. These configurations are partially provided as strings or characters. Diesel did not check if any these user-provided options contain a quote character ', which can lead to the injection of additional options in the current COPY FROM/COPY TO statement.
Published May 19, 2026
Affected packages
diesel
- Ecosystem
- Rust (crates.io)
- Affected
- < 2.3.8
- Fixed in
- 2.3.8
- Check
cargo tree -i diesel
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Diesel allows users to configure various options for PostgreSQL's COPY FROM and COPY TO statements. These configurations are partially provided as strings or characters.
Diesel did not check if any these user-provided options contain a quote character ', which can lead to the injection of additional options in the current COPY FROM/COPY TO statement.
This vulnerability affects any user of COPY FROM/COPY TO that passes user-provided input to any of the affected functions. It can result in modifications of options in the current statement, but it is not possible inject additional statements.
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 correctly escapes any quotes contained in the provided arguments.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Rust (crates.io) vulnerabilities
All Rust (crates.io) entriesGHSA-ggxf-9f6j-w742
Diesel has possible use after free when deserializing a SQLite database via `SqliteConnection::deserialize_readonly_database`
medium6.9Jul 16, 2026GHSA-q8x8-jrhj-fh9p
Diesel: Possible unaligned data access for implementations of `SqliteAggregate`
medium6.3May 19, 2026GHSA-h5x4-m2qf-r4f2
Diesel's SQLite backend has possible UTF-8 corruption
high8.7May 5, 2026GHSA-wq9x-qwcq-mmgf
Diesel vulnerable to Binary Protocol Misinterpretation caused by Truncating or Overflowing Casts
high8.1Aug 23, 2024
