Changelog - 2026-11-07
A search request cannot carry engineParams, unless the controller allows it
Security Breaking ChangeIn one line. engineParams hands the engine its own wire parameters. An unscoped search controller accepted it, so a caller could replace the controller's own filter_by and name fields the model hides. Every search controller refuses it now.
What changed
- Refused on every search controller. A search request with
engineParams, scoped or not, answers400 engineParams is not available on this search controller, and the engine is not reached. The same holds for each entry of amulti-searchrequest. An emptyengineParams: {}is refused too. - A controller can allow some.
engineParams: { allow: ['typo_tokens_threshold', 'num_typos'] }ondefineSearchControllerlets callers send those parameters. Names compare in one spelling (num_typos=numTypos). Any other parameter is a400that names it. - Row and field parameters can never be allowed.
filter_by,include_fields,exclude_fields,query_by,facet_by,group_by,highlight_fields,sort_by,preset,pinned_hits,vector_queryand the Meilisearch counterparts (filter,attributesToRetrieve,facets,sort, ...) cannot be listed:defineSearchControllerthrows when the list holds one, so a bad list never boots. - Server code is unchanged.
repository.search({ ..., engineParams })and the other repository methods take any parameter, as before. - Unchanged.
mode: 'raw'on an unscoped controller, and the rules of a scoped controller (rawrefused, multi-search disabled).
Who is affected
- Clients that send
engineParamsto a search controller. They get a400. If the parameter is a tuning knob, list it inengineParams.allow; if it selects rows or fields, use the neutral input (filter,queryBy,fields) instead, or call it from server code. - Everyone else. No action needed.
Breaking changes
WARNING
A request to a search controller that carries engineParams answers 400.
Before:
typescript
// accepted on an unscoped controller
{ "mode": "keyword", "query": "lamp", "queryBy": ["title"], "engineParams": { "num_typos": 1 } }After:
typescript
// the controller names what callers may send
SearchControllerFactory.defineSearchController({
entity: ProductDocument,
repository: { name: ProductSearchRepository.name },
controller: { name: 'ProductSearchController', basePath: '/products' },
engineParams: { allow: ['num_typos'] },
});Details
| File | Package |
|---|---|
src/search/core/controllers/engine-params.ts | connectors |
src/search/core/controllers/abstract.ts | connectors |
src/search/core/controllers/factory.ts | connectors |
src/search/core/controllers/scope.ts | connectors |