Issue Task Rejected

#110796Strip MySQL fulltext operators from search words in boolean mode

Benni Mack 09/25/26, 17:00 updated 11/19/26, 16:56

Description

Problem

When indexed_search uses the MySQL fulltext search (enableFulltextSearch / useMysqlFulltext), the search words are concatenated into an AGAINST('...' IN BOOLEAN MODE) expression in IndexSearchRepository::getSearchString(). Only the double quote is removed for sentence searches. The other boolean-mode operators ( ) < > ~ *@ and " stay in the word and are handed to the database.

A frontend user who enters e.g. foo(, ", +, @ or < in the search field, or uses the part-of-word search type (which forces boolean mode), gets a SQL syntax error from MySQL/MariaDB (“syntax error, unexpected …”), so the search result page fails instead of showing “no results”. Operators in the middle of a word also silently change the meaning of the query.

The value is bound/quoted, so this is not an SQL injection. It is a robustness bug: user input is interpreted as query syntax.

Steps to reproduce

  1. Enable the MySQL fulltext search in indexed_search.
  2. Search for fo(o or " or foo~ with search type “part of word”.
  3. Observe the database exception (HTTP 500) instead of an empty result.

Expected behaviour

Operator characters in user-provided search words are removed before building the boolean expression. The operators that indexed_search adds itself (+, -, * and the quotes of sentence searches) must stay.

Fix

Strip ( ) < > ~ “ * +@ and - from the individual search word in getSearchString() before the indexer-controlled prefix/suffix is
added. Covered by a unit test.

Found during an audit of EXT:indexed_search, see also #110782 to #110788.

Reviews 1

History 12

  1. Benni Mack commented and changed status Under Review Rejected <span data-processor="relativetime" data-value="2026-11-19T16:56:31+00:00" > 11/19/26, 16:56 </span>

    wont do