GHSA-6q9v-4hq6-5m67: Doctrine/orm SQL Injection Vulnerability

CRITICAL
Published
Advisory Summary

GHSA-6q9v-4hq6-5m67 is a CRITICAL sql injection vulnerability (General Security Weakness) affecting Doctrine/orm libraries in the Packagist ecosystem. The issue involves doctrine sql injection vulnerability. Remediation is available by upgrading affected packages to version 2.0.3, 1.2.4.

GHSA-6q9v-4hq6-5m67 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-6q9v-4hq6-5m67
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Doctrine/orm
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix GHSA-6q9v-4hq6-5m67

To remediate this vulnerability, upgrade all affected Doctrine/orm dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

doctrine/orm fixed: 2.0.3
Upgrade doctrine/orm to 2.0.3
doctrine/orm fixed: 1.2.4
Upgrade doctrine/orm to 1.2.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for doctrine/orm

How to Check if You Are Affected

To determine whether your application is affected by GHSA-6q9v-4hq6-5m67, inspect your project dependencies for Doctrine/orm:

inspect dependencies for doctrine/orm

Analyze the terminal output to locate any version of Doctrine/orm in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.3), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Doctrine/orm, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Doctrine is prone to SQL injection vulnerability. Users of Doctrine 1.2 and 2 should update to the newly released versions of both libraries immediately. Both versions only include the security fix and no other changes to their previous versions 1.2.3 and 2.0.2. Affected versions are: - 1.2.3 and earlier for PostgreSQL and DB2 Dialects - 2.0.2 and earlier The security issue was found to affect the `Doctrine\DBAL\Platforms\AbstractPlatform::modifyLimitQuery()` function which does not cast input values for limit and offset to integer and allows malicious SQL to be executed if these parameters are passed into Doctrine 2 directly from request variables without previous cast to integer. Functionality building on top using limit queries in the ORM such as `Doctrine\ORM\Query::setFirstResult()` and `Doctrine\ORM\Query::setMaxResults()` are also affected by this security issue. The fix for this security issue breaks backwards compatibility for developers that extend the `Doctrine\DBAL\Platforms\AbstractPlatform::modifyLimitQuery()` method, because it is now marked as final. Please overwrite the `Doctrine\DBAL\Platforms\AbstractPlatform::doModifyLimitQuery()` method instead.

GHSA-6q9v-4hq6-5m67 Affected Doctrine/orm Versions

2 component(s)
Fixed Versions:
2.0.31.2.4
Product / Package Ecosystem Affected Versions Fixed Version
doctrine/orm
Packagist
≥ 2.0.0
< 2.0.3
2.0.3
doctrine/orm
Packagist
≥ 1.0.0
< 1.2.4
1.2.4

References

Frequently Asked Questions

What is GHSA-6q9v-4hq6-5m67?
GHSA-6q9v-4hq6-5m67 is a security vulnerability in Doctrine/orm involving Doctrine SQL injection vulnerability under General Security Weakness.
Which Doctrine/orm versions are affected?
Affected versions include releases prior to 2.0.3, 1.2.4 across affected packages: doctrine/orm.
What version fixes GHSA-6q9v-4hq6-5m67?
Upgrading to 2.0.3, 1.2.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is doctrine/orm affected?
Yes, doctrine/orm is affected in releases prior to 2.0.3, 1.2.4. Upgrade your dependency to 2.0.3, 1.2.4 or later.
What CWE is associated with GHSA-6q9v-4hq6-5m67?
GHSA-6q9v-4hq6-5m67 is classified under General Security Weakness.
How can I check Packagist dependencies for GHSA-6q9v-4hq6-5m67?
Run the dependency tree command: 'inspect dependencies for doctrine/orm'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6q9v-4hq6-5m67",
  "modified" : "2024-05-15T20:14:15Z",
  "published" : "2024-05-15T20:14:15Z",
  "aliases" : [ ],
  "summary" : "Doctrine SQL injection vulnerability",
  "details" : "Doctrine is prone to SQL injection vulnerability. Users of Doctrine 1.2 and 2 should update to the newly released versions of both libraries immediately. Both versions only include the security fix and no other changes to their previous versions 1.2.3 and 2.0.2.\n\nAffected versions are:\n- 1.2.3 and earlier for PostgreSQL and DB2 Dialects\n- 2.0.2 and earlier\n\nThe security issue was found to affect the `Doctrine\\DBAL\\Platforms\\AbstractPlatform::modifyLimitQuery()` function which does not cast input values for limit and offset to integer and allows malicious SQL to be executed if these parameters are passed into Doctrine 2 directly from request variables without previous cast to integer. Functionality building on top using limit queries in the ORM such as `Doctrine\\ORM\\Query::setFirstResult()` and `Doctrine\\ORM\\Query::setMaxResults()` are also affected by this security issue.\n\nThe fix for this security issue breaks backwards compatibility for developers that extend the `Doctrine\\DBAL\\Platforms\\AbstractPlatform::modifyLimitQuery()` method, because it is now marked as final. Please overwrite the `Doctrine\\DBAL\\Platforms\\AbstractPlatform::doModifyLimitQuery()` method instead.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "doctrine/orm"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.0.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "doctrine/orm"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0"
      }, {
        "fixed" : "1.2.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/doctrine/orm/2011-09-25.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/doctrine/orm"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20120315064147/https://www.doctrine-project.org/blog/doctrine-security-fix.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-15T20:14:15Z",
    "nvd_published_at" : null
  }
}