Changelog - 2026-11-08
A hidden field answers like a missing one in every filter path
Bug Fix Security Breaking ChangeIn one line. A caller could still learn that a property exists and is hidden, by sorting on it in Meilisearch or by putting a bogus key next to it. Both now get the answer a missing property gets.
What changed
- The first refusal is the one the query meets first. When a filter names a hidden property and also something the query refuses (a column that does not exist, an unknown relation, a JSON path on a text column), the
400is the first of these in the order the query reads the filter. Before, the hidden property was always named, so{"nope":1,"secret":1}namedsecretwhile{"nope":1,"zzz":1}namednope. - Read order, per engine. A relational list without
includeorfieldsreads thewhere, then theorder. With either one it reads theorder, then thewhere, then each include, and every include scope is read the same way. A search query reads anincludefirst, then theorder, then thewhere. - Meilisearch
orderchecks declared fields. Anorderentry on a field the collection does not declare is refused with400 Field NOT FOUNDbefore the engine is called, as on Typesense. Before, a hidden field got that400and an undeclared one was sent to the engine. findByIdignores awherehere too.GET /:idnever reads awherefrom its filter, so awherenaming a hidden property is no longer refused there, as one naming a missing property never was.- A filter with no hidden property is unchanged. It is left to the query, which refuses it as before.
Who is affected
- Meilisearch callers that sort on a field the collection definition does not declare. They get
400instead of the engine's own error. Declare the field, or sort throughmode: 'raw'. - Meilisearch callers that sort by distance through
filter.order(_geoPoint(lat, lng) ASC). It is not a declared field, so it is refused now. Send the geo sort throughmode: 'raw'. - Code with its own query dialect. A class that implements
IRelationalQueryDialectmust addresolveInclusion, and one that implementsISearchQueryDialectmust addincludeNotSupportedError. A dialect that extends a shipped one already has them. - Everyone else. No action needed.
Breaking changes
WARNING
A Meilisearch filter.order entry that is not a declared field of the collection, such as a distance sort, answers 400 instead of reaching the engine.
Before:
await repository.search({
input: { mode: 'keyword', query: 'cafe', filter: { order: ['_geoPoint(10.77, 106.69) ASC'] } },
});After (send the geo sort to the engine through raw mode, on a controller that opted in with modes.raw.allow):
await repository.search({
input: { mode: 'raw', params: { q: 'cafe', sort: ['_geoPoint(10.77,106.69):asc'] } },
});WARNING
IRelationalQueryDialect and ISearchQueryDialect each have one more required method.
Before:
class MySearchDialect implements ISearchQueryDialect {
fieldNotFoundError(opts: { kind: 'where' | 'order'; field: string }): Error { /* ... */ }
// ...
}After (return the error your build throws for a filter with an include; a relational dialect adds resolveInclusion the same way):
class MySearchDialect implements ISearchQueryDialect {
fieldNotFoundError(opts: { kind: 'where' | 'order'; field: string }): Error { /* ... */ }
includeNotSupportedError(): Error { /* ... */ }
// ...
}Details
| File | Package |
|---|---|
src/base/repositories/common/request-filter-guard.ts | kernel |
src/relational/core/repositories/core/base.ts | connectors |
src/relational/core/repositories/core/readable.ts | connectors |
src/search/core/repositories/core/base.ts | connectors |
src/search/meilisearch/repositories/dialect/query-dialect.ts | connectors |
src/search/typesense/repositories/dialect/query-dialect.ts | connectors |
src/search/core/repositories/common/types.ts | connectors |
src/relational/core/repositories/dialect/filter.ts | connectors |
src/relational/core/repositories/common/types.ts | connectors |