X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 2E637D1F1D0 for ; Wed, 5 May 2004 11:25:04 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 58719-06 for ; Wed, 5 May 2004 11:24:46 -0300 (ADT) Received: from web08.manitu.net (web08.manitu.net [217.11.48.108]) by svr1.postgresql.org (Postfix) with ESMTP id BDE9BD1F1AD for ; Wed, 5 May 2004 11:24:41 -0300 (ADT) Received: (from mpitt@localhost) by web08.manitu.net (8.10.2-SOL3/8.10.2) id i45EOii32142 for pgsql-odbc@postgresql.org; Wed, 5 May 2004 16:24:44 +0200 Date: Wed, 5 May 2004 16:24:43 +0200 From: Martin Pitt To: pgsql-odbc@postgresql.org Subject: Fwd: Bug#247306: odbc-postgresql: SIGSEGV with long inputs (> 10000 bytes) Message-ID: <20040505142443.GB31778@web08.manitu.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/3 X-Sequence-Number: 4027 Hi psqlodbc developers! We (the Debian maintainers of postgresql) just got the following bug report. Unfortunately I don't have any personal experience with the package, I came to it more or less by accident (long story, does not belong here). Can anybody please confirm this and does anybody have a solution? A patch against the current version 07.03.0200 would be greatly appreciated! The stable version of Debian still has PostgreSQL 7.2.1 which included the odbc driver. Is this version affected as well? Thank you very much in advance and have a nice day! Martin ----- Forwarded message from delman ----- Subject: Bug#247306: odbc-postgresql: SIGSEGV with long inputs (> 10000 bytes) Reply-To: delman , 247306@bugs.debian.org From: delman To: Debian Bug Tracking System Date: Tue, 04 May 2004 15:25:24 +0200 X-Spam-Status: No, hits=0.0 required=4.0 tests=SUBJ_BRACKET_BALANCED, SUBJ_BRACKET_OFF,SUBJ_BRACKET_ON autolearn=no version=2.61 Package: odbc-postgresql Version: 1:07.03.0200-2 Severity: grave Tags: security Justification: user security hole I noticed Apache segfaulting when I feed a simple form with long inputs: [Tue May 4 11:32:10 2004] [notice] child pid 4084 exit signal Segmentation fault (11) Such inputs are used by php function odbc_connect as username and password to connect to a DSN using postgresql driver: $connection = @odbc_connect(DSN, $_POST['username'], $_POST['password']) The output of gdb is: (gdb) run -X -d apache [...] [Thread debugging using libthread_db enabled] [...] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1076569920 (LWP 832)] 0x44c3d627 in SOCK_put_next_byte () from /usr/lib/postgresql/lib/psqlodbc.so Or: [same stuff here] 0x44c4c3d0 in strncpy_null () from /usr/lib/postgresql/lib/psqlodbc.so I suspect a security issue because playing around with long input strings of "A" I've been able to trigger in Apache error.log this message: free(): invalid pointer 0x41414141! 0x41 is obviously one of my "A"... Other ODBC related messages found are: /usr/sbin/apache: relocation error: AAAA[...]AAA: symbol getDSNdefaults, version not defined in file with link time reference The SIGSEGV is triggered with input strings > 10000 bytes. I use Apache/1.3.29 (Debian GNU/Linux) PHP/4.3.4 mod_auth_pam/1.1.1 mod_ssl/2.8.16 OpenSSL/0.9.7c -- System Information: Debian Release: testing/unstable APT prefers testing APT policy: (500, 'testing') Architecture: i386 (i686) Kernel: Linux 2.6.4 Locale: LANG=C, LC_CTYPE=C Versions of packages odbc-postgresql depends on: ii libc6 2.3.2.ds1-11 GNU C Library: Shared libraries an ii odbcinst1 2.2.4-9 Support library and helper program -- no debconf information ----- End forwarded message ----- -- Martin Pitt Debian GNU/Linux Developer martin@piware.de mpitt@debian.org http://www.piware.de http://www.debian.org