Slashdot Mirror


LAMP Lights the OSS Security Way

Kevin Young wrote to mention a ZDNet article which goes into some detail on new results from a Department of Homeland security initiative. It's called the 'Open Source Hardening Project', and (funded to the tune of $1.24 Million) the goals of the initiative are to use a commercial tool for source code analysis to buck up the security base of many OSS projects. LAMP (the conglomeration of Linux, Apache, MySQL, and PHP/Perl/Python) was a 'winner' in the eyes of the project. From the article: "In the analysis, more than 17.5 million lines of code from 32 open-source projects were scanned. On average, 0.434 bugs per 1,000 lines of code were found, Coverity said. The LAMP stack, however, 'showed significantly better software quality," with an average of 0.29 defects per 1,000 lines of code, the technology company said.'"

39 of 178 comments (clear)

  1. Old news by Fnord666 · · Score: 2, Informative

    This is old news:

    --
    'The tyrant will always find pretext for his tyranny.' - Aesop's Fables
  2. Maybe I've been reading too much politics lately.. by Valdrax · · Score: 3, Interesting

    Maybe I've been reading too much politics news lately, but I'm just waiting for Microsoft to come out with a statement that people capable of evaluating Perl, PHP, and Python are biased in favor LAMP solutions.

    I need to do something about my cynicism.

    --
    If it's for-profit but free, you're not the customer -- you're the product (e.g., the Slashdot Beta's "audience").
  3. Fucking LAMP. by autopr0n · · Score: 5, Insightful

    I'm so sick of everyone making their software depend on MySQL. If you're software is any good it should be able to run on more then one DB, at least Postgres.

    To me, MySQL is like the MS Access of the Open Source world.

    --
    autopr0n is like, down and stuff.
    1. Re:Fucking LAMP. by Trevin · · Score: 3, Interesting

      I'd love it if database management systems were compatible enough to allow that. The trouble is, it seems only the most basic query syntax has been standardized. Several other aspects, such as table creation, column types, auto-increment variables, and stored procedures, have varying degrees of differences or support between the various databases such that in any sufficiently complex application you would need to write a separate copy of db interface code for every DBMS that you want to support.

    2. Re:Fucking LAMP. by aurb · · Score: 2, Insightful

      Indeed. I wonder why people are not using SQLite where they need a fast and not _very, very_ large database (that's the case with most websites). And if there's a need for a big and reliable db -- PostgreSQL is the answer.

    3. Re:Fucking LAMP. by Lumpy · · Score: 4, Insightful

      I'm sick of DB makers ignoring standards and making their SQL not 100% SQL99 compliant.

      it's is pure bullcrap that MSSQL,Oracle,MySQL and PostgreSQL can not take the exact same complex query without having to rewrite it.

      That is one of the big problems. the fact that some of my queries will not go cross platform because of stupidities thrown in by Microsoft, MYSQL, and Oracle that cause pain and suffering like this.

      --
      Do not look at laser with remaining good eye.
    4. Re:Fucking LAMP. by mrops · · Score: 2, Interesting

      Hey that why I say LAMP will never take the place of say Java/spring/hibernate/tomcat/jboss.

    5. Re:Fucking LAMP. by Khelder · · Score: 3, Insightful

      Well, the GP didn't say what kind of undergraduate degree program he was in, so maybe it was on something very applied like "Database Administration" and you're right.

      But if he's getting a Computer Science degree (which seems to be the plurality of students on /.), then his courses should *not* be emphasizing how the syntax for database A is different from the syntax for database B. The courses should be about higher level concepts (maybe replication, or normalization).

    6. Re:Fucking LAMP. by NitsujTPU · · Score: 3, Insightful

      Exactly. I didn't sign up to go to a trade school. I signed up to learn CS.

    7. Re:Fucking LAMP. by Malor · · Score: 2, Interesting

      SQLite doesn't seem to be very fast. I know the SlimDevices people are having some trouble with it. They write SlimServer, an open-source Perl server that indexes music and drives the company's (excellent) Squeezebox players.

      The problem seems to happen when people have very large collections, greater than 10,000 tracks... updates become slow, and the whole system gets a little sluggish. Apparently, when using MySQL, the problem goes away completely... or at least until someone gets to 100k tracks or something. :)

      Perhaps the Slim team is doing something wrong, but they're definitely seeing some performance issues with SQLite.

    8. Re:Fucking LAMP. by Decaff · · Score: 3, Interesting

      Several other aspects, such as table creation, column types, auto-increment variables, and stored procedures, have varying degrees of differences or support between the various databases such that in any sufficiently complex application you would need to write a separate copy of db interface code for every DBMS that you want to support.

      There are open (and closed) source products that have dealt with these issues for years. Modern ORMs products handle all of these matters, and automatically provide translation between portable query languages (such as JDOQL) and high-performance vendor-specific SQL depending on the database you deploy on.

      It is astonishing to see these matters still being discussed as if no solution exists!

  4. don't waste that $$$! by urdine · · Score: 2, Insightful

    Why not release the results of all the bugs? All those OSS projects will then have 0.00% bugs!

    1. Re:don't waste that $$$! by Bazzalisk · · Score: 3, Funny
      Ah, but how many lines of code will it take to correct the bugs? and will those bugfixes themselves contain bugs?

      Interested minds couldn't care less.

      --
      James P. Barrett
    2. Re:don't waste that $$$! by ChrisA90278 · · Score: 2, Interesting
      Why not release the results of all the bugs? All those OSS projects will then have 0.00% bugs!

      Many other studies and most programmers experiance shows that there is a high likelyhood of introducing a bug whenever you make a change to existing code, In fact on a per line of code written basis "fixes" are about the buggyist code you can write. So if you have .3 bugs per KSLOC (Kilo lines of code) in mature code like Apache orthe Linux kernal the new stuff that fixes a bug might have three times as many bugs per line. But the bug fix is typically small, many time just one to four lines so you do make projess. Over tiome the "defect rate" falls. Graphically it is a curve to reaches zero at infinity.

      "Everyone" knows the above so after even a triveal fix you test the heck out of the system then put it though a long beta cycle. Well, at least the projects that have some kind of process in place do this. But note that all the "best" OSS systems sdo have a very strong and well ordered developent process. I'd say the low bug rate is due to the process. The best they can do is make incremental tweeks to the process and wait. At infinity the bug rate will in fact reach zero, or so says the theory.

  5. Re:Maybe I've been reading too much politics latel by gbjbaanb · · Score: 4, Insightful

    Well, once you read this snippet from the article, they'll have enough ammo:

    "There is one caveat: PHP, the popular programming language, is the only component in the LAMP stack that has a higher bug density than the baseline, Coverity said."

    I assume he means the baseline of 0.434 bugs/1000 lines, and that if they removed PHP from the LAMP stack, that average bug count would go down even further.

  6. Counting Defects by RasendeRutje · · Score: 2, Interesting

    How can one ever count the defects/bugs per line?
    And why count them, and then not remove them?
    And one huge defect is better than more than one small ones?
    Sounds like a crappy research to me, time to RTFA.

    --

    If Microsoft was mass, stupidity would be gravity.
    1. Re:Counting Defects by Pedro+Sobota · · Score: 3, Interesting

      Very Bad, and I have seen a US Defense - contracted software company (they even do helicopter systems) on their website extensively touting their 'lower defects per line of code (DLC)' methodology. Marketing.

  7. http://scan.coverity.com/ - highest/lowest by digitaldc · · Score: 2, Interesting

    As part of the government-funded effort, Stanford and Coverity have built a system that does daily scans of the code contributed to popular open-source projects. The resulting database of bugs is accessible to developers, allowing them to get the details they need to fix the flaws, Coverity said.

    Just an FYI...AMANDA had the highest amount of bugs at 1.214 Defects / KLOC and OpenVPN the lowest at 0.100 Defects / KLOC.

    --
    He who knows best knows how little he knows. - Thomas Jefferson
  8. Re:Solaris by Anonymous Coward · · Score: 2, Funny

    And it won't be long before Linux-zealots will start preemptively bashing Solaris to distract form the screaming shortcomings of their toy-OS. In fact, it will start in t 0.

  9. YEAH RIGHT! by suso · · Score: 4, Insightful

    Also from the article: The lowest was the XMMS audio player, with 0.051 defects per 1,000 lines of code.

    Being someone who has used Amanda for many years and also XMMS, I find it hard to believe. Amanda has few problems (unless its the tape drive itself) and XMMS crashes sometimes when you just push a button in the "wrong way".

    I think there can be a big difference between actual number of bugs and the perceived number of bugs. This almost makes counts like this useless for actually comparing software.

    1. Re:YEAH RIGHT! by maelstrom · · Score: 2, Insightful

      I think it should be obvious this bug scanner only picks up on certain classes of "bugs". If they had an automated way of detecting all types of bugs, they would be rich beyond their wildest dreams. I imagine it picks up certain things like out of bound accesses, mallocs without frees, etc. It would make sense that Amanda would have more types of these operations going on than something like xmms.

      --
      The more you know, the less you understand.
    2. Re:YEAH RIGHT! by james_da_silva · · Score: 2, Informative

      To address several comments I've seen:

      * The Amanda developers (as far as I know) were not contacted that Amanda was on the list before it became news. But, Coverity _was_ quick and friendly about giving Amanda developers full access to the bug list for Amanda when we registered.

      * Their checks do go beyond simple static checking; they are looking at possible values of index variables at different points in the code to assess potential overflows, and they are tracking malloc/free pretty well. You can find papers about their techniques on Dawson Engler's page at Stanford. There's no doubt that they are holding the clue stick here.

      For Amanda specifically, the majority, 76 out of 108 issues found, were malloc/free mismatches. In addition, there were 9 dead-code determinations, 16 potential null pointer dereferences, 3 cases of a function returning -1 into an length variable that is used without checking, 1 uninitialized variable, and 3 array overflows cases, for 108 problems in ~89kloc, or ~1.2/kloc.

      Of the 3 array overflow reports, 1 was a false positive, and 2 were cases inside the report generator where the dump level read from the logs was not range checked before per-level statistics were updated. So a corrupted log could cause the report to fail, but no buffer-overflow security holes.

      In summary, I'd say the results are quite useful. Thanks to Coverity and our Homeland Security Big Brothers for funding these scans.

      James da Silva

  10. Re:Huh? by muhgcee · · Score: 3, Insightful

    I work at a company that uses Postgres with one of our products. When there are a lot of INSERTs into the Postgres database, it needs to be vaccuumed or it slows to a crawl.

  11. Umm... Way to go Department of Homeland Security? by Wannabe+Code+Monkey · · Score: 3, Insightful

    I have to say, I'm suprised and impressed... a $1.2M grant to harden open source software? Thanks all seeing orwellian eyeball. I don't recall slashdot posting anything about the original grant but here's a link from the posted article to another about the funding.

    The data is meant to help secure open-source software, which is increasingly used in critical systems, analysts said. Programmers working on the Linux operating system, Apache Web server, BIND Internet infrastructure software and Firefox browser, for example, will be able to fix security vulnerabilities flagged by the system before their code becomes part of a released application or operating system.

    --
    We always knew Comcast was corrupt, here's the proof: http://tech.slashdot.org/comments.pl?sid=1909890&cid=34545432
  12. 0.00 defects per infinity lines of code by mwvdlee · · Score: 3, Insightful

    If an automated system can detect bugs in code, why can't it fix them automatically too?

    --
    Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
  13. MySQL by suso · · Score: 2, Insightful

    I don't trust Oracle

    Honestly, I don't trust MySQL either. Every since they started going more commercial, there have been indications that eventually MySQL will be more closed up than open. But that's just speculation. So I've been slowly switching my stuff to use Postgresql. The only problem I have with postgresql is that it doesn't handle user administration as well. Other than that, its awesome.

  14. Test of Leaked Vista/IIS code by RealProgrammer · · Score: 4, Funny

    Researchers at clandestine research labs in bases hidden deep in the Russian Alps have attempted to analyze portions of the leaked Internet Information Server (IIS) and Windows Vista code for similar flaws.

    The findings were remarkable. They found 4,669 flaws, but since they didn't have the source code it resulted in a divide-by-zero error when they calculated the statistics on their Excel spreadsheet. The error triggered an unheard-of lockup on their Windows XP desktop.

    On a positive note, recovering from the error alerted them to the presence of 43 strains of the MyDoom virus, 257 instances of Alexis spyware, and a bootleg copy of "Making of the Britney Spears Sonogram".

    --
    sigs, as if you care.
  15. LA - fine M - okay P - ah so many varieties! by Dareth · · Score: 4, Interesting

    The LAMP stack when broken down consists of:
    Linux & Apache - rock solid stable releases.
    MySql - Okay, getting better with each release.

    P - This is the kicker. Perl, Python, PHP, and more so lately even that R one Ruby & Rails.
    We are living in interesting times when we have so much choice... much like the Chinese curse. I do not see as how you can evaluate all of these platforms together in a general fashion. Where is the skew or bias in this study?

    Someone on IRC recently was critical of a small website I put together in 2000. It was written in plain html, using frames *gasp*. Many people today do not realize how far web development has come since then.

    --

    I only look human.
    My mother is a halfling and my dad is an ogre, so that makes me an Ogreling
  16. Re:What about.... by frankm_slashdot · · Score: 2, Funny

    Parent: +1.33 (Sarcastic yet funny).

  17. Re:Huh? by dfetter · · Score: 2, Informative

    I hope that "INSERT" is a typo, because it's just plain wrong. The only thing that needs vacuuming is dead tuples, and the only operations that create dead tuples are UPDATEs and DELETEs. Furthermore, pg_autovacuum has been integrated into the back-end since 8.0.

    --
    What part of "A well regulated militia" do you not understand?
  18. Security is not a feature, security is design by Device666 · · Score: 4, Insightful

    Security is not a feature, security is design. This ultimely means that security should provide good default values, knowledge about how to prevent buffer underruns/overruns and most importantly knowledge how to use a system. This means that security only will need tools to help a system architect and developer to confront him with his limits of his human brain and have a well documented yet very simple concise system and low speed development cycles.

    Open source is great because of the many eyes, knowledge sharing and having nothing to do with corporate tradeoffs (the users have the largest voice. But it stinks in the fact that any noob can make programs which are badly designed and are a serious risk to security, however someone may learn faster form the mindsharing in the open source world. To have a well concise system so much more is needed than just some bugfixes. OSS is just a proof that closed source coorporate software is not good with security, but it isn't proof of sound security.

    Most interesting is OpenBSD with it's oustanding default values, it's very own high profile malloc which prevents coders for lot of buffer underrunes/overruns, outperforming other malloc implementations. It has a very high quality of manpages and if you want to do something then you have to RTFM. That's what security should be, other than some less known bugs. I would even suggest that it would be better in the name of security that people would use program derivation (which is a very concise way to do formal verification). PIE and all other solutions maybe look practical, but they don't solve the lacking attention for "secure by design".

  19. From the lame-ass-metaphor dept. by tobiasly · · Score: 2, Funny

    "LAMP Lights the Way"?! Was Slashdot acquired by C|Net?

    For the love of all that's holy, please drop the hackish high-school-newsletter headlines.

  20. Checkpointing. by Ivan+Matveitch · · Score: 2, Funny

    The whole database concept is just fundamentally wrong.

  21. Hint to PHP devs by billcopc · · Score: 2, Funny

    Add more linefeeds!!! ;)

    --
    -Billco, Fnarg.com
  22. bug reports? by Janek+Kozicki · · Score: 2, Interesting

    17500000 lines of code, 0.434 bugs per 1000 lines, that makes 17500*0.434=7595 bugs, so where are the bugreports?

    --
    #
    #\ @ ? Colonize Mars
    #
  23. Re:And for Windows XP? by Phillup · · Score: 2, Funny

    Perhaps the Microsoft code does in 5 lines what the Open Source code does in 150.

    I didn't know MS used Perl.

    ;-)

    (unix tools excepted)

    --

    --Phillip

    Can you say BIRTH TAX
  24. Re:Solution for the time being... by Richthofen80 · · Score: 2, Informative

    If your DB is on the same host as your web/application server

    If you are relying on this type of architecture, where one machine does all the work, interoperability with seperate databases is probably not even needed.

    But if you're working with a project that needs replication and such, then you really can't rely on DB and web server being the same machine. Sometimes you have to sell your software as an installable product and make it work on multiple DB platforms. Sometimes you have to write to foreign databases using ODBC.

    Simplifying queries isn't an extensible solution. For instance, it is intuitive to use
    "LIMIT 10,20" (MySQL) instead of using "TOP 20 WHERE ID >= 10" (T-SQL). No simplification will fix that branch, and its kind of obvious that one of the solutions makes more sense. (Or, alternatively, how MySQL will by default install rules fill in blank strings in most fields if no data is provided for them, instead of throwing an error.)

    --
    Reason, free market capitalism, and individualism
  25. They did test OpenBSD. by Some+Random+Username · · Score: 2, Informative

    First of all, just because people desperately need a stupid acronym for everything, they call pretty much any non java unix web development "LAMP". So there's nothing wrong with testing other free unixes, webservers, databases and languages. Second, a couple of the OpenBSD developers work at coverity. They have tested openbsd and fixed the issues found. It just isn't cool enough for the people who use acronyms like "LAMP" to care about.

  26. Re:Maybe I've been reading too much politics latel by masklinn · · Score: 3, Informative

    I assume he means the baseline of 0.434 bugs/1000 lines, and that if they removed PHP from the LAMP stack, that average bug count would go down even further.

    Spot on, as you can see on scan.coverity.com:

    • PHP features 205 defects for 431,327locs, or 0.475 defects/kloc
    • Perl has 91 defects for 431,327locs, or 0.19 defects/kloc
    • Python is very slightly lower than perl (but with a noticeably smaller codebase) at 49 defects for 259,908locs or 0.189 defects/kloc
    • Apache-httpd features 32 defects in 127,817 locs, or 0.25 defect/klock
    MySQL isn't featured (Ruby is also a noticeable absent), but PostgreSQL stands at 296 defects for 815,748 locs, or 0.363 defects/kloc, and the lightweight SQLite has 16 defects for 60,722 locs or 0.263 defect/klock.
    --
    "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler