GHSA-m9p2-fxp5-v3fp json
Diesel: Command injection in Diesel's implementation of `COPY FROM`/`COPY TO`
published 6mo ago modified 5mo ago also RUSTSEC-2026-0136
- cvss
- —
- not scored
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- —
- no score, EPSS covers CVEs only
- public exploits
- 0
- none known
Summary
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.
Patch / fix
Is GHSA-m9p2-fxp5-v3fp in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerAffected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| crates.io | diesel | <2.3.8 >=0.0.0-0, <2.3.8 |
2.3.8 |
Classification
- Weakness
-
- CWE-88 Improper Neutralization of Argument Delimiters in a Command
References
-
github.com
/diesel-rs/diesel/pull/5042
web
-
github.com
/diesel-rs/diesel
package
-
rustsec.org
/advisories/RUSTSEC-2026-0136.html
web, advisory
-
crates.io
/crates/diesel
package
Sources
- GitHub Advisory GHSA-m9p2-fxp5-v3fp
- OSV RUSTSEC-2026-0136
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.