{"id":"CVE-2023-25813","aliases":["EUVD-2023-0814","GHSA-wrh9-cjv3-2hpw"],"status":"published","title":"SQL Injection via replacements in sequelize","description":"Sequelize is a Node.js ORM tool. In versions prior to 6.19.1 a SQL injection exploit exists related to replacements. Parameters which are passed through replacements are not properly escaped which can lead to arbitrary SQL injection depending on the specific queries in use. The issue has been fixed in Sequelize 6.19.1. Users are advised to upgrade. Users unable to upgrade should not use the `replacements` and the `where` option in the same query.","severity":{"version":"3.1","score":10,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","level":"critical","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.01444,"percentile":0.73437,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":true,"fix_available":true},"cwes":["CWE-89"],"published":"2023-02-22T18:14:44Z","modified":"2026-10-28T02:31:10Z","exploits":[{"source":"pocgithub","id":"bde574786/Sequelize-1day-CVE-2023-25813","title":"bde574786/Sequelize-1day-CVE-2023-25813","date":"2024-04-21","url":"https://github.com/bde574786/Sequelize-1day-CVE-2023-25813"},{"source":"pocgithub","id":"White-BAO/CVE-2023-25813","title":"White-BAO/CVE-2023-25813","date":"2024-07-30","url":"https://github.com/White-BAO/CVE-2023-25813"},{"source":"pocgithub","id":"pbj2647/CVE-2023-25813","title":"pbj2647/CVE-2023-25813","date":"2024-11-06","url":"https://github.com/pbj2647/CVE-2023-25813"},{"source":"pocgithub","id":"numbbvi/CVE-2023-25813","title":"numbbvi/CVE-2023-25813","date":"2024-11-07","url":"https://github.com/numbbvi/CVE-2023-25813"},{"source":"pocgithub","id":"sea-middle/cve-2023-25813","title":"sea-middle/cve-2023-25813","date":"2024-11-09","url":"https://github.com/sea-middle/cve-2023-25813"},{"source":"pocgithub","id":"h-gunp/CVE-2023-25813-TEST","title":"h-gunp/CVE-2023-25813-TEST","date":"2025-08-23","url":"https://github.com/h-gunp/CVE-2023-25813-TEST"}],"fixes":[{"ecosystem":"npm","package":"sequelize","fixed_in":["6.19.1"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"sequelize","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"6.19.1"}]}]},{"source":"osv","ecosystem":"npm","package":"sequelize","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"6.19.1"}]}]}],"products":[{"vendor":"sequelize","product":"sequelize"},{"vendor":"sequelizejs","product":"sequelize"}],"references":[{"url":"https://github.com/sequelize/sequelize/security/advisories/GHSA-wrh9-cjv3-2hpw","tags":["x_refsource_CONFIRM","x_transferred","Exploit","Vendor Advisory","advisory","web"]},{"url":"https://github.com/sequelize/sequelize/issues/14519","tags":["x_refsource_MISC","x_transferred","Exploit","Issue Tracking","report","web"]},{"url":"https://github.com/sequelize/sequelize/commit/ccaa3996047fe00048d5993ab2dd43ebadd4f78b","tags":["x_refsource_MISC","x_transferred","Patch","fix","web"]},{"url":"https://github.com/sequelize/sequelize/releases/tag/v6.19.1","tags":["x_refsource_MISC","x_transferred","Release Notes","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-25813","tags":["advisory"]},{"url":"https://security.snyk.io/vuln/SNYK-JS-SEQUELIZE-2932027","tags":["web"]},{"url":"https://github.com/advisories/GHSA-wrh9-cjv3-2hpw"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/25xxx/CVE-2023-25813.json","tags":["advisory"]},{"url":"https://github.com/sequelize/sequelize","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2023-25813","title":"SQL Injection via replacements in sequelize","description":"Sequelize is a Node.js ORM tool. In versions prior to 6.19.1 a SQL injection exploit exists related to replacements. Parameters which are passed through replacements are not properly escaped which can lead to arbitrary SQL injection depending on the specific queries in use. The issue has been fixed in Sequelize 6.19.1. Users are advised to upgrade. Users unable to upgrade should not use the `replacements` and the `where` option in the same query.","status":"published","published":"2023-02-22T18:14:44.579Z","modified":"2025-03-10T21:07:11.77Z","cvss":[{"version":"3.1","score":10,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","level":"critical","assessor":"cna"}],"cwes":["CWE-89"],"updated_at":"2026-11-02T14:35:19.559321Z"}],"euvd":[{"id":"EUVD-2023-0814","description":"Sequelize is a Node.js ORM tool. In versions prior to 6.19.1 a SQL injection exploit exists related to replacements. Parameters which are passed through replacements are not properly escaped which can lead to arbitrary SQL injection depending on the specific queries in use. The issue has been fixed in Sequelize 6.19.1. Users are advised to upgrade. Users unable to upgrade should not use the `replacements` and the `where` option in the same query.","status":"published","published":"2023-02-22T18:14:44Z","modified":"2025-03-10T21:07:11Z","cvss":[{"version":"3.1","score":10,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T20:53:09.197707Z"}],"ghsa":[{"id":"GHSA-wrh9-cjv3-2hpw","title":"Sequelize vulnerable to SQL Injection via replacements","description":"### Impact\n\nThe SQL injection exploit is related to replacements. Here is such an example: \n\nIn the following query, some parameters are passed through replacements, and some are passed directly through the `where` option.\n\n```typescript\nUser.findAll({\n  where: or(\n    literal('soundex(\"firstName\") = soundex(:firstName)'),\n    { lastName: lastName },\n  ),\n  replacements: { firstName },\n})\n```\n\nThis is a very legitimate use case, but this query was vulnerable to SQL injection due to how Sequelize processed the query: Sequelize built a first query using the `where` option, then passed it over to `sequelize.query` which parsed the resulting SQL to inject all `:replacements`.\n\nIf the user passed values such as\n\n```json\n{\n  \"firstName\": \"OR true; DROP TABLE users;\",\n  \"lastName\": \":firstName\"\n}\n```\n\nSequelize would first generate this query:\n\n```sql\nSELECT * FROM users WHERE soundex(\"firstName\") = soundex(:firstName) OR \"lastName\" = ':firstName'\n```\n\nThen would inject replacements in it, which resulted in this:\n\n```sql\nSELECT * FROM users WHERE soundex(\"firstName\") = soundex('OR true; DROP TABLE users;') OR \"lastName\" = ''OR true; DROP TABLE users;''\n```\n\nAs you can see this resulted in arbitrary user-provided SQL being executed.\n\n### Patches\n\nThe issue was fixed in Sequelize 6.19.1\n\n### Workarounds\n\nDo not use the `replacements` and the `where` option in the same query if you are not using Sequelize \u003e= 6.19.1 \n\n### References\n\nSee this thread for more information: https://github.com/sequelize/sequelize/issues/14519\n\nSnyk: https://security.snyk.io/vuln/SNYK-JS-SEQUELIZE-2932027","status":"published","published":"2023-02-22T22:59:09Z","modified":"2023-02-22T22:59:12Z","cvss":[{"version":"3.1","score":10,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-89"],"updated_at":"2026-11-02T14:36:46.526285Z"}],"nvd":[{"id":"CVE-2023-25813","description":"Sequelize is a Node.js ORM tool. In versions prior to 6.19.1 a SQL injection exploit exists related to replacements. Parameters which are passed through replacements are not properly escaped which can lead to arbitrary SQL injection depending on the specific queries in use. The issue has been fixed in Sequelize 6.19.1. Users are advised to upgrade. Users unable to upgrade should not use the `replacements` and the `where` option in the same query.","status":"published","published":"2023-02-22T19:15:11.777Z","modified":"2026-06-17T05:42:02.437Z","cvss":[{"version":"3.1","score":10,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","level":"critical","assessor":"secondary"},{"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":"primary"}],"cwes":["CWE-89"],"updated_at":"2026-11-02T14:07:47.623983Z"}],"osv":[{"id":"CVE-2023-25813","title":"SQL Injection via replacements in sequelize","description":"Sequelize is a Node.js ORM tool. In versions prior to 6.19.1 a SQL injection exploit exists related to replacements. Parameters which are passed through replacements are not properly escaped which can lead to arbitrary SQL injection depending on the specific queries in use. The issue has been fixed in Sequelize 6.19.1. Users are advised to upgrade. Users unable to upgrade should not use the `replacements` and the `where` option in the same query.","status":"published","published":"2023-02-22T18:14:44.579Z","modified":"2026-10-28T02:31:10.221895838Z","cvss":[{"version":"3.1","score":10,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-89"],"updated_at":"2026-11-02T15:44:31.135751Z"},{"id":"GHSA-wrh9-cjv3-2hpw","title":"Sequelize vulnerable to SQL Injection via replacements","description":"### Impact\n\nThe SQL injection exploit is related to replacements. Here is such an example: \n\nIn the following query, some parameters are passed through replacements, and some are passed directly through the `where` option.\n\n```typescript\nUser.findAll({\n  where: or(\n    literal('soundex(\"firstName\") = soundex(:firstName)'),\n    { lastName: lastName },\n  ),\n  replacements: { firstName },\n})\n```\n\nThis is a very legitimate use case, but this query was vulnerable to SQL injection due to how Sequelize processed the query: Sequelize built a first query using the `where` option, then passed it over to `sequelize.query` which parsed the resulting SQL to inject all `:replacements`.\n\nIf the user passed values such as\n\n```json\n{\n  \"firstName\": \"OR true; DROP TABLE users;\",\n  \"lastName\": \":firstName\"\n}\n```\n\nSequelize would first generate this query:\n\n```sql\nSELECT * FROM users WHERE soundex(\"firstName\") = soundex(:firstName) OR \"lastName\" = ':firstName'\n```\n\nThen would inject replacements in it, which resulted in this:\n\n```sql\nSELECT * FROM users WHERE soundex(\"firstName\") = soundex('OR true; DROP TABLE users;') OR \"lastName\" = ''OR true; DROP TABLE users;''\n```\n\nAs you can see this resulted in arbitrary user-provided SQL being executed.\n\n### Patches\n\nThe issue was fixed in Sequelize 6.19.1\n\n### Workarounds\n\nDo not use the `replacements` and the `where` option in the same query if you are not using Sequelize \u003e= 6.19.1 \n\n### References\n\nSee this thread for more information: https://github.com/sequelize/sequelize/issues/14519\n\nSnyk: https://security.snyk.io/vuln/SNYK-JS-SEQUELIZE-2932027","status":"published","published":"2023-02-22T22:59:09Z","modified":"2026-09-10T03:49:52.098579923Z","cvss":[{"version":"3.1","score":10,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-89"],"updated_at":"2026-11-02T15:46:59.131095Z"}]}}
