Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 128713 - dev-db/mysql: Query Logging Bypass Vulnerability (CVE-2006-0903)
Summary: dev-db/mysql: Query Logging Bypass Vulnerability (CVE-2006-0903)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo Security
URL: http://cve.mitre.org/cgi-bin/cvename....
Whiteboard: B4 [noglsa] Falco
Keywords:
: 128714 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-04-03 16:16 UTC by Raphael Marichez (Falco) (RETIRED)
Modified: 2006-04-12 02:15 UTC (History)
1 user (show)

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


Attachments
Patch adapted from upstream for mysql-4.1.14 (mysql-4.1.14-logging-str0.patch,10.24 KB, patch)
2006-04-08 17:27 UTC, Raphael Marichez (Falco) (RETIRED)
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Raphael Marichez (Falco) (RETIRED) gentoo-dev 2006-04-03 16:16:48 UTC
MySQL is susceptible to a query-logging-bypass vulnerability. This issue is due to a discrepency between the handling of NULL bytes in input data. (www.securityfocus.com/bid/16850)

This issue affects at least <=4.1.14 and <=5.0.18

mysql_connect(...);
$result = mysql_query('/*'.chr(0).'*/ SELECT * FROM table'); 
$result2 = mysql_query('SELECT * FROM table'); 

it affects my system (4.1.14)

                     13 Query       /*
in place of
                     13 Query       select * from table

it provides to PHP the same results in $result than in $result2.
Comment 1 Raphael Marichez (Falco) (RETIRED) gentoo-dev 2006-04-03 16:19:30 UTC
*** Bug 128714 has been marked as a duplicate of this bug. ***
Comment 2 Raphael Marichez (Falco) (RETIRED) gentoo-dev 2006-04-03 16:26:08 UTC
i can't CC the herd :
<maintainer>
    <email>mysql_bugs@gentoo.org</email>
    <description>MySQL herd will not have a mysql@gentoo.org email</description>
</maintainer>

RCPT TO:<mysql_bugs@gentoo.org>
550 unknown user

Comment 3 Raphael Marichez (Falco) (RETIRED) gentoo-dev 2006-04-03 16:38:43 UTC
Should we correct the metadata in order to publish "mysql-bugs" and not "mysql_bugs"(@gentoo.org) ?
Comment 4 Matthias Geerdsen (RETIRED) gentoo-dev 2006-04-06 07:47:12 UTC
this is
http://bugs.mysql.com/bug.php?id=17667

are the latest stable and unstable (~arch) versions affected?

mysql team, pls verify/comment/update/...
Comment 5 Raphael Marichez (Falco) (RETIRED) gentoo-dev 2006-04-08 17:26:27 UTC
Hi,

upstream have corrected the bug :
http://bugs.mysql.com/bug.php?id=17667

For mysql-4.1.14, i've adapted a patch from http://lists.mysql.com/commits/4523

It works for me (compiles, runs and logs as expected) on x86, last stable (4.1.14)

I attach the patch here for gentoo mysql-4.1.14

Mysql team, could you please review the patch and then provide a new ebuild, if it is OK for you. Thanks
Comment 6 Raphael Marichez (Falco) (RETIRED) gentoo-dev 2006-04-08 17:27:13 UTC
Created attachment 84240 [details, diff]
Patch adapted from upstream for mysql-4.1.14
Comment 7 Francesco R. (RETIRED) gentoo-dev 2006-04-09 12:14:56 UTC
Many thanks Raphael, Chtekk is absorbed from real-life [tm] this we so I've added some work to what he started.

Current status:
MySQL 4.1.14, 4.1.18, 5.0.19 fixed and ready to test.
MySQL 4.0.x, 5.0 <19, 5.1.x are broken.
4.1.18 and 5.0.19 drop support for mysql_client_test.c, it should be easy enough to make it work again.

Personally I've done the testing over slotted MySQL, the plain one is still virgin but all the patches are there. On my system amd64/hardened both 4.1 and 5.0 are not vulnerable any more.

The overlay is available at:
http://svn.gnqs.org/projects/gentoo-mysql-overlay/browser/
svn co http://svn.gnqs.org/svn/gentoo-mysql-overlay/

patches are in the overlay but you can fetch them from 
http://dev.gentoo.org/~vivo/slotted_mysql/mysql-extras-20060409.tar.bz2
(required to build)


in replay to #c3, I've fixed also the metadata, sorry
Comment 8 Raphael Marichez (Falco) (RETIRED) gentoo-dev 2006-04-10 05:58:32 UTC
Hi,
Thanks Francesco.

Can mysql-team put the patches in the official portage tree ?

(As i have already said, patch for 4.1.14 (latest stable x86) is OK as for me.)
Comment 9 Francesco R. (RETIRED) gentoo-dev 2006-04-10 14:44:05 UTC
Committed, I don't have a box where to installa and test 4.1.14 in the exact shape it's in cvs at the moment, _but_ all things that vary with my tests are minor and don't overlap with this patch. Hope it's all good.

Comment 10 Tim Yamin (RETIRED) gentoo-dev 2006-04-10 14:51:21 UTC
We're not done here just yet; reopening :)
Comment 11 Raphael Marichez (Falco) (RETIRED) gentoo-dev 2006-04-10 14:57:08 UTC
Thank you plasmaroo;

since it's already in stable tree, it's time to vote on a glsa decision.

It's a minor issue but :
- mysql is *very* common.
- it affects *ALL* mysql distributions and versions around the world,
so i tend to vote yes.
Comment 12 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2006-04-10 16:08:09 UTC
I tend to vote NO.
Comment 13 Raphael Marichez (Falco) (RETIRED) gentoo-dev 2006-04-10 16:27:01 UTC
(In reply to comment #9)
> Committed, I don't have a box where to installa and test 4.1.14 in the exact
> shape it's in cvs at the moment, _but_ all things that vary with my tests are
> minor and don't overlap with this patch. Hope it's all good.
> 

Thanks Francesco for your commit, but :

on 3 different mirrors we got this :
!!! No message digest entry found for file "mysql-extras-20060316.tar.bz2."
!!! Most likely a temporary problem. Try 'emerge sync' again later.
(...)

You may have forbidden to include the MD5 digests in the files/digest-mysql-* (except 5.1.7_beta)
Comment 14 Thierry Carrez (RETIRED) gentoo-dev 2006-04-11 10:19:28 UTC
Most likely a temporary problem, I don't have it now.
I also tend to vote NO. Let's wait for one more man.
Comment 15 Raphael Marichez (Falco) (RETIRED) gentoo-dev 2006-04-11 15:13:13 UTC
> !!! No message digest entry found for file "mysql-extras-20060316.tar.bz2."

Sorry, i forgot to add that it was resolved a few hours ago. Thanks to vivo and other who have worked on bug #129548 , a silly issue concerning the portage cache which fills vars when they are left empty.
Comment 16 Raphael Marichez (Falco) (RETIRED) gentoo-dev 2006-04-12 02:15:03 UTC
this vuln is B4 and not A4, because it only affects full log ("log /path/file.log" in /etc/mysql/my.cnf), and not default configuration ("log-bin").

In the binary logs, this vuln can not be exploited.

This minimizes the score of the vuln. I'm not sure i'm votting "yes" anymore :)

So we have two full "No". Let's close the bug without glsa, if someone disagrees, feel free to reopen.

Thanks to mysql team and particulary vivo