Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify endpoint binding request data to orderBy direction
-
DeliverySubmit crafted direction with SQL fragment
-
ExploitFragment concatenated into ORDER BY clause
-
ExecutionQuery executes injected expression
-
ImpactBlind/boolean extraction of DB-account-readable data
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Persistence The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires an application running MikroORM prior to 6.6.16 or in the 7.0.0-7.1.6 range that binds attacker-controlled request data to the ORDER BY *direction* value in em.find(), em.findOne(), em.findAndCount(), QueryBuilder.orderBy(), or QueryBuilderHelper.getQueryOrderFromObject(). It only affects the SQL drivers (SQLite, PostgreSQL, MySQL, MariaDB, MSSQL, libSQL, Oracle) via the AbstractSqlPlatform/BaseMySqlPlatform/MsSqlPlatform paths; MongoDB is not affected. Limiting factors: the orderBy field KEY is already validated against entity metadata (only the direction is injectable), and the vulnerability is not reachable unless the application passes raw request input as the direction - apps that use fixed/enum-constrained sort directions are not exploitable. Impact is confined to reading data available to the configured database account (blind/boolean extraction); no data modification is possible through this vector. |
| Impact | This is a genuine but conditional SQL injection (CWE-89) with a moderate real-world risk profile, matching its 6.5 CVSS. The vendor vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N reflects a network-reachable, low-complexity flaw yielding high confidentiality impact (blind/boolean extraction of any data the DB account can read) with no integrity or availability impact - consistent with the description, since only the ORDER BY *direction* token is injectable, which cannot alter data or stack additional statements in a standard concatenation. No EPSS score, no CISA KEV entry, and no public exploit code are provided, so there is no evidence of active exploitation. The decisive caveat is that this is a LIBRARY flaw whose exploitability is entirely gated on downstream application code: it only becomes reachable if an application binds attacker-controlled request data directly to the orderBy direction (e.g. a user-facing sort parameter). PR:L is therefore a modeling choice reflecting a typical authenticated app context - a truly public unauthenticated sort endpoint would be PR:N (higher severity), while an app that never exposes raw direction values is not exploitable at all. Net: a real priority for teams running MikroORM with dynamic sorting bound to request input, but not a mass-exploitation candidate. |
| Exploit ScenarioDerived | An application exposes a list/search endpoint where a client-supplied sort parameter is passed straight into MikroORM's orderBy direction (e.g. em.find(User, {}, { orderBy: { name: req.query.dir } })). An attacker supplies a crafted direction value containing a raw SQL fragment (e.g. 'asc, (CASE WHEN ... THEN ... END)') instead of asc/desc, which is concatenated unvalidated into the ORDER BY clause and executed, enabling blind/boolean-based extraction of data readable by the database account. No public exploit code is identified, but the fix's regression tests demonstrate injectable payloads such as 'asc, name'. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 16, 2026
SQL injection in the ORDER BY direction handling of MikroORM (a TypeScript ORM for Node.js) lets authenticated remote attackers append arbitrary SQL fragments to generated queries, enabling blind or boolean-based extraction of data readable by the configured database account. Affected are SQL drivers in versions prior to 6.6.16 and 7.0.0 through 7.1.6 (SQLite, PostgreSQL, MySQL, MariaDB, MSSQL, libSQL, Oracle); MongoDB is not affected. Exploitation is conditional - the application must bind attacker-controlled request data directly to the orderBy direction in em.find(), em.findOne(), em.findAndCount(), QueryBuilder.orderBy(), or QueryBuilderHelper.getQueryOrderFromObject(); the field key is already validated against entity metadata, and there is no public exploit identified at time of analysis. Vendor-released fixes exist in 6.6.16 and 7.1.7.
RemediationAI
Upgrade MikroORM to 6.6.16 or 7.1.7 (vendor-released patches, published as release tags https://github.com/mikro-orm/mikro-orm/releases/tag/v6.6.16 and https://github.com/mikro-orm/mikro-orm/releases/tag/v7.1.7); these versions add validateOrderByDirection() allow-list enforcement in AbstractSqlPlatform, BaseMySqlPlatform and MsSqlPlatform. If immediate upgrading is not possible, the most effective compensating control is to stop passing raw request input as the orderBy direction: coerce it through a strict server-side allow-list of the six legitimate values ('asc', 'desc', 'asc nulls first', 'asc nulls last', 'desc nulls first', 'desc nulls last') or map it to the QueryOrder enum before it reaches em.find(), em.findOne(), em.findAndCount(), QueryBuilder.orderBy() or QueryBuilderHelper.getQueryOrderFromObject() - the trade-off is that any client-supplied sort token not in the list is rejected, which may require updating client code and API contracts. Applications that already derive sort direction from fixed enums or hard-coded values are not exploitable, so an audit of call sites that forward user-controlled sort parameters is the fastest way to scope exposure. As a defence-in-depth measure with the operational cost of tighter privilege management, reduce the privileges of the database account used by the application so that blind extraction can only read non-sensitive tables, and consider query logging/monitoring for ORDER BY clauses containing commas or unexpected tokens. Follow the vendor advisory at https://github.com/mikro-orm/mikro-orm/security/advisories/GHSA-7j79-7q93-6v69 for updates; note that MongoDB-backed deployments are unaffected and do not require this change.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
MikroORM implements the Data Mapper, Unit of Work and Identity Map patterns and translates entity-level queries into dialect-specific SQL. In the shared SQL layer, AbstractSqlPlatform.getOrderByExpression previously interpolated the direction argument after only lowercasing it, without checking that it was one of the six legitimate ORDER BY modifiers. Because the direction string was concatenated into the ORDER BY clause, an attacker-supplied value such as 'asc, name' could terminate the intended sort expression and introduce additional SQL tokens, the classic CWE-89 improper neutralization of special elements used in an SQL command. The same unchecked flow existed in the BaseMySqlPlatform nulls-translation path and in the MsSqlPlatform fallthrough in packages/mssql/src/MsSqlPlatform.ts. The upstream fix introduces a private allow-list Set on AbstractSqlPlatform containing exactly 'asc', 'desc', 'asc nulls first', 'asc nulls last', 'desc nulls first' and 'desc nulls last', exposes an internal validateOrderByDirection() helper that lowercases and trims the input and throws 'Invalid order direction' for anything outside the set, and routes the AbstractSqlPlatform, BaseMySqlPlatform and MsSqlPlatform code paths through it so enum values and normalized numeric QueryOrder values (1 and -1) continue to work. The accompanying regression test GHx59.test.ts confirms rejection of 'upwards' and 'asc, name' while accepting all six directions and their uppercase variants.
Know when TypeScript gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Network-reachable low-complexity injection yielding blind read of DB-account data (C:H); direction-only token prevents modification (I:N/A:N); PR:L reflects typical authenticated app context since reachability depends on app-side binding.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
1DescriptionCVE.org
MikroORM is a TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Prior to 6.6.16 and 7.1.7, the shared SQL layer validates the field key of an orderBy clause but does not validate its direction value before AbstractSqlPlatform.getOrderByExpression concatenates it into an ORDER BY clause. Applications that bind attacker-controlled request data to the direction in em.find(), em.findOne(), em.findAndCount(), QueryBuilder.orderBy(), or QueryBuilderHelper.getQueryOrderFromObject() can permit a raw SQL fragment that performs blind or boolean extraction of data available to the database account. The BaseMySqlPlatform and MsSqlPlatform fallthrough paths have the same behavior, affecting SQLite, PostgreSQL, MySQL, MariaDB, MSSQL, libSQL, and Oracle drivers, while MongoDB is not affected. This issue is fixed in versions 6.6.16 and 7.1.7.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.
More in TypeScript
View allPath traversal in decap-server 3.10.0 and earlier lets unauthenticated remote attackers read, write, and delete files in
Joplin Server instances prior to 3.7.2 expose an SSO login-code redemption endpoint (GET /api/login_with_code/:id) that
Cross-tenant authorization bypass in TinaCMS self-hosted deployments allows any holder of a legitimate TinaCloud account
Authenticated clients on deepstream.io 10.1.0 can bypass record-write authorization and modify arbitrary protected recor
OS command injection in zosmaai's pi-llm-wiki through 0.11.7 lets an attacker who can invoke the wiki_capture_source MCP
A remote, unauthenticated denial-of-service condition in the NestJS (Nest) microservices framework lets an attacker cras
Fee-sponsoring servers built on mppx before 0.8.2 can be induced by any client with access to the sponsorship endpoint t
Code escaping sandbox in the PraisonAI npm package's built-in codeMode tool (praisonai 1.4.0 through 1.7.1) lets anyone
Unauthenticated passkey enrollment in OpenReception appointment-booking software prior to 1.1.1 lets remote attackers in
A credential-isolation flaw in geelen mcp-remote 0.1.16 through 0.1.38 allows a remote attacker who controls or can pred
Remote code execution affects Univer v1.0.0-alpha.2 through its Uniscript feature: the UniscriptExecutionService.execute
Dokploy instances running versions prior to 0.29.13 disclose stored Git provider secrets - GitHub App private keys, OAut
EUVD-2026-80875
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB