RUSTSEC-2026-0136

Source
https://rustsec.org/advisories/RUSTSEC-2026-0136
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0136.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2026-0136
Aliases
Published
2026-04-24T12:00:00Z
Modified
2026-05-20T07:15:03.898168978Z
Summary
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.

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.

Database specific
{
    "license": "CC0-1.0"
}
References

Affected packages

crates.io / diesel

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.0.0-0
Fixed
2.3.8

Ecosystem specific

{
    "affected_functions": null,
    "affects": {
        "arch": [],
        "functions": [
            "diesel::pg::CopyFromQuery::with_default",
            "diesel::pg::CopyFromQuery::with_delimiter",
            "diesel::pg::CopyFromQuery::with_escape",
            "diesel::pg::CopyFromQuery::with_null",
            "diesel::pg::CopyFromQuery::with_quote",
            "diesel::pg::CopyToQuery::with_delimiter",
            "diesel::pg::CopyToQuery::with_escape",
            "diesel::pg::CopyToQuery::with_null",
            "diesel::pg::CopyToQuery::with_quote"
        ],
        "os": []
    }
}

Database specific

categories
[
    "format-injection"
]
source
"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0136.json"
informational
null
cvss
null