rustsec-2026-0136
Vulnerability from osv_rustsec
Published
2026-04-24 12:00
Modified
2026-05-13 14:16
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.


{
  "affected": [
    {
      "database_specific": {
        "categories": [
          "format-injection"
        ],
        "cvss": null,
        "informational": null
      },
      "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": []
        }
      },
      "package": {
        "ecosystem": "crates.io",
        "name": "diesel",
        "purl": "pkg:cargo/diesel"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.0.0-0"
            },
            {
              "fixed": "2.3.8"
            }
          ],
          "type": "SEMVER"
        }
      ],
      "versions": []
    }
  ],
  "aliases": [],
  "database_specific": {
    "license": "CC0-1.0"
  },
  "details": "Diesel allows users to configure various options for PostgreSQL\u0027s `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 `\u0027`, 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.",
  "id": "RUSTSEC-2026-0136",
  "modified": "2026-05-13T14:16:31Z",
  "published": "2026-04-24T12:00:00Z",
  "references": [
    {
      "type": "PACKAGE",
      "url": "https://crates.io/crates/diesel"
    },
    {
      "type": "ADVISORY",
      "url": "https://rustsec.org/advisories/RUSTSEC-2026-0136.html"
    },
    {
      "type": "WEB",
      "url": "https://github.com/diesel-rs/diesel/pull/5042"
    }
  ],
  "related": [],
  "severity": [],
  "summary": "Command injection in Diesel\u0027s implementation of `COPY FROM`/`COPY TO`"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…