Gentoo Logo

MySQL: Insecure temporary file creation in mysqlhotcopy


1.  Gentoo Linux Security Advisory

Version Information

Advisory Reference GLSA 200409-02 / MySQL
Release Date September 01, 2004
Latest Revision September 01, 2004: 01
Impact normal
Exploitable local
Package Vulnerable versions Unaffected versions Architecture(s)
dev-db/mysql <= 4.0.20 >= 4.0.20-r1 All supported architectures

Related bugreports: #60744


The mysqlhotcopy utility can create temporary files with predictable paths, allowing an attacker to use a symlink to trick MySQL into overwriting important data.

2.  Impact Information


MySQL is a popular open-source multi-threaded, multi-user SQL database server.


Jeroen van Wolffelaar discovered that the MySQL database hot copy utility (, when using the scp method, uses temporary files with predictable names. A malicious local user with write access to the /tmp directory could create a symbolic link pointing to a file, which may then be overwritten. In cases where mysqlhotcopy is run as root, a malicious user could create a symlink to a critical file such as /etc/passwd and cause it to be overwritten.


A local attacker could use this vulnerability to destroy other users' data or corrupt and destroy system files, possibly leading to a denial of service condition.

3.  Resolution Information


There is no known workaround at this time.


All MySQL users should upgrade to the latest version:

Code Listing 3.1: Resolution

# emerge sync
# emerge -pv ">=dev-db/mysql-4.0.20-r1"
# emerge ">=dev-db/mysql-4.0.20-r1"

4.  References


Page updated September 01, 2004

Summary: This is a Gentoo Linux Security Advisory

Security Team
Contact Address

Donate to support our development efforts.

Copyright 2001-2015 Gentoo Foundation, Inc. Questions, Comments? Contact us.