{"id":"CVE-2026-69240","aliases":["EUVD-2026-52429","GHSA-v8fg-2rw7-q452"],"status":"published","title":"Sequelize: SQL Injection (Oracle DB)","description":"Sequelize is a Node.js ORM tool. Prior to 6.37.4, SQL injection is possible with strings only if dialect is set to oracle. The escape function defined in sql-string.js does not escape quotes if the value starts with TO_TIMESTAMP or TO_DATE. In the Oracle dialect, when val is a string and starts with TO_TIMESTAMP or TO_DATE, escape returns val directly instead of replacing single quotes. An attacker can inject arbitrary SQL expressions through an application value that reaches this escape path. This issue is fixed in version 6.37.4.","severity":{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.0054,"percentile":0.45714,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-89"],"published":"2026-08-03T20:28:28Z","modified":"2026-10-28T02:31:06Z","fixes":[{"ecosystem":"npm","package":"sequelize","fixed_in":["6.37.4"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"sequelize","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.37.4"}]}]},{"source":"osv","ecosystem":"npm","package":"sequelize","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"6.37.4"}]}]}],"products":[{"vendor":"sequelize","product":"sequelize"}],"references":[{"url":"https://github.com/sequelize/sequelize/security/advisories/GHSA-v8fg-2rw7-q452","tags":["x_refsource_CONFIRM","exploit","advisory","web"]},{"url":"https://github.com/sequelize/sequelize/commit/5deadd2410ae9136a21fb652db206d27bb715f26","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/sequelize/sequelize/releases/tag/v6.37.4","tags":["x_refsource_MISC","web"]},{"url":"https://github.com/advisories/GHSA-v8fg-2rw7-q452"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/69xxx/CVE-2026-69240.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-69240","tags":["advisory"]},{"url":"https://github.com/sequelize/sequelize","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-69240","title":"Sequelize: SQL Injection (Oracle DB)","description":"Sequelize is a Node.js ORM tool. Prior to 6.37.4, SQL injection is possible with strings only if dialect is set to oracle. The escape function defined in sql-string.js does not escape quotes if the value starts with TO_TIMESTAMP or TO_DATE. In the Oracle dialect, when val is a string and starts with TO_TIMESTAMP or TO_DATE, escape returns val directly instead of replacing single quotes. An attacker can inject arbitrary SQL expressions through an application value that reaches this escape path. This issue is fixed in version 6.37.4.","status":"published","published":"2026-08-03T20:28:28.522Z","modified":"2026-08-04T14:12:28.199Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"cna"}],"cwes":["CWE-89"],"updated_at":"2026-11-02T13:50:16.178634Z"}],"euvd":[{"id":"EUVD-2026-52429","description":"Sequelize is a Node.js ORM tool. Prior to 6.37.4, SQL injection is possible with strings only if dialect is set to oracle. The escape function defined in sql-string.js does not escape quotes if the value starts with TO_TIMESTAMP or TO_DATE. In the Oracle dialect, when val is a string and starts with TO_TIMESTAMP or TO_DATE, escape returns val directly instead of replacing single quotes. An attacker can inject arbitrary SQL expressions through an application value that reaches this escape path. This issue is fixed in version 6.37.4.","status":"published","published":"2026-08-03T20:28:28Z","modified":"2026-08-04T14:12:28Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T18:02:23.332335Z"}],"ghsa":[{"id":"GHSA-v8fg-2rw7-q452","title":"Sequelize: SQL Injection (Oracle DB)","description":"### Summary\nSQL Injection is possible with strings only **if dialect is set to `oracle`**.\nThe vulnerability was confirmed on Sequelize v6.37.3.\n\n### Details\nThe `escape` function defined in `sql-string.js` does not escape quotes if the value starts with `TO_TIMESTAMP` or `TO_DATE`.\n\n```javascript\n  } else if (dialect === 'oracle' \u0026\u0026 typeof val === 'string') {\n    if (val.startsWith('TO_TIMESTAMP') || val.startsWith('TO_DATE')) {\n      return val;\n    }\n    val = val.replace(/'/g, \"''\");\n  }\n```\n\n### PoC\nSuppose the application has the following code:\n\n```javascript\n  var result = await models.Student.findOne({\n    where: {\n      firstName: req.query.firstName\n    }\n  });\n```\n\nAn attacker can inject arbitrary sql expressions.\n\n`http://host/path?firstName=TO_DATE('0','Y')||'' OR 1=1--`\n\nThe resulted SQL will be:\n\n```SQL\nSELECT ... WHERE \"Student\".\"firstName\" = TO_DATE('0','Y')||'' OR 1=1-- ORDER BY \"Student\".\"id\" OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY;\n```\n\n### Impact\nData theft and tampering.","status":"published","published":"2026-08-03T20:29:50Z","modified":"2026-08-03T20:29:52Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-89"],"updated_at":"2026-11-02T14:40:55.903445Z"}],"nvd":[{"id":"CVE-2026-69240","description":"Sequelize is a Node.js ORM tool. Prior to 6.37.4, SQL injection is possible with strings only if dialect is set to oracle. The escape function defined in sql-string.js does not escape quotes if the value starts with TO_TIMESTAMP or TO_DATE. In the Oracle dialect, when val is a string and starts with TO_TIMESTAMP or TO_DATE, escape returns val directly instead of replacing single quotes. An attacker can inject arbitrary SQL expressions through an application value that reaches this escape path. This issue is fixed in version 6.37.4.","status":"published","published":"2026-08-03T21:16:41.97Z","modified":"2026-09-10T20:36:14.34Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"secondary"}],"cwes":["CWE-89"],"updated_at":"2026-11-02T14:12:34.643497Z"}],"osv":[{"id":"CVE-2026-69240","title":"Sequelize: SQL Injection (Oracle DB)","description":"Sequelize is a Node.js ORM tool. Prior to 6.37.4, SQL injection is possible with strings only if dialect is set to oracle. The escape function defined in sql-string.js does not escape quotes if the value starts with TO_TIMESTAMP or TO_DATE. In the Oracle dialect, when val is a string and starts with TO_TIMESTAMP or TO_DATE, escape returns val directly instead of replacing single quotes. An attacker can inject arbitrary SQL expressions through an application value that reaches this escape path. This issue is fixed in version 6.37.4.","status":"published","published":"2026-08-03T20:28:28.522Z","modified":"2026-10-28T02:31:06.159018295Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-89"],"updated_at":"2026-11-02T15:45:15.164658Z"},{"id":"GHSA-v8fg-2rw7-q452","title":"Sequelize: SQL Injection (Oracle DB)","description":"### Summary\nSQL Injection is possible with strings only **if dialect is set to `oracle`**.\nThe vulnerability was confirmed on Sequelize v6.37.3.\n\n### Details\nThe `escape` function defined in `sql-string.js` does not escape quotes if the value starts with `TO_TIMESTAMP` or `TO_DATE`.\n\n```javascript\n  } else if (dialect === 'oracle' \u0026\u0026 typeof val === 'string') {\n    if (val.startsWith('TO_TIMESTAMP') || val.startsWith('TO_DATE')) {\n      return val;\n    }\n    val = val.replace(/'/g, \"''\");\n  }\n```\n\n### PoC\nSuppose the application has the following code:\n\n```javascript\n  var result = await models.Student.findOne({\n    where: {\n      firstName: req.query.firstName\n    }\n  });\n```\n\nAn attacker can inject arbitrary sql expressions.\n\n`http://host/path?firstName=TO_DATE('0','Y')||'' OR 1=1--`\n\nThe resulted SQL will be:\n\n```SQL\nSELECT ... WHERE \"Student\".\"firstName\" = TO_DATE('0','Y')||'' OR 1=1-- ORDER BY \"Student\".\"id\" OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY;\n```\n\n### Impact\nData theft and tampering.","status":"published","published":"2026-08-03T20:29:50Z","modified":"2026-08-03T20:56:43.986253Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-89"],"updated_at":"2026-11-02T15:46:56.981655Z"}]}}
