Ubuntu 5.10 / 6.06 LTS : mysql-dfsg-4.1, mysql-dfsg-5.0 vulnerability (USN-303-1)

High Nessus Plugin ID 27878


The remote Ubuntu host is missing one or more security-related patches.


A SQL injection vulnerability has been discovered when using less popular multibyte encodings (such as SJIS, or BIG5) which contain valid multibyte characters that end with the byte 0x5c (the representation of the backslash character >>\<< in ASCII).

Many client libraries and applications use the non-standard, but popular way of escaping the >>'<< character by replacing all occurences of it with >>\'<<. If a client application uses one of the affected encodings and does not interpret multibyte characters, and an attacker supplies a specially crafted byte sequence as an input string parameter, this escaping method would then produce a validly-encoded character and an excess >>'<< character which would end the string.
All subsequent characters would then be interpreted as SQL code, so the attacker could execute arbitrary SQL commands.

The updated packages fix the mysql_real_escape_string() function to escape quote characters in a safe way. If you use third-party software which uses an ad-hoc method of string escaping, you should convert them to use mysql_real_escape_string() instead, or at least use the standard SQL method of escaping >>'<< with >>''<<.

Note that Tenable Network Security has extracted the preceding description block directly from the Ubuntu security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.


Update the affected packages.

Plugin Details

Severity: High

ID: 27878

File Name: ubuntu_USN-303-1.nasl

Version: $Revision: 1.12 $

Type: local

Agent: unix

Published: 2007/11/10

Modified: 2016/05/27

Dependencies: 12634

Risk Information

Risk Factor: High


Base Score: 7.5

Vector: CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P

Vulnerability Information

CPE: p-cpe:/a:canonical:ubuntu_linux:libmysqlclient14, p-cpe:/a:canonical:ubuntu_linux:libmysqlclient14-dev, p-cpe:/a:canonical:ubuntu_linux:libmysqlclient15-dev, p-cpe:/a:canonical:ubuntu_linux:libmysqlclient15off, p-cpe:/a:canonical:ubuntu_linux:mysql-client, p-cpe:/a:canonical:ubuntu_linux:mysql-client-4.1, p-cpe:/a:canonical:ubuntu_linux:mysql-client-5.0, p-cpe:/a:canonical:ubuntu_linux:mysql-common, p-cpe:/a:canonical:ubuntu_linux:mysql-common-4.1, p-cpe:/a:canonical:ubuntu_linux:mysql-server, p-cpe:/a:canonical:ubuntu_linux:mysql-server-4.1, p-cpe:/a:canonical:ubuntu_linux:mysql-server-5.0, cpe:/o:canonical:ubuntu_linux:5.10, cpe:/o:canonical:ubuntu_linux:6.06:-:lts

Required KB Items: Host/cpu, Host/Ubuntu, Host/Ubuntu/release, Host/Debian/dpkg-l

Patch Publication Date: 2006/06/16

Vulnerability Publication Date: 2006/06/01

Reference Information

CVE: CVE-2006-2753

OSVDB: 25987

USN: 303-1