GHSA-m9p2-fxp5-v3fp: Diesel Command Injection Vulnerability
MODERATEGHSA-m9p2-fxp5-v3fp is a MODERATE command injection vulnerability (CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')) affecting Diesel libraries in the crates.io ecosystem. The issue involves command injection in diesel's implementation of `copy from`/`copy to`. Remediation is available by upgrading affected packages to version 2.3.8.
GHSA-m9p2-fxp5-v3fp at a Glance
How to Fix GHSA-m9p2-fxp5-v3fp
To remediate this vulnerability, upgrade all affected Diesel dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade diesel to 2.3.8
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for diesel
How to Check if You Are Affected
To determine whether your application is affected by GHSA-m9p2-fxp5-v3fp, inspect your project dependencies for Diesel:
inspect dependencies for diesel
Analyze the terminal output to locate any version of Diesel in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.3.8), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection'), where the product constructs a string for a command to be executed by a separate component in another control sphere, but it does not properly delimit the intended arguments, options, or switches within that command string. In Diesel, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-m9p2-fxp5-v3fp Affected Diesel Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
diesel
|
crates.io |
< 2.3.8
|
2.3.8
|
References
Frequently Asked Questions
What is GHSA-m9p2-fxp5-v3fp?
Which Diesel versions are affected?
What version fixes GHSA-m9p2-fxp5-v3fp?
Is diesel affected?
What CWE is associated with GHSA-m9p2-fxp5-v3fp?
How can I check crates.io dependencies for GHSA-m9p2-fxp5-v3fp?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-m9p2-fxp5-v3fp",
"modified" : "2026-05-19T19:42:00Z",
"published" : "2026-05-19T19:42:00Z",
"aliases" : [ ],
"summary" : "Diesel: Command injection in Diesel's implementation of `COPY FROM`/`COPY TO`",
"details" : "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. \n\nDiesel 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. \n\nThis 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.\n\n## Mitigation\n\nThe preferred mitigation to the outlined problem is to update to Diesel version 2.3.8 or newer, which includes fixes for the problem.\n\n## Resolution\n\nDiesel now correctly escapes any quotes contained in the provided arguments.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "diesel"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.3.8"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/diesel-rs/diesel/pull/5042"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/diesel-rs/diesel"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2026-0136.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-88" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-19T19:42:00Z",
"nvd_published_at" : null
}
}