{"id":"CVE-2026-44680","aliases":["CVE-2026-44680","GHSA-cfw5-68c4-ffqp"],"related":[],"kind":"vulnerability","state":"published","title":"MikroORM: SQL injection via runtime-controlled identifiers and JSON-path keys","summary":"MikroORM is a TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Prior to @mikro-orm/knex 6.6.14 and @mikro-orm/sql 7.0.14, MikroORM's identifier-quoting helper (Platform.quoteIdentifier and the postgres/mssql overrides) and its JSON-path emitters (Platform.getSearchJsonPropertyKey, quoteJsonKey) did not properly escape characters that delimit the SQL identifier or string-literal context they emit into. When application code passes attacker-influenced strings to public ORM APIs that expect an identifier or a JSON-property filter, an attacker can break out of the quoted context and inject arbitrary SQL. This vulnerability is fixed in @mikro-orm/knex 6.6.14 and @mikro-orm/sql 7.0.14.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"MikroORM is a TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Prior to @mikro-orm/knex 6.6.14 and @mikro-orm/sql 7.0.14, MikroORM's identifier-quoting helper (Platform.quoteIdentifier and the postgres/mssql overrides) and its JSON-path emitters (Platform.getSearchJsonPropertyKey, quoteJsonKey) did not properly escape characters that delimit the SQL identifier or string-literal context they emit into. When application code passes attacker-influenced strings to public ORM APIs that expect an identifier or a JSON-property filter, an attacker can break out of the quoted context and inject arbitrary SQL. This vulnerability is fixed in @mikro-orm/knex 6.6.14 and @mikro-orm/sql 7.0.14.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nMikroORM's identifier-quoting helper (`Platform.quoteIdentifier` and the postgres/mssql overrides) and its JSON-path emitters (`Platform.getSearchJsonPropertyKey`, `quoteJsonKey`) did not properly escape characters that delimit the SQL identifier or string-literal context they emit into. When application code passes attacker-influenced strings to public ORM APIs that expect an identifier or a JSON-property filter, an attacker can break out of the quoted context and inject arbitrary SQL.\n\n## Affected APIs\n\nThe vulnerability is reachable when application code passes an attacker-influenced string to any of the following documented APIs:\n\n* **Multi-tenant `schema` option** — `em.fork({ schema })`, `qb.withSchema(name)`, `wrap(entity).setSchema(name)`, `em.create(Cls, data, { schema })`. The schema name is concatenated into the SQL identifier and never had its dialect quote character escaped.\n* **`em.find` / `qb.where` JSON-property filters** — `em.find(Entity, { jsonCol: { [userKey]: value } })`. The user-supplied JSON sub-keys cannot be validated against any metadata (JSON columns are schemaless by design), and were spliced into the SQL string literal of the JSON path expression without escaping.\n* **`qb.where` / `qb.orderBy` / `qb.groupBy` / `qb.having` / `qb.select` keys** — keys containing `.` or `::` bypassed the structured-where metadata validator in `CriteriaNode`, then flowed through the same broken `quoteIdentifier`. Apps that forwarded raw filter keys from request input were already broken on authorization grounds (e.g. `{ isAdmin: true }`); the SQL injection here is a defence-in-depth failure on top of that.\n\nThe vulnerability does **not** affect documented escape-hatch APIs (`raw()`, the `sql` tagged template, `qb.raw()`, `em.raw()`) — those are documented as accepting raw SQL and are the application's responsibility to sanitize.\n\n## Impact\n\n* **Confidentiality** — read from any table/schema the database user has access to (cross-tenant data leak in multi-tenant deployments).\n* **Integrity** — on dialects supporting multi-statement queries (MSSQL, MySQL with multi-statement enabled), execute additional arbitrary SQL statements (data modification, in-database privilege escalation).\n* **Availability** — DROP/TRUNCATE via injected statements where the database user has the privilege.\n\n## Affected dialects\n\nAll SQL dialects supported by MikroORM. The identifier-quoting bug exists in every dialect's `quoteIdentifier` (the dialect's own quote character — backtick, double quote, or right bracket — was not doubled when embedded in the identifier). The JSON-path bug exists in all dialects' `getSearchJsonPropertyKey`/`quoteJsonKey`.\n\nMongoDB driver is **not** affected (no SQL).\n\n## Patches\n\n* v7: upgrade to **7.0.14** or later.\n* v6: upgrade to **6.6.14** or later.\n\nPatches:\n* Identifier quoting: #7653 (master) / #7654 (6.x)\n* JSON-path keys: #7656 (master) / #7657 (6.x)\n\n## Workarounds\n\nIf users cannot upgrade immediately:\n\n* For multi-tenant apps using `em.fork({ schema })` / `wrap().setSchema()` / `qb.withSchema()`: validate the schema name against a strict allowlist (e.g. `^[A-Za-z_][\\w$]*$`) **before** passing it to MikroORM.\n* For applications that pass `where` / `orderBy` filters from request input: validate every key against the entity's known properties before constructing the filter; do not pass keys containing `.` or `::` from user input.\n* For applications that allow filtering on JSON columns from request input: validate every JSON sub-key against an allowlist (or against `^[a-zA-Z_][\\w]*$`) before passing it to `em.find`.\n\n## Credits\n\nReported and patched by Martin Adámek (project maintainer) during an internal security review.","format":"markdown","source":"ghsa"},{"lang":"es","text":"MikroORM es un ORM de TypeScript para Node.js basado en los patrones Data Mapper, Unit of Work e Identity Map. Antes de @mikro-orm/knex 6.6.14 y @mikro-orm/sql 7.0.14, el asistente de entrecomillado de identificadores de MikroORM (Platform.quoteIdentifier y las anulaciones de postgres/mssql) y sus emisores de rutas JSON (Platform.getSearchJsonPropertyKey, quoteJsonKey) no escapaban correctamente los caracteres que delimitan el identificador SQL o el contexto de cadena literal en el que emiten. Cuando el código de la aplicación pasa cadenas influenciadas por el atacante a las API públicas del ORM que esperan un identificador o un filtro de propiedad JSON, un atacante puede salir del contexto entrecomillado e inyectar SQL arbitrario. Esta vulnerabilidad está corregida en @mikro-orm/knex 6.6.14 y @mikro-orm/sql 7.0.14.","source":"nvd"}],"published":"2026-05-08T19:17:45.000Z","modified":"2026-09-10T03:50:46.602Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L","score":7.6,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L","score":7.6,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L","score":7.6,"rating":"HIGH"}],"cwes":["CWE-89"],"affected":[{"ranges":[{"version":">= 7.0.0-rc.0, < 7.0.14","status":"affected"},{"version":"< 6.6.14","status":"affected"}],"vendor":"mikro-orm","product":"mikro-orm","source":"cvelist"},{"ranges":[{"version":"< 6.6.14","status":"affected"}],"vendor":"@mikro-orm","product":"knex","source":"cvelist"},{"ranges":[{"version":"< 7.0.14","status":"affected"}],"vendor":"@mikro-orm","product":"sql","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"7.0.14"}],"ecosystem":"npm","package":"@mikro-orm/sql","purl":"pkg:npm/%40mikro-orm/sql","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"6.6.14"}],"ecosystem":"npm","package":"@mikro-orm/knex","purl":"pkg:npm/%40mikro-orm/knex","source":"ghsa"}],"references":[{"url":"https://github.com/mikro-orm/mikro-orm/security/advisories/GHSA-cfw5-68c4-ffqp","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/mikro-orm/mikro-orm/pull/7653","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/mikro-orm/mikro-orm/pull/7654","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/mikro-orm/mikro-orm/pull/7656","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/mikro-orm/mikro-orm/pull/7657","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-44680","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/mikro-orm/mikro-orm","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-05-26T17:40:31.124Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-44680","url":"https://www.cve.org/CVERecord?id=CVE-2026-44680","licence":"CVE Terms of Use","modified":"2026-05-26T17:40:52.485Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-cfw5-68c4-ffqp","url":"https://github.com/advisories/GHSA-cfw5-68c4-ffqp","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:46.602Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-44680","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-44680","licence":"Public domain","modified":"2026-07-24T11:10:00.170Z"}],"updatedAt":"2026-11-25T22:59:22.337Z","epss":{"score":0.0145,"percentile":0.74137,"date":"2026-12-01T12:00:22.000Z"}}