Re: Add on_trusted_init and on_untrusted_init to plperl UPDATED [PATCH]

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Add on_trusted_init and on_untrusted_init to plperl UPDATED [PATCH]
Дата
Msg-id 603c8f071002031153pf0e5901h8361f2491ddc28c6@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Add on_trusted_init and on_untrusted_init to plperl UPDATED [PATCH]  (Tim Bunce <Tim.Bunce@pobox.com>)
Список pgsql-hackers
On Wed, Feb 3, 2010 at 2:38 PM, Tim Bunce <Tim.Bunce@pobox.com> wrote:
>> What I was actually wondering about, however, is the extent to which
>> the semantics of Perl code could be changed from an on_init hook ---
>> is there any equivalent of changing search_path or otherwise creating
>> trojan-horse code that might be executed unexpectedly?
>
> This seems like a reasonable 'vector of first choice':
>
>    SET plperl.on_plperl_init = '$SIG{__WARN__} = sub { ... }';
>
> and then do something to trigger a warning from some existing plperl
> function. So I think the answer is yes.

Perl is actually full of places where you can do things like this,
like exporting things into CORE::GLOBAL, or just polluting the package
namespace in which the code will run.  Not sure if any of this is
prevented by Safe.

...Robert


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PG 9.0 and standard_conforming_strings
Следующее
От: Joshua Tolley
Дата:
Сообщение: Re: Making pg_config and pg_controldata output available via SQL