FreeBSD : MySQL -- SQL-injection security vulnerability (7f8cecea-f199-11da-8422-00123ffe8333)

High Nessus Plugin ID 21634


The remote FreeBSD host is missing one or more security-related updates.


MySQL reports :

A SQL-injection security hole has been found in multibyte encoding processing. A SQL-injection security hole can include a situation whereby when inserting user-supplied data into a database, the user might inject his own SQL statements that the server will execute. With regards to this vulnerability discovered, when character set unaware escaping is used (e.g., addslashes() in PHP), it is possible to bypass it in some multibyte character sets (e.g., SJIS, BIG5 and GBK). As a result, a function like addslashes() is not able to prevent SQL injection attacks. It is impossible to fix this on the server side.
The best solution is for applications to use character set aware escaping offered in a function like mysql_real_escape().

Workarounds :

One can use NO_BACKSLASH_ESCAPES mode as a workaround for a bug in mysql_real_escape_string(), if you cannot upgrade your server for some reason. It will enable SQL standard compatibility mode, where backslash is not considered a special character.


Update the affected packages.

See Also

Plugin Details

Severity: High

ID: 21634

File Name: freebsd_pkg_7f8ceceaf19911da842200123ffe8333.nasl

Version: $Revision: 1.12 $

Type: local

Published: 2006/06/05

Modified: 2014/08/12

Dependencies: 12634

Risk Information

Risk Factor: High

Vulnerability Information

CPE: p-cpe:/a:freebsd:freebsd:mysql-server, cpe:/o:freebsd:freebsd

Required KB Items: Host/local_checks_enabled, Host/FreeBSD/release, Host/FreeBSD/pkg_info

Patch Publication Date: 2006/06/01

Vulnerability Publication Date: 2006/05/31