Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 117607 - Security hole in manual MySQL upgrade guide
Summary: Security hole in manual MySQL upgrade guide
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL: http://www.gentoo.org/doc/en/mysql-up...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-03 07:45 UTC by Clock
Modified: 2006-01-04 06:53 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Clock 2006-01-03 07:45:02 UTC
In 3 places the root MySQL password is passed in the --password option. So
any n00b user on the machine can see it in the process listing output. This
is a security hole like a pig. If he sees it, he has root MySQL access on the machine.

Also when someone walks by the screen he can read the password and later gain root access on the machine's MySQL.

mysqldump \
  -uroot \
  --password=your_password \
  -hlocalhost \
  --all-databases \
  --opt \
  --allow-keywords \
  --flush-logs \
  --hex-blob \
  --master-data \
  --max_allowed_packet=16M \
  --quote-names \
  --result-file=BACKUP_MYSQL_4.0.SQL

# cat BACKUP_MYSQL_4.0.SQL \
     | mysql \
     -uroot \
     --password=your_password \
     -hlocalhost \
     --max_allowed_packet=16M

# mysql_fix_privilege_tables \
     --defaults-file=/etc/mysql/my.cnf \
     --user=root \
     --password=your_password
Comment 1 Tom Knight (RETIRED) gentoo-dev 2006-01-03 07:51:01 UTC
You should probably check things before you file bug reports, mysql hides the password from the ps list:

tomk      7944  0.2  0.5   5128  2172 pts/18   T    15:49   0:00 mysql -uroot -px xxxxxxxxx
Comment 2 Clock 2006-01-04 06:53:46 UTC
It's done in a way that bash does exec into mysql and mysql then overwrites the
commandline. However there exists short time when the password can be read. This short time is still a serious security hole.

When the user performs a temporary DoS attack on the machine, he can slow down
the scheduling and pageouts so much that he can actually intercept the password.