FreeBSD : mysql -- mysql_real_connect buffer overflow vulnerability (835256b8-46ed-11d9-8ce0-00065be4b5b6)

critical Nessus Plugin ID 19009

Synopsis

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

Description

The mysql_real_connect function doesn't properly handle DNS replies by copying the IP address into a buffer without any length checking. A specially crafted DNS reply may therefore be used to cause a buffer overflow on affected systems.

Note that whether this issue can be exploitable depends on the system library responsible for the gethostbyname function. The bug finder, Lukasz Wojtow, explaines this with the following words :

In glibc there is a limitation for an IP address to have only 4 bytes (obviously), but generally speaking the length of the address comes with a response for dns query (i know it sounds funny but read rfc1035 if you don't believe). This bug can occur on libraries where gethostbyname function takes length from dns's response

Solution

Update the affected packages.

See Also

https://bugs.mysql.com/bug.php?id=4017

https://lists.mysql.com/internals/14726

https://access.redhat.com/errata/RHSA-2004:611

http://www.nessus.org/u?bfc0a796

Plugin Details

Severity: Critical

ID: 19009

File Name: freebsd_pkg_835256b846ed11d98ce000065be4b5b6.nasl

Version: 1.25

Type: local

Published: 7/13/2005

Updated: 1/6/2021

Supported Sensors: Nessus

Risk Information

VPR

Risk Factor: Medium

Score: 6.7

CVSS v2

Risk Factor: Critical

Base Score: 10

Temporal Score: 7.4

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

Vulnerability Information

CPE: p-cpe:/a:freebsd:freebsd:mysql-client, 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

Exploit Ease: No known exploits are available

Patch Publication Date: 12/16/2004

Vulnerability Publication Date: 6/4/2004

Reference Information

CVE: CVE-2004-0836

BID: 10981

CWE: 119