Vulnerability DatabaseGHSA-g84f-3cfw-8wx9

GHSA-g84f-3cfw-8wx9: 
JavaScript vulnerability analysis and mitigation

Summary

MikroORM builds SQL from templates that use ? and ?? as placeholders, and inlines the parameters on the client before the query is sent to the database. A ? that was already part of the template for another reason was read as one more placeholder, so the next parameter of the query was written into the wrong position, outside of the quoting it was meant for. A string value could end up being executed as SQL. This happened in three places:

  • quoted identifiers, where ? was left as is,
  • JSON path literals emitted for JSON property filters,
  • raw fragments with bound values (raw(), the sql tagged template, sub-queries) used inside a QueryBuilder, which were formatted with their own parameters and then scanned again as part of the outer query.

Affected APIs

  • Raw fragments with bound values inside a QueryBuilder (v7 only), e.g. qb.where(sql`lower(name) = ${term}`). The application binds the value correctly. If the value contains ? and a later parameter of the same query is also request-derived, the later value is placed outside of its string literal. This applies to fragments passed to where / andWhere / orWhere, select / addSelect, orderBy and groupBy, to sub-queries used in joins or withSubQuery, and to update, delete and count queries built this way. No control over object keys is needed. With a single request-derived value the query only fails or returns wrong rows.
  • JSON property filters (v7 only), em.find(Entity, { jsonCol: { [userKey]: value } }). JSON sub-keys cannot be validated against metadata.
  • The schema option (v7 only), em.fork({ schema }), qb.withSchema(name) and similar, when the schema name is request-derived.
  • Object keys in em.find / em.nativeUpdate / em.nativeDelete / qb.where / qb.update / qb.insert (v6 and v7). Where keys containing . or :: skip the metadata validation and reach the identifier quoting, and data keys of native updates and inserts are not validated. An application that forwards request-derived keys to these APIs already lets the caller filter on or write to any column of the entity, and this adds SQL injection on top of that. It is the same entry point as in GHSA-cfw5-68c4-ffqp, where the fix escaped the quote character but not ?. Not affected: qb.where('lower(name) = ?', [term]) (a string with a params array), raw fragments used as keys or values of an em.find filter, and entity changes persisted through em.flush().

Impact

  • Conditions the application adds to the query (ownership or tenant checks) can be bypassed, and data from other tables the database user can read can be selected.
  • The where clause of an update or delete can be dropped, so it applies to every row.
  • On PostgreSQL and MSSQL further statements can be appended, since the query is sent without bound parameters. MySQL and MariaDB allow this only with multipleStatements enabled, SQLite does not allow it.

Affected versions

The code lives in the shared SQL layer, so all SQL drivers are affected. MongoDB is not affected.

LinePackageAffected versions
v7@mikro-orm/sql>= 7.0.0, <= 7.2.10
v6@mikro-orm/knex<= 6.6.18
The SQL layer is delivered transitively via the driver packages, which all depend on it.
On v6 only the object key variant is affected. The JSON sub-key, schema and raw fragment variants fail with a query error there.

Patches

Fixed in 7.2.11 (#8769) and 6.6.19 (#8774). In v7, question marks in identifiers, JSON path literals and embedded raw fragments are now escaped, so they are no longer read as placeholders. In v6, a query with more placeholders than parameters is rejected before it is executed.

Workarounds

  • In a QueryBuilder, pass request-derived values as qb.where('... ?', [value]) instead of through a raw fragment, or reject values containing ?.
  • Validate every request-derived key against the known properties of the entity before building a filter or an update payload, and reject keys containing ?.
  • Reject JSON sub-keys and schema names containing ?, or check them against an allow-list.

Source: NVD

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-133867CRITICAL9.1
  • JavaScript logoJavaScript
  • @fastify/express
NoYesNov 21, 2026
CVE-2026-133250CRITICAL9.1
  • JavaScript logoJavaScript
  • @fastify/middie
NoYesNov 21, 2026
CVE-2026-133120CRITICAL9.1
  • JavaScript logoJavaScript
  • @fastify/express
NoYesNov 21, 2026
CVE-2026-133312MEDIUM5.3
  • JavaScript logoJavaScript
  • @fastify/rate-limit
NoYesNov 21, 2026
CVE-2026-133273LOW3.7
  • JavaScript logoJavaScript
  • @fastify/swagger-ui
NoYesNov 21, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management