GHSA-m9p2-fxp5-v3fp
MEDIUMDiesel: 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.
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.
- Published
- 24 Apr 2026
- Last modified
- 20 May 2026
- Weakness
- CWE-88
- Also known as
- RUSTSEC-2026-0136
- Sources
- OSVJSONOSV RUSTSEC-2026-0136JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| OSV | GitHub | CVSS 4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | crates.io | diesel | < 2.3.8 | 2.3.8 |
| OSV | crates.io | diesel | >= 0.0.0-0, < 2.3.8 | 2.3.8 |
References
- https://github.com/diesel-rs/diesel/pull/5042 · WEB
- https://github.com/diesel-rs/diesel · PACKAGE
- https://rustsec.org/advisories/RUSTSEC-2026-0136.html · WEB, ADVISORY
- https://crates.io/crates/diesel · PACKAGE
History
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 24 Apr 2026)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 19 May 2026)