{"id":"GHSA-m9p2-fxp5-v3fp","aliases":["GHSA-m9p2-fxp5-v3fp","RUSTSEC-2026-0136"],"related":[],"kind":"vulnerability","state":"published","title":"Diesel: Command injection in Diesel's implementation of `COPY FROM`/`COPY TO`","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. \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.","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"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.","format":"markdown","source":"ghsa"}],"published":"2026-04-24T12:00:00.000Z","modified":"2026-05-20T07:26:23.724Z","severity":{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"}],"cwes":["CWE-88"],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.3.8"}],"ecosystem":"crates.io","package":"diesel","purl":"pkg:cargo/diesel","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"2.3.8"}],"ecosystem":"crates.io","package":"diesel","purl":"pkg:cargo/diesel","source":"rustsec"}],"references":[{"url":"https://github.com/diesel-rs/diesel/pull/5042","tags":["web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/diesel-rs/diesel","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0136.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/diesel","tags":["package"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-m9p2-fxp5-v3fp","url":"https://github.com/advisories/GHSA-m9p2-fxp5-v3fp","licence":"CC-BY-4.0","modified":"2026-05-20T07:26:23.724Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0136","url":"https://rustsec.org/advisories/RUSTSEC-2026-0136.html","licence":"CC0-1.0","modified":"2026-05-20T07:15:03.898Z"}],"updatedAt":"2026-11-25T22:56:43.352Z"}