Re: Addressing SECURITY DEFINER Function Vulnerabilities in PostgreSQL Extensions

From: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
To: Isaac Morland <isaac(dot)morland(at)gmail(dot)com>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Addressing SECURITY DEFINER Function Vulnerabilities in PostgreSQL Extensions
Date: 2024-06-06 22:19:16
Message-ID: CAGECzQRoq96M663zo7HO_+smCt2f8JC7spDveXx4_+WUcdwXzQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 6 Jun 2024 at 20:10, Isaac Morland <isaac(dot)morland(at)gmail(dot)com> wrote:
>
> On Thu, 6 Jun 2024 at 12:53, Jeff Davis <pgsql(at)j-davis(dot)com> wrote:
>
>>
>> > I didn't get you completely here. w.r.t extensions how will this have
>> > an impact if we set the search_path for definer functions.
>>
>> If we only set the search path for SECURITY DEFINER functions, I don't
>> think that solves the whole problem.
>
>
> Indeed. While the ability for a caller to set the search_path for a security definer functions introduces security problems that are different than for security invoker functions, it's still weird for the behaviour of a function to depend on the caller's search_path. It’s even weirder for the default search path behaviour to be different depending on whether or not the function is security definer.

+1

And +1 to the general idea and direction this thread is going in. I
definitely think we should be making extensions more secure by
default, and this is an important piece of it.

Even by default making the search_path "pg_catalog, pg_temp" for
functions created by extensions would be very useful.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2024-06-06 23:20:16 Re: Addressing SECURITY DEFINER Function Vulnerabilities in PostgreSQL Extensions
Previous Message Jelte Fennema-Nio 2024-06-06 22:02:28 Re: ssl tests fail due to TCP port conflict