Summary
An information exposure flaw in Symfony UX Autocomplete allows client-supplied search queries to be embedded into SQL LIKE clauses without properly handling wildcard characters.
This enables unauthenticated users to abuse the public autocomplete endpoint as a broad matcher or blind boolean oracle over multiple columns, potentially revealing sensitive data patterns and existence of records when the endpoint is exposed.
Affected context
The vulnerability arises in applications using Symfony UX Autocomplete with Doctrine, specifically relying on BaseEntityAutocompleteType and EntitySearchUtil::addSearchClause() for server-side search.
It is relevant when:
- The public autocomplete endpoint is exposed to unauthenticated or broadly authenticated users
- Default
searchable_fieldsinclude columns that convey sensitive or business-critical information - Client queries are directly mapped into SQL LIKE conditions without customized escaping or stricter filtering
Exploit preconditions
- Attack surface: Public or semi-public HTTP endpoints using Symfony UX Autocomplete with Doctrine-based entity search.
- Required access: Ability to send arbitrary autocomplete queries (often unauthenticated).
- Trigger point: Submission of crafted search strings that leverage
%,_, and\in the LIKE pattern. - Why exploitation is possible: The search utility wraps the raw client query with
%...%but does not escape SQL LIKE wildcards, enabling broad pattern matching and boolean probing across configuredsearchable_fields.
Why this happens
The core issue is how the autocomplete search clause is constructed in EntitySearchUtil::addSearchClause().
Instead of treating user input strictly as literal text, the implementation composes SQL LIKE expressions by surrounding the query with % characters and omitting proper escaping of wildcard meta-characters (%, _, \).
This aligns with CWE-200: Information Exposure, because it turns a convenience search feature into an oracle that can reveal whether certain values or patterns exist in database columns, effectively leaking internal data characteristics through the endpoint's responses.
Potential impact
- Attackers may infer whether specific records exist based on autocomplete matches.
- Attackers can broadly enumerate patterns across all default
searchable_fields. - Sensitive business data (such as internal identifiers, flags, or status fields) could be indirectly revealed via match/no-match behavior.
- Application data models and relationships can be mapped more easily, aiding further targeted attacks.
General mitigation guidance
Mitigation typically focuses on constraining how search input is translated into database queries and what fields are exposed:
- Apply strict escaping of SQL LIKE wildcard characters (
%,_,\) before building search clauses so input is treated as literal text. - Limit
searchable_fieldsto non-sensitive, user-facing attributes and avoid including internal or confidential columns. - Add server-side constraints such as minimum query length, rate limiting, and normalization to reduce oracle-style probing.
- Enforce defense-in-depth by restricting public autocomplete endpoints to appropriate user roles and avoiding overly broad search scopes by default.
How teams detect issues like this
Detection can be approached by:
- Static analysis or manual code review to identify search utilities that wrap user input in SQL LIKE patterns without proper escaping.
- Reviewing configuration of autocomplete endpoints to spot overly broad or sensitive
searchable_fields. - Logging and analyzing autocomplete traffic for patterns indicative of oracle-style probing (e.g., systematic wildcard testing or enumeration).
- Incorporating security checks into CI pipelines that flag direct use of user input in search clauses without normalization or escaping policies.

