Advisory

RUSTSEC-2026-0136

Also known as: GHSA-m9p2-fxp5-v3fp

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.

Severity

Not rated by the source.

Dates

Published
2026-04-24 12:00 UTC
Modified
2026-05-20 07:15 UTC

Affected packages and fixes

diesel

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 2.3.8 (semver)

Fixed versions

2.3.8

Fix

  • Fixed version 2.3.8
    cargo update -p diesel --precise 2.3.8

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences