{"id":"GHSA-m9p2-fxp5-v3fp","aliases":["RUSTSEC-2026-0136"],"status":"published","title":"Diesel: Command injection in Diesel's implementation of `COPY FROM`/`COPY TO`","description":"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":{"version":"4.0","score":6.9,"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","level":"medium","from":"ghsa"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-88"],"published":"2026-04-24T12:00:00Z","modified":"2026-05-20T07:26:23Z","fixes":[{"ecosystem":"crates.io","package":"diesel","fixed_in":["2.3.8"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"diesel","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.8"}]}]},{"source":"osv","ecosystem":"crates.io","package":"diesel","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.3.8"}]}]},{"source":"osv","ecosystem":"crates.io","package":"diesel","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"2.3.8"}]}]}],"references":[{"url":"https://github.com/diesel-rs/diesel/pull/5042","tags":["web"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0136.html","tags":["web","advisory"]},{"url":"https://github.com/advisories/GHSA-m9p2-fxp5-v3fp"},{"url":"https://github.com/diesel-rs/diesel","tags":["package"]},{"url":"https://crates.io/crates/diesel","tags":["package"]}],"sources":{"ghsa":[{"id":"GHSA-m9p2-fxp5-v3fp","title":"Diesel: Command injection in Diesel's implementation of `COPY FROM`/`COPY TO`","description":"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.","status":"published","published":"2026-05-19T19:42:00Z","modified":"2026-05-19T19:42:04Z","cvss":[{"version":"4.0","score":6.9,"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","level":"medium"}],"cwes":["CWE-88"],"updated_at":"2026-11-02T14:40:12.430932Z"}],"osv":[{"id":"GHSA-m9p2-fxp5-v3fp","title":"Diesel: Command injection in Diesel's implementation of `COPY FROM`/`COPY TO`","description":"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.","status":"published","published":"2026-05-19T19:42:00Z","modified":"2026-05-20T07:26:23.724197936Z","cvss":[{"version":"4.0","score":6.9,"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","level":"medium"}],"cwes":["CWE-88"],"updated_at":"2026-11-02T15:46:51.811331Z"},{"id":"RUSTSEC-2026-0136","title":"Command injection in Diesel's implementation of `COPY FROM`/`COPY TO`","description":"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.","status":"published","published":"2026-04-24T12:00:00Z","modified":"2026-05-20T07:15:03.898168978Z","updated_at":"2026-11-02T15:53:40.430679Z"}]}}
