A flaw was discovered in postgresql versions 9.4.x before 9.4.24, 9.5.x before 9.5.19, 9.6.x before 9.6.15, 10.x before 10.10 and 11.x before 11.5 where arbitrary SQL statements can be executed given a suitable SECURITY DEFINER function. An attacker, with EXECUTE permission on the function, can execute arbitrary SQL as the owner of the function.
https://www.postgresql.org/about/news/1960/
https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2019-10208
http://lists.opensuse.org/opensuse-security-announce/2020-08/msg00043.html