I think there is SQL injection vulnerability in an application I'm testing. This is seen when I enter malformed parameters into a search form. All exceptions are shown in format:
PHP raised unknown error: pg_query() [http://php.net/function.pg-query]: Query failed: ERROR: syntax error in tsquery: "query" (more details about error - in log file)
So it looks like that PostreSQL's tsquery function is used. After looking into some situations like:
The Fat & Rats:C
ERROR: syntax error in tsquery: "the & fat & & & rats:c"
I think plainto_tsquery is used to convert query into
To what extent might this vulnerability be exploitable? Is it secure to use those PostgreSQL functions without additonal sanitizing?