← Back to CVE Explorer

CVE-2023-22794

Full vulnerability record from the local CVENow database.

Description

A vulnerability in ActiveRecord <6.0.6.1, v6.1.7.1 and v7.0.4.1 related to the sanitization of comments. If malicious user input is passed to either the `annotate` query method, the `optimizer_hints` query method, or through the QueryLogs interface which automatically adds annotations, it may be sent to the database withinsufficient sanitization and be able to inject SQL outside of the comment.

Severity
HIGH
CVSS score
8.8 (v3.1)
Vulnerability status
Modified
Source identifier
Published
2023-02-09 20:15:11.353000
Last modified
2026-10-23 23:10:00.157000
View original CVE JSON
{
  "id": "CVE-2023-22794",
  "sourceIdentifier": "[email protected]",
  "published": "2023-02-09T20:15:11.353",
  "lastModified": "2026-10-23T23:10:00.157",
  "vulnStatus": "Modified",
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "A vulnerability in ActiveRecord <6.0.6.1, v6.1.7.1 and v7.0.4.1 related to the sanitization of comments. If malicious user input is passed to either the `annotate` query method, the `optimizer_hints` query method, or through the QueryLogs interface which automatically adds annotations, it may be sent to the database withinsufficient sanitization and be able to inject SQL outside of the comment."
    },
    {
      "lang": "es",
      "value": "Una vulnerabilidad en ActiveRecord anterior a 6.0.6.1, v6.1.7.1 y v7.0.4.1 relacionada con la sanitización de comentarios. Si una entrada de usuario maliciosa se pasa al método de consulta annotate, al método de consulta optimizer_hints, o a través de la interfaz QueryLogs que añade anotaciones automáticamente, puede ser enviada a la base de datos con sanitización insuficiente y ser capaz de inyectar SQL fuera del comentario."
    }
  ],
  "affected": [
    {
      "source": "[email protected]",
      "affectedData": [
        {
          "vendor": "n/a",
          "product": "https://github.com/rails/rails",
          "versions": [
            {
              "version": "6.0.6.1, 6.1.7.1, 7.0.4.1",
              "status": "affected"
            }
          ]
        }
      ]
    }
  ],
  "metrics": {
    "cvssMetricV31": [
      {
        "source": "[email protected]",
        "type": "Primary",
        "cvssData": {
          "version": "3.1",
          "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
          "baseScore": 8.8,
          "baseSeverity": "HIGH",
          "attackVector": "NETWORK",
          "attackComplexity": "LOW",
          "privilegesRequired": "LOW",
          "userInteraction": "NONE",
          "scope": "UNCHANGED",
          "confidentialityImpact": "HIGH",
          "integrityImpact": "HIGH",
          "availabilityImpact": "HIGH"
        },
        "exploitabilityScore": 2.8,
        "impactScore": 5.9
      }
    ]
  },
  "weaknesses": [
    {
      "source": "[email protected]",
      "type": "Secondary",
      "description": [
        {
          "lang": "en",
          "value": "CWE-89"
        }
      ]
    },
    {
      "source": "[email protected]",
      "type": "Primary",
      "description": [
        {
          "lang": "en",
          "value": "CWE-89"
        }
      ]
    }
  ],
  "configurations": [
    {
      "nodes": [
        {
          "operator": "OR",
          "negate": false,
          "cpeMatch": [
            {
              "vulnerable": true,
              "criteria": "cpe:2.3:a:activerecord_project:activerecord:*:*:*:*:*:ruby:*:*",
              "versionStartIncluding": "6.0.0",
              "versionEndExcluding": "6.0.6.1",
              "matchCriteriaId": "3B0AF7DB-45EB-4310-8409-90350D1AFF02"
            },
            {
              "vulnerable": true,
              "criteria": "cpe:2.3:a:activerecord_project:activerecord:*:*:*:*:*:ruby:*:*",
              "versionStartIncluding": "6.1.0",
              "versionEndExcluding": "6.1.7.1",
              "matchCriteriaId": "0D94371F-6A6F-4D40-97A1-3B08C75E3AFB"
            },
            {
              "vulnerable": true,
              "criteria": "cpe:2.3:a:activerecord_project:activerecord:*:*:*:*:*:ruby:*:*",
              "versionStartIncluding": "7.0.0",
              "versionEndExcluding": "7.0.4.1",
              "matchCriteriaId": "EDE689E3-57CB-4121-9EE3-1857079325E6"
            }
          ]
        }
      ]
    }
  ],
  "references": [
    {
      "url": "https://discuss.rubyonrails.org/t/cve-2023-22794-sql-injection-vulnerability-via-activerecord-comments/82117",
      "source": "[email protected]",
      "tags": [
        "Exploit",
        "Patch",
        "Vendor Advisory"
      ]
    },
    {
      "url": "https://security.netapp.com/advisory/ntap-20240202-0008/",
      "source": "[email protected]"
    },
    {
      "url": "https://www.debian.org/security/2023/dsa-5372",
      "source": "[email protected]"
    },
    {
      "url": "https://discuss.rubyonrails.org/t/cve-2023-22794-sql-injection-vulnerability-via-activerecord-comments/82117",
      "source": "af854a3a-2127-422b-91ae-364da2661108",
      "tags": [
        "Exploit",
        "Patch",
        "Vendor Advisory"
      ]
    },
    {
      "url": "https://security.netapp.com/advisory/ntap-20240202-0008/",
      "source": "af854a3a-2127-422b-91ae-364da2661108"
    },
    {
      "url": "https://www.debian.org/security/2023/dsa-5372",
      "source": "af854a3a-2127-422b-91ae-364da2661108"
    }
  ]
}