TITLE:
PostgreSQL Encoding-Based SQL Injection Vulnerability

SECUNIA ADVISORY ID:
SA20231

VERIFY ADVISORY:
http://secunia.com/advisories/20231/

CRITICAL:
Moderately critical

IMPACT:
Manipulation of data

WHERE:
>From remote

SOFTWARE:
PostgreSQL 7.x
http://secunia.com/product/506/
PostgreSQL 8.x
http://secunia.com/product/4587/

DESCRIPTION:
Two vulnerabilities have been reported in PostgreSQL, which
potentially can be exploited by malicious people to conduct SQL
injection attacks.

The vulnerabilities are caused due to the differences in the way
PostgreSQL server and non-encoding aware applications interpret SQL
query strings that contain certain multi-byte characters. A
non-encoding aware application may insert escape characters into a
malicious query string (e.g. to escape single-quote or backslash
characters), without realizing that the escape characters will be
interpreted as part of a multi-byte character sequence by the server.
This can be exploited to conduct SQL injection attacks by injecting
certain multi-byte characters into the query string.

Successful exploitation allows bypassing of SQL injection escaping
code that are implemented in non-encoding aware applications.

The vulnerabilities have been reported in the 7.3, 7.4, 8.0 and 8.1
branch.

SOLUTION:
Update to the fixed versions.
http://www.postgresql.org/download/

Version 7.3.x:
Update to version 7.3.15.

Version 7.4.x:
Update to version 7.4.13.

Version 8.0.x:
Update to version 8.0.8.

Version 8.1.x:
Update to version 8.1.4.

PROVIDED AND/OR DISCOVERED BY:
Reported by vendor.

ORIGINAL ADVISORY:
http://archives.postgresql.org/pgsql-announce/2006-05/msg00010.php
http://www.postgresql.org/docs/techdocs.50
http://www.postgresql.org/docs/8.1/static/release-7-3-15.html
http://www.postgresql.org/docs/8.1/static/release-7-4-13.html
http://www.postgresql.org/docs/8.1/static/release-8-0-8.html
http://www.postgresql.org/docs/8.1/static/release.html#RELEASE-8-1-4

----------------------------------------------------------------------

About:
This Advisory was delivered by Secunia as a free service to help
everybody keeping their systems up to date against the latest
vulnerabilities.

Subscribe:
http://secunia.com/secunia_security_advisories/

Definitions: (Criticality, Where etc.)
http://secunia.com/about_secunia_advisories/


Please Note:
Secunia recommends that you verify all advisories you receive by
clicking the link.
Secunia NEVER sends attached files with advisories.
Secunia does not advise people to install third party patches, only
use those supplied by the vendor.

----------------------------------------------------------------------

Unsubscribe: Secunia Security Advisories
http://secunia.com/sec_adv_unsubscribe/?email=packet%40packetstormsecurity.org

----------------------------------------------------------------------