Advertisement






mysql-5.5/5.5.31+dfsg-0+wheezy1 Insecure creation of debian.cnf

CVE Category Price Severity
CVE-2013-5792 CWE-276 Not specified High
Author Risk Exploitation Type Date
Unknown High Local 2013-06-08
CPE
cpe:cpe:/a:mysql:mysql-5.5.5-31.dfsg-0+wheezy1
CVSS EPSS EPSSP
CVSS:4.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H 0.06052 0.78443

CVSS vector description

Our sensors found this exploit at: http://cxsecurity.com/ascii/WLB-2013060066

Below is a copy:

The file "/etc/mysql/debian.cnf", which contains plain text credentials
for the "debian-sys-maint" mysql user, is created in an insecure manner
during the package installation phase.  This can lead a non-privileged
local user to disclose its content and use this special account to
perform administration tasks.

The file is created by the post-installation script:

  $ vim -c "set nu" mysql-5.5-5.5.31+dfsg/debian/mysql-server-5.5.postinst
  [...]
  170     dc=$mysql_cfgdir/debian.cnf;
  [...]
  176         cat /dev/null > $dc
  [...]
  178         echo "[client]" >>$dc
  179         echo "host     = localhost" >>$dc
  180         echo "user     = debian-sys-maint" >>$dc
  181         echo "password = $pass" >>$dc
  [...]
  191     chown 0:0 $dc
  192     chmod 0600 $dc
    
There is a time lapse (between lines 176 and 191) where the file
permissions are 644 (settled by the default umask).  At this time, a
user can open the file with the O_RDONLY flag and disclose its content
even after the chmod is executed at line 192 (yes, the user's file
descriptor won't be affected by this action).

Anyway, I suggest to force a umask value to 077 before this file is
created.

I have a trivial PoC if needed.


Copyright ©2024 Exploitalert.

This information is provided for TESTING and LEGAL RESEARCH purposes only.
All trademarks used are properties of their respective owners. By visiting this website you agree to Terms of Use and Privacy Policy and Impressum