Slashdot Mirror


Remote hole, DoS in MySQL

Wee writes "I just saw two pretty nasty vulnerabilities in MySQL were announced today by a German company called e-matters. From the annoucenment: "We have discovered two flaws within the MySQL server that can be used by any MySQL user to crash the server. Furthermore one of the flaws can be used to bypass the MySQL password check or to execute arbitrary code with the privileges of the user running mysqld. We have also discovered an arbitrary size heap overflow within the mysql client library and another vulnerability that allows to write '\0' to any memory address. Both flaws could allow DOS attacks against or arbitrary code execution within anything linked against libmysqlclient." Version 3.23.54 fixes the issues in 3.x. I couldn't find a patched version for the 4.0 beta."

68 comments

  1. Hold on ... by The+Whinger · · Score: 4, Insightful

    Whilst it is good that we are made aware of these things, and that e-matters waited for MySQL to release a patched version, it would have been nice if they had waited for the common distributions to catch up aswell.

    After all - these bugs are pretty serious.

    1. Re:Hold on ... by Anonymous Coward · · Score: 1, Informative

      The distributors got the Patch from MySQL-AB several days before yesterday.

    2. Re:Hold on ... by The+Whinger · · Score: 1

      Ahhh - okay ... another good reason to roll-your-own.

    3. Re:Hold on ... by Anonymous Coward · · Score: 0

      roll your own database software?

    4. Re:Hold on ... by The+Whinger · · Score: 1

      Yeah *of course* ... I have a spare five minutes.

      I meant package ... but you knew that.

  2. I'm switching to postgres by Adrian+Voinea · · Score: 2, Funny

    Well, now I have a really good reason to switch to postgres...
    And the mandatory communist comment: in Soviet Russia, mysql finds holes in YOU!

    1. Re:I'm switching to postgres by REBloomfield · · Score: 1

      So what makes postgres so great? All programs have holes, and the ones that claim they don't are lying.
      Come on people, open source holes have overtaken Microsoft's now, but this is a good thing. If they're being found they're being closed. This ism a good thing for the community at large.

    2. Re:I'm switching to postgres by Anonymous Coward · · Score: 1, Insightful

      Well, it's harder to use, has less GUI interfaces, has a bellicose user community, and has less overall support. Why haven't you switched?

    3. Re:I'm switching to postgres by REBloomfield · · Score: 0, Flamebait

      Because I'm an evil Windows Admin who is very happy with SQL Server, warts n all.
      When I have used databases on Linux, they've been Oracle, and that was purely to do a comparison to SQL Server. Horrible interface... eww... worse than DB2....
      And watch the flames roll in... :)

    4. Re:I'm switching to postgres by Anonymous Coward · · Score: 0

      I'm with you there. DB2 was a complete abortion of a software package. All that java shit fucking slowing things down. SQL server really isn't that bad. I've got no problems with it. I hate the sick fascination with ODBC and all, why people just don't stick with OLE DB is beyond me, if they have to use shit like that at all.

    5. Re:I'm switching to postgres by noselasd · · Score: 1

      I have switched, when I realized mysql was pretty much a toy, and saw it didn't even understand slightly complicated SQL.

    6. Re:I'm switching to postgres by gregfortune · · Score: 2

      Interesting... What might you consider slightly complicated SQL? I assume at least one example will address sub selects, so please include something in addition to a sub select complaint. Generally, an intelligent developer can solve a query problem without using a sub select and the end solution tends to be much faster...

    7. Re:I'm switching to postgres by larry+bagina · · Score: 1

      Red Hat db uses postgresql with some gui control programs thrown in.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    8. Re:I'm switching to postgres by Anonymous Coward · · Score: 0

      sure. SELECT women WHERE gregfortune got laid ; 0 records selected.

    9. Re:I'm switching to postgres by tzanger · · Score: 1

      What might you consider slightly complicated SQL?

      Triggers, foreign keys, stored procedures, fast ACID-compliance, SQL95-compliance, no bullshit hacks like "*" to increment...

  3. announce@lists.mysql.com by mnordstr · · Score: 5, Informative

    Hi,

    MySQL 3.23.54, a new version of the world's most popular Open Source
    Database, has been released. It is now available in source and binary
    form for a number of platforms from our download pages at
    http://www.mysql.com/downloads/ and mirror sites.

    This is a bugfix release for the current stable tree.

    Apart from fixing several bugs, this release also resolves multiple
    security vulnerabilities that have been found and reported to us by Stefan
    Esser from e-matters GmbH, Germany. You can read the full text of Stefans
    advisory here:

    http://security.e-matters.de/advisories/042002.h tm l

    We are very grateful for his help in spotting and reporting this problem
    to us.

    As these vulnerabilities can be exploited from a remote attacker to crash
    the MySQL server or to execute arbitrary code with the privileges of the
    user running the MySQL server, we strongly advise all users to upgrade to
    this version.

    MySQL 4.0 is also affected by this problem - we will provide updated
    packages for this version as soon as possible, too. The required fixes
    have already been applied to our public BitKeeper source repositories as
    well.

  4. this is how i crashed mySQL server by stonebeat.org · · Score: 2

    I was writing a complex WHERE clause with multiple ANDs and ORs and I forgot to put the parentheses around OR statements, and that crashed the whole mysqld. If anyone wants to see the query, let me know. Worked fine after I added the parentheses.

    1. Re:this is how i crashed mySQL server by HaloZero · · Score: 1

      /me narrows eyes, looking down at you in dentists-office-esque chair...

      Neo-stonebeat.org: "I know.... how to crash mysqld."
      HaloZero: "Show me."

      [poof]A complex computer construct appears.

      --
      Informatus Technologicus
    2. Re:this is how i crashed mySQL server by Mark+Round · · Score: 5, Funny

      "I was writing a complex WHERE clause with multiple ANDs and ORs and I forgot to put the parentheses around OR statements, and that crashed the whole mysqld."

      It was like "bleep bleep bleep bleep bleep". It was a really good query. It was like... a bummer.

  5. MySQL vs PostgreSQL by Atomizer · · Score: 2, Funny

    If MySQL was a real database, like PostgreSQL, you could just roll-back the DOS and be back up and running. ;)

    1. Re:MySQL vs PostgreSQL by gregfortune · · Score: 2

      I assume this is just a troll, but I'll bite. MySQL has supported transactions for quick a while. Please save me some time and do your research...

    2. Re:MySQL vs PostgreSQL by bovinewasteproduct · · Score: 3, Interesting

      Yeah...

      Got money for the hotbackups? They cost.

      How about working FKs? I mean if I can drop an entire table that FKs pointing it, not much intergerity is there?
      On a different note, has anyone done a decent set of benchmarks comparing MySQL with transactions to PostgreSQL? That would be nice to see.

      BWP

    3. Re:MySQL vs PostgreSQL by Atomizer · · Score: 1

      Not a troll, just a lame joke.

    4. Re:MySQL vs PostgreSQL by gregfortune · · Score: 2

      Got money for the hotbackups? They cost.
      ??? I'm not sure if I understand your complaint. Online backup is already available and much improved support is coming in 4.0/4.x. See here and here In addition, replication is not a bad way to build some fault tolerance into your system. I'm not claiming that any of these features are perfect or that they fit your exact needs. I'm merely pointing out that they exist.

      How about working FKs? I mean if I can drop an entire table that FKs pointing it, not much intergerity is there?
      Don't know what to tell you there. I know foreign key support is planned, but I'm handling all my data integrity inside my apps. InnoDB tables are supposed to support foriegn keys, but again, I don't know how complete the support is as I haven't used them...

      On a different note, has anyone done a decent set of benchmarks comparing MySQL with transactions to PostgreSQL? That would be nice to see.
      Yes, but I don't see any that don't look biased towards MySQL...

    5. Re:MySQL vs PostgreSQL by tzanger · · Score: 1

      I know foreign key support is planned, but I'm handling all my data integrity inside my apps.

      And with that, we discover that gregfortune is not a database admin. By a long shot. It is simply not possible to achieve true ACID conformance and have your data integrity outside the database!

  6. Uggh, I can't believe this by Anonymous Coward · · Score: 0

    The last thing I would ever want on my K-RAD 31337
    Sun Box is a stupid program that will turn my Sun Box
    into a crappy DOS box. I hate DOS! I hate windows too.

  7. What you say? by Anonymous Coward · · Score: 0

    How come this is not on the front page? Every time there's a small Javascript bug in IE that could possibly change your desktop background colour if you bought your PC in 1996 and your name is Jack or something absurd like that, it gets on the front page. THIS is a very serious set of vulnerabilities, why the hell is it not on the front page?

    1. Re:What you say? by Anonymous Coward · · Score: 0

      *mumble mumble* ...security through obscurity... *mumble mumble*

    2. Re:What you say? by MikeFM · · Score: 2

      Probably opensource bugs don't often make the frontpage because any good Linux admin already knew about this, has downloaded the patched source code, and already fixed it. Lucky for us our software providers send us email to tell us there are problems and include instant updates to fix them. ;)

      Besides by the time you could even touch MySQL through my firewall you'd more likely have moved on to easier prey. IE is usually used by sheep that don't know when security problems exist, don't know how to fix them, and are usually not told by their software provider or given a way to make that fix until way to late.

      Even if you did get inside my database you couldn't get into the rest of my OS because I am not stupid enough to run MySQL as root. With Windows/IE a minor bug can trash the entire system. Users are also less likely to make frequent backups.

      However... I would not mind all major security problems such as this making the frontpage. To alert people that don't follow their email warnings close enough. :)

      --
      At what price learning? At what cost wisdom? The price is a man's peace of mind, and the cost is his life.
    3. Re:What you say? by Anonymous Coward · · Score: 0

      How true. No minor bug has EVER trashed a unix system. EVER. EVER. EVER. (eyeroll)

    4. Re:What you say? by 00_NOP · · Score: 2

      Don't you get it? 90% + of all computer users are using IE, that means a hole there is mega important. Now, I wish it were the case that holes in MySQL and other free software were as important, but with the exception of a few things (such as Apache) we aren't there yet. But don't worry, the day will come when free/OSS software rules the world and then these things will be all over the front page. And guess what, because we can see the sources we will be able to fix them too.

  8. Wow. by budalite · · Score: 3, Funny

    As a CSE student, (albeit one that is generally twice the age of most of his fellow students) I am really looking forward to the day in my programming where my mistakes don't show up until way, way after the final grades are published.

    1. Re:Wow. by Anonymous Coward · · Score: 0

      At which point a horrible database bug wipes out all of records of you ever being in school.

  9. Not on front page? by Alizarin+Erythrosin · · Score: 5, Insightful

    Seeing as how there may be a number of /. readers who might not catch this story but probably should know about it, why isn't it on the front page?

    --
    There are only 10 kinds of people in this world... those who understand binary and those who don't
    1. Re:Not on front page? by IceCat · · Score: 1

      Because it's not a MS security hole....

      Seriously though I would have thought this should have been on the front page too. It certainly seems news worthy enough.

  10. Another open source success story! by Anonymous Coward · · Score: 0

    hooray! Bugs like this prove that the open source model works! After all, many eyes make all bugs shallow. Imagine if this was a Microsoft bug. Fortunately, it was an open source bug, so we can be guaranteed that eventually it will be found and fixed, and maybe your favorite distro will update it so we don't have to bother compiling it ourselves. 3 cheers for open source!

  11. risk assessment by ubiquitin · · Score: 5, Informative

    So what are the risks involved with not patching your MySQL install ASAP? Should we expect script kiddies to have exploits in their hands in days, weeks, months?

    The two flaws in the MySQL server involve TABLE_DUMP and CHANGE_USER, neither of which are typically done regularly, unless you're using dump to backup your db. Interesting that anything that is linked against libmysql is potentially vulnerable to the read_rows Overflow. This means that PHP/Apache/Perl andthere the OS could in theory be exploited this way, though the attacker would have to have some pretty generous write access to the database first. Both client vulnerabilities demand that you feed data into rows that your client is requesting.

    The most interesting part of this, by far is the final comment: "Finally it must be mentioned that an attacker can of course use a combination of the described attacks to break into a system or to get access to privileges he normaly does not own. f.e. it is possible for a local user to crash the server with the COM_TABLE_DUMP bug (if he cannot takeover the root account with the COM_CHANGE_USER bug) and then bind a fake server to the MySQL port 3306. And with a fake server he can exploit the libmysqlclient overflow. Another scenario would be an attacker that tries to exploit his favourite mod_scripting language to takeover the webserver by connecting to an external fake server... "

    My two cents? Man-in-the-middle attacks are pretty damned hard to pull off, even when the stakes are high and you've got the most skilled cracker interested. Keep current on MySQL releases on a quarterly basis and you should be OK. YMMV

    --
    http://tinyurl.com/4ny52
    1. Re:risk assessment by Anonymous Coward · · Score: 0

      Well it is a shame that you are obviously doing PHP consulting. Telling your customers that they are safe just shows how little you know about the real world. Your comments is totally bogus. Because it is not the admin or trusted user that uses COM_TABLE_DUMP or COM_CHANGE_USER. It is the evil one. In a shared environment, where people upload their PHP scripts to a multiuser system they are able to compromise the whole database and maybe even the server, because constructing a PHP script that exploits the libmysqlclient vulnerabilities is trivial (You must no store anything within the local MySQL server, you can simply do an outbound connect to another box that runs a fake server)... All an attacker needs is a little sniffed FTP password and he gets a shell on your box...

      Ohh well... Maybe you are right... According to M$ executing arbitrary code is just a moderate risk...

    2. Re:risk assessment by Anonymous Coward · · Score: 0

      luckily all my boxes use the socket not the tcp/ip port to talk to mysql. skip-networking is also default in debian.

      no big deal then.

    3. Re:risk assessment by drinkypoo · · Score: 3, Informative
      You know, there are people out there who could put together an exploit for so quick that it would make you crap yourself to see it. All it requires is a working knowledge of assembler and an understanding of OS internals. Modern systems are pretty complex but definitely not beyond the realm of understanding.

      Of course if he CAN take over the root account then you're screwed any way you go... What I find telling is that the best way to pull off an attack is to do it locally, so once again you will have trouble getting in remotely. We hope. You can probably crash the system remotely pretty reliably, but should have trouble rooting it. That's a major annoyance and could cost you money (though if I had anything that demanded guaranteed uptime, mysql would be an option I considered sometime after writing my own RDBMS) but at least does not open you to other attacks.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    4. Re:risk assessment by RAMMS+EIN · · Score: 1

      The point is not how hard you think it is to do an exploit, the point is that there is a hole to be exploited. Holes should be patched. Period.

      --
      Please correct me if I got my facts wrong.
    5. Re:risk assessment by Anonymous Coward · · Score: 0

      ps, and an account on the potentially vulnerable system with access to mysql. Here's a good rule of thumb: even for OpenBSD. If they have a login, they can get root.

  12. Re:Yet more reason to use postgresql... by Anonymous Coward · · Score: 0
    slashdot has anti-hack measures in place.

    Namely, by using linux and MySQL, they guarantee that they boxes will go down faster than Hemos in the men's room of a truck stop, thereby preventing [cr|h]ackers from breaking in.

  13. the hole by Anonymous Coward · · Score: 0
    for anybody that's interested, here is MySQL security hole.

    And here is Your Asshole

  14. Hot Backups by ttfkam · · Score: 2
    Don't you read your own links? What part of "InnoDB Hot Backup is a non-free additional tool which is not included in the standard MySQL distribution" is unclear to you?

    He didn't say it didn't exist. He said that it costs money and doesn't come with the main distribution.

    Don't know what to tell you there. I know foreign key support is planned, but I'm handling all my data integrity inside my apps.

    Precisely where it shouldn't need to be. You should be able to make a database schema, populate it with data, and know that your data is safe and consistent. Any bad db admin can muck up a schema, but MySQL prevents the good DB admins from doing their job properly.

    It is rare that any non-trivial application has only one developer or cohesive group. Database schemas are usually designed by a single person or core group. Can you assert that everyone you work with will clean the user input correctly or work delete a record that another record depends upon? If you design your schema correctly, the DELETE either fails or deletes all of the records that relate to it depending on what data model you choose. An INSERT, UPDATE, and DROP is similarly constrained -- and all or nothing affair with no ambiguities in between.

    Your app code can have some checks. Too many checks never hurts quite as much as too few. With PostgreSQL, SAP DB, Oracle, MS SQL, Sybase, DB2, etc., the database is a valid last line of defense against invalid data. They can be made to NOT ALLOW bad data to enter or become bad after it's in. This is the default behavior and not a special set of tables you choose when you download the "Max" version.

    If your data is important enough to store, it's important enough to protect. If integrity doesn't matter as much, if your data isn't that important, just use a flat file -- it's much faster for reads and caches well. Or you could put SQUID in front of your web app in which case the database needs to be just fast enough...

    Now then, a question: Does MySQL have support for cell constraints like limiting an integer field to a value between 15 and 90 or making sure that a text field has at least seven characters or matches a valid social security number? This is not flamebait; I don't know, and I'm curious. I don't see mention of them on a search of "constraint" on the mysql.com. I certainly hope it does or I'll have a new thing to bitch about with MySQL.
    --

    - I don't need to go outside, my CRT tan'll do me just fine.
    1. Re:Hot Backups by gregfortune · · Score: 3, Interesting

      Don't you read your own links? What part of "InnoDB Hot Backup is a non-free additional tool which is not included in the standard MySQL distribution" is unclear to you?

      I honestly missed that one :( Although I haven't researched it much, it does sound like the new stuff coming in 4.0 is really cool though. Also, like I mentioned, replication might be a very good solution...

      In reply to the foreign key and constraints discussion, it happens to be built into my schema. The schemas I'm creating now create type/size/regex match/etc contraints that get compiled into the program automagically. Another developer and myself have created an object to relational mapping compiler that will translate our "nifty" schema into an object based wrapper over the database. Anyone using the wrapper can be guarenteed that contraints will be enforced, etc. Also, things like foreign key contraints are handle automatically or subclassed for tricky relationships.

      In addition, I hate seeing error messages come back from the db. If I can handle all the errors client side, clean data is the *only* thing that gets submitted. I know it's not the accepted way of doing things, but it works very well.

      Does MySQL have support for cell constraints like limiting an integer field to a value between 15 and 90 or making sure that a text field has at least seven characters or matches a valid social security number?

      I honestly don't know as I haven't needed or wanted it. See above.

      This might lead me to believe that support exists though... FOREIGN KEY is ignored, but I think CHECK included and executed...

      or [CONSTRAINT symbol] FOREIGN KEY index_name (index_col_name,...)
      [reference_definition]
      or CHECK (expr)

      Another benefit of what I'm doing allows me to quickly port my apps to other databases. Once the layer for Postgres is created in the compiler, I just recompile on the schema, and boom - I have a object layer for a postgres database based on my cool schema in C++, Python, Java, and PHP (assuming the layers for those languages are present in the compiler). All in all, I should be able to write the backend for a company's point of sale GUI *and* their inventory website in a single schema definition.

    2. Re:Hot Backups by ttfkam · · Score: 2
      Anyone using the wrapper can be guarenteed that contraints will be enforced, etc. Also, things like foreign key contraints are handle automatically or subclassed for tricky relationships.

      In addition, I hate seeing error messages come back from the db. If I can handle all the errors client side, clean data is the *only* thing that gets submitted. I know it's not the accepted way of doing things, but it works very well.

      Every other database has the philosophy that bad data is not allowed. Period. What happens when you leave your company -- or you're on vacation -- and the new guy who is familiar with MySQL just decides to whip up a script to perform some query on the database?

      I'm not trying to say that what you have doesn't work for you. I'm saying that what you have is vulnerable to circumvention without malice.

      As a side note, your engine sounds conspicuously like EJBs and the .Net framework. Does anyone but you know how to use this persistence layer? Is it distributable?
      In addition, I hate seeing error messages come back from the db. If I can handle all the errors client side, clean data is the *only* thing that gets submitted. I know it's not the accepted way of doing things, but it works very well.

      Ummm...so? Java can catch SQL Exceptions, C can check error codes, Perl can trap any error message with eval. If you are seeing messages from the database when you didn't intend to, you have done something wrong. Don't blame the database engine. This is an app layer bug.

      In other news, I raise exceptions in stored procedures all of the time. Those error messages are clear, concise English phrases that I specify.

      For example, I have this statement in one of those stored procedures called from an insert and update trigger:
      RAISE EXCEPTION "The password must be at least six characters!"
      Seems to me like a friendly and useful database error message to me.
      Another benefit of what I'm doing allows me to quickly port my apps to other databases. Once the layer for Postgres is created in the compiler, I just recompile on the schema, and boom...

      This is a good thing, but it doesn't justify the use of MySQL; It only justifies the use of your object layer. If you took out MySQL support, you could have triggers, stored procedures, views, advanced constraints, custom data types, rules, etc. when you moved from database to database. Why limit your options with MySQL? If it's so that you can support everything, do you also support comma-separated-value files through ODBC as well, or would that be silly? There is always a lower level of functionality.

      Just as you wouldn't waste your time with CSV over ODBC because of limited functionality and brittleness, why do you waste your time with MySQL?

      Is MySQL faster for SELECTs? Sure. But what people don't seem to get is that with all of those "useless" features of real RDBMSs, you can make a schema that enforces correct data (reducing processing time and complexity in the app layer), and you can have triggers and rules modify cache tables that give commonly used data and/or last-modified info. I don't care how fast MySQL has been or wil be; The fastest queries will always be the ones that you don't have to make as many times. The best use of a database is usually where you don't have to send as much data over the wire in communication.

      Example: You have dynamic content, but the interval between updates is large enough to justify caching.

      Using MySQL, you would have to insert the data with a timestamp (don't forget the index on the column!), make a query for the newest timestamp using a MAX aggregate, check the timestamp against the cache timestamp, make the real query if the timestamp's newer than cache, get the results back, and update the cache timestamp. Note that you would have to remember to update an entry's timestamp in every part of the code that would ever make updates the table(s). And of course, this is only a single table for granularity. For joins, you would have to do multiple max timestamp checks.

      With the others, you would make a cache table with just one timestamp entry for the query -- no matter how many tables it spanned. Note that you have already saved rows*sizeof(timestamp)*tables in space over MySQL as a bonus, so your tables are more likely to fit into physical RAM for greater performance. Next you would write an insert and update trigger for the tables that would update this cache timestamp value on changes. The logic for this is located in only one place: the source of the data.

      Using a database other than MySQL, you would insert the data without a timestamp (handled internally by the database), SELECT on the very small cache table for one entry, compare against your local cache timestamp, make the real query if the timestamp's newer than cache, get the results back, and update your app cache.

      I don't care how fast you think MySQL is. It will never be able to make repeated "SELECT MAX(modified) FROM bigtable;" calls faster than repeated "SELECT modified FROM cache WHERE key = 'somedatamodel';" The overhead of updating a single or small number of rows to change a timestamp value is lost in the overall insert or update processing (no index and it's update overhead is necessary for that small a table). And any client, custom object model or no, will work.

      THIS is why I have a problem with MySQL. It isn't some esoteric feature. I want to scale. No database benchmark will adequately demonstrate this when all it is comparing is SELECT and INSERT performance. I want to set up my database and go -- not constantly tweak my app layer to fudge a few milliseconds of processing time less or sacrifice data dynamism. It's not that the other databases are more feature-rich; MySQL is feature-poor. Will it work for small installations? Sure, but so will any other database out there. The small problems are easy. It's the big problems -- or the small problems that steadily grow -- that demand our attention.

      If you want to use it, that's your decision. But don't delude yourself or others into thinking it is the optimum solution.
      --

      - I don't need to go outside, my CRT tan'll do me just fine.
    3. Re:Hot Backups by Anonymous Coward · · Score: 0

      If your data is important enough to protect it's important enough to check before storing it. Why the hell don't we build transactional and caching logic into the disk heads while we're at it?

      I'm not saying MySQL is the ideal solution, but there comes a point where you want to separate functionality. You do not want the same subroutine responsible for writing and retrieving data from the disk to be in charge of a $15 - $90 price range (probly in $1.25 increments).

      A database should store data, not your fucking sales prices or the enumerated list of countries you do business in. I didn't say that you should do it all in JSPs either.

    4. Re:Hot Backups by Anonymous Coward · · Score: 0

      RAISE EXCEPTION "The password must be at least six characters!" Seems to me like a friendly and useful database error message to me.

      No, no no no no NO NO NO!!!!!!

      That's a nice friendly application error message.

      If your client application is isql or SQL+, that's fine, but you should really think about separating your user interface from your persistence layer.

      There's a whole bright world out there beyond punch cards.

    5. Re:Hot Backups by ttfkam · · Score: 2

      You bring up an interesting point. Although I must tell you that there is already caching done within the hard drive already (not at the head level though ;-)), transactions are indeed an issue with drives. Drives will commonly tell an operating system that it's done writing when the data is still in the cache and not yet on the platter. People have been grappling with the problem of speed vs. data integrity.

      Re: separating functionality
      I do separate functionality. My logic layer and my presentation layer (they are separate for you too right?) can make checks for data validity as well. In fact, I recommend it. It hurts far less to check a value twice than to forget to check it even once.

      Ummm...when did I say anything about country lists and sales prices? Think carefully. Check my post. I talk about data: the cleanliness of that data, the integrity of that data, the status of that data, etc. I never talk about doing advanced logic. Then again, why wouldn't you save a list of countries (and the most up to date info on exchange rates) in the database? Or were you talking about user interface translations (which I wasn't). Why wouldn't you have sale prices for items sold during sales? You would keep that info wouldn't you? You would want to know that the item sold for $12 instead of $18 wouldn't you?

      Side note for those who didn't get the memo yet: database transactions != financial transactions. Database transactions can be used to facilitate financial transactions, but they are not and have never been the same.

      --

      - I don't need to go outside, my CRT tan'll do me just fine.
  15. MOD THIS UP by drinkypoo · · Score: 2
    (only one to go till 5 anyway)

    This is something that affects tons of us. I have MySQL installed both under linux and Windows XP... Does this flaw exist on all platforms?

    --
    "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
  16. Self-compile blues by phorm · · Score: 2

    Unforunately, if you compile your own with RH8 (or at least on my machine) the new version chokes and dies... big time. Seems there may be an issue with the glibc on this distro?

    1. Re:Self-compile blues by Anonymous Coward · · Score: 0

      Did you check the .spec file Redhat uses to build 2.23.52-3 and try using those configure options? Unless they applied patches and tarballed the whole thing(not impossible but unlikely) it looks like the only patch is for manpage errors so it's probably a straight build of 3.23.52.

  17. Wait, this can't be that serious. by Anonymous Coward · · Score: 0

    It's not a Microsoft product.

    Despite the fact that there are probably more installations of MySql than SQL Server, or something. Ah, who cares. It's not about MS, therefore it's not actually news.

  18. bind on '127.0.0.1' only by Kunta+Kinte · · Score: 3, Informative

    As a precaution...

    If you can get away with it, which is true for many people, bind only on local loopback address. Add the '--bind-address=127.0.0.1' in your mysqld startup script, eg. /etc/init.d/mysqld

    This causes mysql to only allow connections from the local machine. Eg. if you have apache and mysql running on the same physical computer, and you always use 'localhost' or '127.0.0.1' in your scripts. Not only is it faster ( marginally, I guess ) but it's slightly more secure as well.

    --
    Based on upvotes, Ageism is the only "-ism" Slashdotters care about and think isn't SJW
  19. MySQL developer jobs by Anonymous Coward · · Score: 0

    For whatever it's worth, if you're looking for
    work in the Beaverton, Oregon area, the
    Open Source
    Development Lab today posted a req for a
    Perl/MySQL developer. They do 100% non-profit,
    open source work on the Linux kernel and open
    source in general.

  20. Bad reason to switch. by TheLink · · Score: 2

    Given what databases are I'd only let trusted people access to them. You'd be courting trouble exposing your MySQL/Postgresql/Oracle server to untrusted parties (whether internal or external).

    1) Many DBs store important/critical data.
    2) Most DBs were never designed for hostile environments. Plus I haven't encountered a situation where you really need to expose DBs to the big bad world.
    3) The people writing DBs seldom concentrate on security - they have lots of other things to do.

    --
  21. Wrong for many O/S platforms. by TheLink · · Score: 4, Informative

    Many O/Ses have weak end host bindings.

    Which means that any of the IP addresses existing on the host can be reached from any interface on the host even if IP forwarding is off.

    This means that if the attacker is on the same LAN they can hit your 127.0.0.1 (or from other networks if 127.0.0.1 is routed to your box via other routers for some unusual reason).

    This is true for at least some versions of Linux. True for FreeBSD and many other Unixes. Does not appear to be true for NT/Windows 9x (if it works it means IP forwarding is on).

    How to test:
    Let Target=A with service listening on 127.0.0.1. No firewalling on A.

    Attacker using B disables 127.0.0.1 on B. Sets up static route to 127.0.0.1 via A.

    Attacker can now ping/scan A's 127.0.0.1.

    You may not be able to test this on some versions of Linux because even if you bring down/ delete the 127.0.0.1 interface it seems to stay hardwired - the packets don't leave the machine. I got this sort of thing to work in the days of Linux 2.0.x. Seems 2.4 is weak end, dunno about 2.2 (seems not to be but some reports say otherwise).

    Try it from a cisco router - they don't come with 127.0.0.1 by default.

    --
    1. Re:Wrong for many O/S platforms. by ChocoboKnight · · Score: 1

      On FreeBSD try: # route add -net 127. -netmask 255.0.0.0 -iface lo0 -blackhole

  22. thumbs up! by Anonymous Coward · · Score: 0

    This is the way security bugs should be dealt with. All praise the Germans who have the decency to report to the developpers first and *then* to the general public.

  23. not as bad as it seems... by smartfart · · Score: 4, Interesting
    Unless I'm misunderstanding this, these are local exploits only. No one can use these bugs unless he has a valid mysql account on the server in question. These vulnerabilities cannot be used by an external attacker (a website user, for example) to h4x0r the box.

    In other words, my servers are not vulnerable. No one else but me has accounts on my boxen. Only a production box (a shell box doing web hosting, for example) where you have untrusted users would be vulnerable.

    I'll update my box just as soon as my distro has a patch available, sure, but this event is a non-issue for me (this time).

    1. Re:not as bad as it seems... by Anonymous Coward · · Score: 0

      No, anyone who has mysql access to your machine can exploit them

  24. cascaded deletes by DrSkwid · · Score: 2

    delete from table1, table2 where table1.id=table2.table1_id;

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    1. Re:cascaded deletes by gregfortune · · Score: 2

      From the docs...

      The multi table delete format is supported starting from MySQL 4.0.0.

  25. It's important for some folks... by Ironica · · Score: 3, Interesting

    I just put in a support ticket with my hosting company, after checking the version of MySQL they're running (3.23.53a). It's virtual hosting with many people all on the same server, and most users have MySQL database access.

    So if you are running your own server and have the option of closing it off, yeah, this doesn't matter... but that's not the whole world.

    --
    Don't you wish your girlfriend was a geek like me?
  26. There is no MySQL 4.0.0 yet by DrSkwid · · Score: 2

    And I already knew that

    --
    There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
  27. Hahahaha!!! by ttfkam · · Score: 2
    My user interface *is* separate from my persistence layer. Dear god man! Is your user interface really that simplistic?

    I'll tell you what. I'll give you a code snippet and see what you think about it.
    CREATE TABLE "lusers" (
    "id" serial NOT NULL,
    "username" character varying(32) NOT NULL CHECK (length(trim("username")) > 2),
    "password" character(34) NOT NULL CHECK (length(trim("password")) = 34),
    Constraint "luser_pkey" Primary Key ("id")
    );

    CREATE OR REPLACE FUNCTION set_password() RETURNS opaque AS
    'DECLARE
    clear_password text;
    BEGIN
    clear_password := trim(NEW."password");
    IF length(clear_password) < 6 THEN
    RAISE EXCEPTION ''Password must be at least six characters'';
    END IF;
    NEW.password := crypt(clear_password,gen_salt(''md5''));
    RETURN NEW;
    END;' LANGUAGE 'plpgsql';

    CREATE TRIGGER "lusers_password_trigger"
    BEFORE INSERT OR UPDATE ON "lusers"
    FOR EACH ROW EXECUTE PROCEDURE set_password();
    Hmmm...at first glance, this may seem like a lot of logic to have in your database, but look closer. If someone tries to put in a password less than six characters, it fails. Clients do not have to learn how to use MD5 or how much padding is used in all implementations. This means that anyone, in any applicable query, with any client -- and is authorized to make changes to the database -- who makes an INSERT or UPDATE on the users table will have constraints put upon them. Once you get at least five developers together on a project, the methods for talking to the persistence layer will drift -- perhaps just slightly, but it will drift.

    And now hear this: nothing is stopping you from making additional application checks at the client level for data integrity. In fact, it makes sense so that you don't have to make the persistence roundtrip. However, you should not overlook the fact that you cannot put a bad value into my database schema. The database simply won't accept it (I still need to make dictionary checks, but time is short).

    But do you see the difference? This isn't about antiquated storage methods (punch cards). This is the difference between your method which shouldn't have bad data if written correctly and my method which absolutely doesn't allow bad data in the database. Period.

    There's a difference between being relatively sure that the data in your database is valid and knowing for sure that the data is valid (Yes, yes, I know: backups in case of hardware failures).

    The data is the database's responsibility. Moving data here and there, communicating with the user, and all sorts of other logic details are the app layer's responsibility. Here, the database is just making sure the data is clean. That's all. In my earlier example, the database was setting up a timestamp value for caches. The timestamp is data. The timestamp refers to validity of other data. This can go in the database itself. It's not really anyone else's business.

    This should be the app layer's responsibility? I have only these counterexamples. SELECT MAX(lastmod) when there are no triggers and functions (see my previous post). Making sure the MD5 implementation is the same for all client libraries in all languages when there are no triggers and functions.

    No code is perfect. I'm not advocating that you rely solely on the database. What I'm saying is that the database can be correctly used as a last line of defense for bad data that somehow crept through.
    --

    - I don't need to go outside, my CRT tan'll do me just fine.