GHSA-m9p2-fxp5-v3fp
JSON

medium

Diesel: Command injection in Diesel's implementation of `COPY FROM`/`COPY TO`

Severity
medium CVSS:4.0 by GitHub
Published
Last changed
Also known as
RUSTSEC-2026-0136

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.

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.

Affected

Product or packageVersionsReported by
diesel (crates.io)before 2.3.8, from 0.0.0-0 before 2.3.8GitHub Advisory Database, RustSec Advisory Database

Classification

References

Sources

SourceRecordLicence
GitHub Advisory DatabaseGHSA-m9p2-fxp5-v3fp changed 2026-05-20CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2026-0136 changed 2026-05-20CC0-1.0