Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 70E079FB8E3 for ; Mon, 18 Jun 2007 06:24:53 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 99560-03 for ; Mon, 18 Jun 2007 06:24:45 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.179]) by postgresql.org (Postfix) with ESMTP id 161909FB8F4 for ; Mon, 18 Jun 2007 06:24:47 -0300 (ADT) Received: by wa-out-1112.google.com with SMTP id k40so2378185wah for ; Mon, 18 Jun 2007 02:24:46 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=gwlF/V85x7PONNCT7hIM56HTUrUYtj57/ClMi5T/2UXNsy04Spz3c6a4sDTmt+MVfAUImOnikK+OIf1uGRkClPKmPacl99flGXlwNotvSRSMRvH4IX+Cmd5qrD1FCqHYvAcsnwsSuYuF68FvCwgJtomhonbZwUqH5uVePWwJ1lg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=jAv3x4tuFWFQbzUbp7T9zxU4u5wwHetFPuM68Lm82nUdczHMQnmjRHv7ffVEkx85j5eRAcaYYj7hPdXLy8pDvo1wKrIyGBgwT+xvj2riWKmS1SwA6jmcPePCR1g7Mdx/IkQoZ2H8xfZuDinS9nuO6xA4XaS/6I3PzndEm68qEM4= Received: by 10.115.59.4 with SMTP id m4mr5962266wak.1182158685533; Mon, 18 Jun 2007 02:24:45 -0700 (PDT) Received: by 10.115.89.14 with HTTP; Mon, 18 Jun 2007 02:24:45 -0700 (PDT) Message-ID: <758d5e7f0706180224l10fab387mf9720955eb859417@mail.gmail.com> Date: Mon, 18 Jun 2007 11:24:45 +0200 From: "Dawid Kuroczko" To: "Ray Stell" Subject: Re: bugtraq post Cc: pgsql-admin@postgresql.org In-Reply-To: <20070617125606.GA17612@cns.vt.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070617125606.GA17612@cns.vt.edu> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/125 X-Sequence-Number: 25793 On 6/17/07, Ray Stell wrote: > > For the security minded: > > Nico Leidecker posted this to bugtraq yesterday, fyi. > > "I'd like to present a paper about security issues with PostgreSQL. The paper describes weaknesses in the configuration that may > +allow attackers to escalade privileges, execute shell commands and to upload arbitrary (binary) files via SQL injections. > > You can either get the TXT version from http://www.leidecker.info/pgshell/Having_Fun_With_PostgreSQL.txt > Or as PDF at at http://www.portcullis.co.uk/uplds/whitepapers/Having_Fun_With_PostgreSQL.pdf > > The paper comes with a tool called `pgshell' that can be downloaded at http://www.leidecker.info/pgshell" Interesting, though it seems its nothing really special. Basically, if you are a superuser you can do pretty much everything you want. After all PostgreSQL is about flexibility. > The default PostgreSQL configuration from the sources has local trust au- > thentication enabled. Any connection made from the local host to the data- > base will be accepted and the user directly logged in without the need to > supply a password. It is hard to understand, why such a feature is part ofd > the default configuration and yet, the warning in the corresponding file > ('pg_hba.conf') is unmistakable: All "default" instalations I've used had "ident sameuser" as default auth method for postmaster. Anyhow, one can say Oracle has similar problem, where user can with help of DBMS_TCP shutdown listener, for example. And dblink is not installed by default, so DBA should be careful for whom and how he makes it available (security definer function? View? I guess normal user should never ever be able to call it directly). And of course, if user has a superuser privilege, he can do about anything he wants. No surprise here, though I enjoyed the equillibristics with open/writle/close, when one could put a shell script into temp table, COPY it somewhere and then system("...") it. ;-) Anyhow it's good to know that most vulnerabilities in PostgreSQL require superuser privilege. :-) Regards, Dawid