{
  "affected": [
    {
      "ranges": [
        {
          "database_specific": {
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "0"
                  },
                  {
                    "fixed": "3.25.0"
                  }
                ],
                "source": "AFFECTED_FIELD",
                "strategy": "StandardRange"
              },
              {
                "range": [
                  {
                    "fixed": "ef0dfa494a4fd30d82fa8ce5af3d2e46049d85ea"
                  }
                ],
                "source": "REFERENCES_COMMIT"
              },
              {
                "original_tag": "v3.25.0",
                "range": [
                  {
                    "fixed": "d0d85347a77ac19e4d26bc4f65f0ae1d58f3e390"
                  }
                ],
                "source": "REFERENCES_TAG"
              }
            ]
          },
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "d0d85347a77ac19e4d26bc4f65f0ae1d58f3e390"
            },
            {
              "fixed": "ef0dfa494a4fd30d82fa8ce5af3d2e46049d85ea"
            }
          ],
          "repo": "https://github.com/sidorares/node-mysql2",
          "type": "GIT"
        }
      ]
    }
  ],
  "aliases": [
    "GHSA-f763-mv98-7rv9"
  ],
  "database_specific": {
    "cna_assigner": "VulnCheck",
    "cwe_ids": [
      "CWE-89"
    ],
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/139xxx/CVE-2026-139877.json"
  },
  "details": "mysql2 before 3.25.0 contains an sql injection vulnerability in Connection.format() and Connection.escape() because quotes are always backslash-escaped regardless of session SQL mode. When NO_BACKSLASH_ESCAPES is enabled, attackers can pass crafted values through ? placeholders in connection.query() to close string literals and append SQL, disclosing or modifying data.",
  "id": "CVE-2026-139877",
  "modified": "2026-12-01T20:45:46.678542511Z",
  "published": "2026-11-30T16:20:44.034Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/139xxx/CVE-2026-139877.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/sidorares/node-mysql2/releases/tag/v3.25.0"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/sidorares/node-mysql2/security/advisories/GHSA-f763-mv98-7rv9"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-139877"
    },
    {
      "type": "ADVISORY",
      "url": "https://www.vulncheck.com/advisories/mysql2-before-3.25.0-sql-injection-via-placeholder-escaping-under-no-backslash-escapes"
    },
    {
      "type": "FIX",
      "url": "https://github.com/sidorares/node-mysql2/commit/ef0dfa494a4fd30d82fa8ce5af3d2e46049d85ea"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/sidorares/node-mysql2"
    },
    {
      "type": "ARTICLE",
      "url": "https://github.com/sidorares/node-mysql2/blob/v3.24.6/lib/base/connection.js#L648-L675"
    }
  ],
  "schema_version": "1.9.2",
  "severity": [
    {
      "score": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "mysql2 before 3.25.0 SQL Injection via Placeholder Escaping under NO_BACKSLASH_ESCAPES"
}