Why is EXECUTE granted to PUBLIC for all routines?

From: Jacek Trocinski <jacek(at)hedgehog(dot)app>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Why is EXECUTE granted to PUBLIC for all routines?
Date: 2022-04-22 17:31:29
Message-ID: CAPBN_=npERDpVuvJ63-7gn8PCGPCu_7q0DTwaURg8Of+7a7M+Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

The default behavior on Postgres is to grant EXECUTE to PUBLIC on any
function or procedure that is created.

I feel this this is a security concern, especially for procedures and
functions defined with the "SECURITY DEFINER" clause.

Normally, we don’t want everyone on the database to be able to run
procedures or function without explicitly granting them the privilege
to do so.

Is there any reason to keep grant EXECUTE to PUBLIC on routines as the default?

Best,
Jacek Trocinski

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-04-22 17:44:40 Re: Why is EXECUTE granted to PUBLIC for all routines?
Previous Message Tom Lane 2022-04-22 17:01:51 Re: Cryptohash OpenSSL error queue in FIPS enabled builds