When using the rest.php endpoint it appears that string parameters are not normalized the same way than the action API.
- no NFC normalization
- no � replacement on control chars such as the NUL character
Basically everything that \UtfNormal\Validator::cleanUp would usually do is not done when going through rest.php.
I believe that most of the internal MW apis do expect parameters to be normalized the same way as the action API.
Concretely the Search rest endpoint allows the NUL char to be passed through the internal SearchEngine class and then fails when hitting the search backend.