Slashdot Mirror


The Lessons of Software Monoculture

digitalsurgeon writes "SD Times has a story by Jeff Duntemann where he explains the 'Software monoculture' and why Microsoft's products are known for security problems. Like many Microsoft enthusiasts he claims that it's the popularity and market share of Microsoft's products that are responsible, and he notes that the problem is largely with C/C++ and mostly because of the buffer overflow problems."

585 comments

  1. C# by Anonymous Coward · · Score: 2, Insightful

    Wasn't this why C# was created?

    1. Re:C# by Anonymous Coward · · Score: 2, Insightful

      No, C# was made so Microsoft could make money off Java. By changing the name, and some keywords, they can market the next OO language to a bunch of people who never learned C++.

    2. Re:C# by Xenobane · · Score: 0

      C# is more suitable to replace VB.

    3. Re:C# by nyda · · Score: 5, Insightful

      The real problem isn't C bufferoverflows. It's Microsofts ultra-agressive stragetegy to purge every single piece of non-Microsoft software from the marked. During the browser wars, Microsofts one single aim was add more and more features to IE. Security, if at all, didn't matter a lot. What was important was to get another release as soon as possible. As long as Microsoft maintains it's hostile strategy, it will never produce any piece of software that can be considered safe. Not even if they'd switch to managed code entirely.

    4. Re:C# by cablepokerface · · Score: 1, Troll

      No, C# was made so Microsoft could make money off Java. By changing the name, and some keywords, they can market the next OO language to a bunch of people who never learned C++.

      Haha, with such incredible lack of knowledge I am not surprised you checked the AC box. :)

    5. Re:C# by Anonymous Coward · · Score: 2, Insightful

      umm.. do we have a buzzword junkie here? Maybe you would prefer reading the technical articles focussed towards investers trying to understand a new stock... check out forbes.com.

      I don't care much for Microsoft, but .NET and more specifically the interpreter for intermediate language are in fact something I'm a great fan of.

      You should learn a thing or two, Java is a virtual machine targetted to a single language which was specifically designed for the virtual machine. This made it so that we developers (the kind which produce products that actually sell 10 million or more copies) could not develop commercial quality software on the system since we were at the mercy of Sun for the language, the runtime, and everything else as well. Worse yet, Sun made no attempt to provide tools for Java development which were nearly as powerful as the ones available for C++.

      Now a virtual machine architecture which supports JIT compiling to different architectures with a consistent set of class libraries and support for multiple different languages including C#, C++, Java, Visual Basic, Cobol, etc... that is useful. Would have preferred it to come from someone more trustworthy, but all the same, a much better product than Java ever was.

      You can't blame Microsoft for learning from Sun's mistakes. But you can blame Sun for not learning from their own

    6. Re:C# by SillyNickName4me · · Score: 4, Insightful

      You said:

      > could not develop commercial quality software on the system since we were at the mercy of Sun for the language, the runtime, and everything els

      And a bit later you said:

      > Now a virtual machine architecture which supports JIT compiling to different architectures with a consistent set of class libraries and support for multiple different languages including C#, C++, Java, Visual Basic, Cobol, etc... that is useful.

      Now the virtual machine and its tools etc still come from one provider, and oen that has a proven track record of screwing over everyone who develops a succesfull product based on its technology instead of from a company that at least has a track record of caring about its customers.

      Pleaase tell me how that is better in any way? The multiple langauge support I guess.....

      Oh, and you could of course point at mono... but that would mean you'd first have to accept that you can also get java from others then SUN, ie, try IBM, GNU, Blackdown (http://www.blackdown.org/).

    7. Re:C# by jayminer · · Score: 2, Funny

      I wouldn't be surprised if you are not aware of the fact that many languages can be compiled into Java Virtual Machine.

    8. Re:C# by Anonymous Coward · · Score: 0

      well, you guys might not be knowing a thing or two ... check this place for enlightenment abt IE:
      http://www.chrisbeach.co.uk/techJournal/

    9. Re:C# by saider · · Score: 1

      Now the virtual machine and its tools etc still come from one provider, and oen that has a proven track record of screwing over everyone who develops a succesfull product based on its technology instead of from a company that at least has a track record of caring about its customers.

      Don't forget about Mono (open source .Net tools). The .Net CLR is an open standard. That's what the Mono folks are working off of. The only downside is that Microsoft has a huge head start in the libraries, widgets, and tools. This makes their solution much more useful (for now).

      --


      Remember, You are unique...just like everyone else.
    10. Re:C# by SillyNickName4me · · Score: 2, Informative

      > Don't forget about Mono (open source .Net tools). The .Net CLR is an open standard. That's what the Mono folks are working off of. The only downside is that Microsoft has a huge head start in the libraries, widgets, and tools. This makes their solution much more useful (for now).

      Please don't forget reading the entire post before replying, I specifically addressed the existance of mono.

      At any rate...

      There is the potential for patent issues with Mono, just as is the case with open source JAVA development.

      Also, the original argument said that SUN was the only provider of JAVA technology while it is not. If GNU, Blackdown, IBM etc are ignored, why not ignore mono?

      For completeness' sake, I was not addressing the technical argument, just pointing out that the grandparent was rather ignoring the fact that the situation with regards to choice is very similar, and the single provider issue either exists for both or neither, depending on how much you are bothered by the potential of patent issues. (and one could even argue that in case of JAVA, there are non SUN versions of it that will not have patent issues that you will get to deal with as user/developer, ie the IBM version)

      In other words, technically mono is a maybe incomplete but viable alternative, but those exist and have existed for a long time for JAVA as well.
      Legal status is another thing.

    11. Re:C# by Da+Fokka · · Score: 1

      You are definitely right that MS created C# to make money. And who can blame them - after all, they're a company which sole purpose is making money.

      I have to disagree with the rest of your comment though. C# has a lot of the features Java has, but also expands on these. Delegates are cleaner, the C# iterators are way nicer than Java iterators and don't get me started on Generics.

    12. Re:C# by Anonymous Coward · · Score: 0

      Apparently a good way to automatically add 3 points to your score is to stick a little Microsoft zinger in your post. Way to go, mods, reinforcing Slashdot's image!

    13. Re:C# by Slime-dogg · · Score: 2, Informative

      Now the virtual machine and its tools etc still come from one provider...

      Now the Virtual Machine and its tools etc still come from one provider?

      And also, don't forget about this one...

      --
      You need to restart your computer. Hold down the Power button for several seconds or press the Restart button.
    14. Re:C# by SillyNickName4me · · Score: 1

      I really suggest you read more carefully. I mentioned mono explicitly in my post, so yes, I am aware that it exists.

    15. Re:C# by Anonymous Coward · · Score: 0
      JavaVMs happily run Python, Lisp, Ada, and undoubtably other languages at this point.

      "unsafe" code like pointers isn't practical on a JVM; but you could argue that this is a feature rather than a weakness.

    16. Re:C# by Anonymous Coward · · Score: 0

      "Now a virtual machine architecture which supports JIT compiling to different architectures with a consistent set of class libraries and support for multiple different languages including C#, C++, Java, Visual Basic, Cobol, etc... that is useful. "

      There are currently far more "alternative" languages available for the JVM than .NET. Check out http://flp.cs.tu-berlin.de/~tolk/vmlanguages.html for a list of around 190; these include (but are not limited to) Python, COBOL, LISP, Scheme, Prolog, BASIC, Icon, Smalltalk, ADA, Oberon, and a host of specialist and experimental languages. Note also that unlike most .NET offerings, the vast majority of JVM-compatible languages are open source.

    17. Re:C# by Slime-dogg · · Score: 1

      I dunno... blackdown is required by the OpenOffice ebuild. If one of the biggest cross-platform office products requires blackdown, I would say that blackdown is not being ignored.

      You also have forgotten that though MS has the "head start" in the System.Windows namespace, Mono has GTK#, which satisfies GUI/widget needs. Hell, that's even cross-platform. Mono also has more in the way of database connectivity, and Novell has contributed quite a bit to the Mono stack.

      Given the way that Mono has matured, and the amount of time that it's taken to do so, Microsoft's implementation is going to be left behind fairly soon.

      The patent issues will be worked out. I wouldn't be too afraid of them, and it's best not the wonder about them as a developer, either. Miguel has also said that if a patent issue comes up, they'll either re-work the code, or snip it. Mono's stack isn't encumbered with patents anyway.

      --
      You need to restart your computer. Hold down the Power button for several seconds or press the Restart button.
    18. Re:C# by SillyNickName4me · · Score: 1

      > I dunno... blackdown is required by the OpenOffice ebuild. If one of the biggest cross-platform office products requires blackdown, I would say that blackdown is not being ignored.

      1. You can build OpenOffice without JAVA, you just have to tell it about that (don't know about the ebuild, but with the FreeBSD ports collection you definitely can configure this)
      2. When building with JAVA, OpenOffice doesn't require blackdown, it requires a working jre (Sun, IBM, Blackdown, doesn't matter)

      Please read back the discussion, the post that started it was ignoring ANY alternative for SUN when it comes to JAVA.

      > You also have forgotten that though MS has the "head start" in the System.Windows namespace, Mono has GTK#, which satisfies GUI/widget needs. Hell, that's even cross-platform. Mono also has more in the way of database connectivity, and Novell has contributed quite a bit to the Mono stack.

      Uh, wether that is true or not is simply completely irrelevant for the argument we were having. It is not about if mono is better (better then what anyway) or more complete or whatever, the argument was that there is only 1 provider of JAVA technology, and 2 of C#, which by your own account is not true..

      Please go read the entire discussion.

  2. managed code by MoFoQ · · Score: 3, Interesting

    I thought that's why Microsoft was pushing for "managed code" with the .Net framework. Though I think it's some what ripping the idea(s) from Sun's Java. But I'm sure even with .Net, there will still be buffer overflows. Well...the GDI+ exploit is one prime example of that fact.

    1. Re:managed code by Anonymous Coward · · Score: 0

      Except that the CLI doesn't solve this problem, it just makes avoidable (which it already was to begin with). A developer can still write code to do pointer arithmetic. BTW, what kind of brain damaged designer allows for pointer arithmetic in a garbage collected language?

    2. Re:managed code by omicronish · · Score: 5, Insightful

      I thought that's why Microsoft was pushing for "managed code" with the .Net framework. Though I think it's some what ripping the idea(s) from Sun's Java. But I'm sure even with .Net, there will still be buffer overflows. Well...the GDI+ exploit is one prime example of that fact.

      An interesting distinction to make is that .NET code itself isn't vulnerable to buffer overflows. GDI+ is an unmanaged component (likely written in C++), and is vulnerable. The problem is that .NET exposes GDI+ functionality through its graphics classes, and since those classes are part of the .NET framework, .NET itself essentially becomes vulnerable to buffer overflows.

      Microsoft appears to be shifting its APIs to the managed world, either as wrappers to legacy APIs, or new APIs built completely in the .NET world (or both as is the case with WinFX). So to expand on your post, as long as legacy code is used, yeah, buffer overflows will still be possible, but by shifting more code to managed world the likelihood of such vulnerabilities will hopefully diminish.

    3. Re:managed code by omicronish · · Score: 4, Informative

      Except that the CLI doesn't solve this problem, it just makes avoidable (which it already was to begin with). A developer can still write code to do pointer arithmetic. BTW, what kind of brain damaged designer allows for pointer arithmetic in a garbage collected language?

      Pointer arithmetic automatically makes the code unsafe (you actually use the 'unsafe' keyword in C#), and you have to compile it with an /unsafe switch. Resulting binaries are not verifiable by .NET, and you can prevent unsafe code from executing via code security. I can't run C# code that uses pointer arithmetic off a network share because of this.

    4. Re:managed code by Anonymous Coward · · Score: 0

      A designer that cares about interopability ? Duh !

    5. Re:managed code by Anonymous Coward · · Score: 5, Insightful

      BTW, what kind of brain damaged designer allows for pointer arithmetic in a garbage collected language?

      Umm, one who knows that it is required for proper interoperability with existing libraries? One who knows more about language design than you?

      The CLI actually isn't a "garbage collected language". First, it isn't a language - it is a language infrastructure (the LI in CLI). Second, garbage collection is available to the languages, but not required. It is a complete virtual machine, and straight C/C++ ports just fine to it, including all the buffer overruns.

      However, there is a convention for "safe" programming. If you follow the convention, the assembly loader can verify that there are no buffer overruns or similar problems in your program. The price you pay is access to low-level constructs such as pointers, since their use cannot be verified.

      Loading assemblies with unverifiable code is a privilege, which allows security to be maintained.

      I think it all boils down to: the decision was the right one, it was well implemented, so stop talking about stuff you know nothing about.

    6. Re:managed code by MoFoQ · · Score: 2, Interesting

      including drivers (longhorn will be .Net based).

      One major disadvantage is that performance will take a hit. Now, if u make drivers .Net based, then the performance hit will be multiplied.

      And one more thing, managed code is fine but not having the old samples/examples updated with the new managed code is annoying. An example of this can be seen in the Oct. 2004 update for the DirectX 9.0 SDK; the C# examples use the older deprecated code which has no wrapper classes (and thus will get a compile error). (A way to workaround this is to use the older Summer 2004 or older DLL's as the reference instead of the new ones...but then that begs the question; why bother with Oct. 2004?)

    7. Re:managed code by Tablizer · · Score: 3, Informative

      It seems to be a fundamental battle between speed versus protection. As time goes on and processors get faster, then things should shift toward the protection side.

      However, some applications, such as games, may still require being close-to-the-metal in order to get competative speed. Game buyers may not know about extra protection, but they will balk at speed issues. Thus, it still may be better business for some industries to choose speed over safety.

      However, if the option for such exposure is avialable, then viruses and other malware may still be able to take advantage of it somehow. The trick is to find a way to allow speed-intensive apps without creating back-doors. Maybe have a toggle switch on the front of the CPU box with two settings:

      * Speed
      * Safety

      Just an idea (that probably needs work).

    8. Re:managed code by Anonymous Coward · · Score: 0

      So to expand on your post, as long as legacy code is used, yeah, buffer overflows will still be possible, but by shifting more code to managed world the likelihood of such vulnerabilities will hopefully diminish.

      So, Windows will be secure once everything is managed code running on a .NET runtime, that is itself managed code running on a .NET runtime, that is itself managed code running on a .NET runtime, that is itself managed code running on a .NET runtime, that is itself managed code

      20 GOTO 10

    9. Re:managed code by NonSequor · · Score: 1

      Given the choice, I'd rather be given the job of securing a compiler and run-time environment than the task of securing 1000 C or C++ programs.

      --
      My only political goal is to see to it that no political party achieves its goals.
    10. Re:managed code by Anonymous Coward · · Score: 0, Troll

      "Umm, one who knows that it is required for proper interoperability with existing libraries?"

      Yeah, I guess that's why languages like Python and Ruby which don't have pointer arithmetic can't call existing C libraries. Oh, wait... nevermind.

      "One who knows more about language design than you?"

      Well, at least you didn't let your emotions on the subject degrade your argument...

    11. Re:managed code by rosewood · · Score: 1

      Plus, my A64 + SP2 should never have a problem with buffer overflow exploits anyways!

    12. Re:managed code by steve_l · · Score: 4, Insightful

      Well, use the unsafe keyword and you are entering buffer overflow land. but they go out of their way to make that hard to do, and mostly unneeded.

      I know that Sun like to point to "unsafe" as a recipe for disaster, but every time you see the word "native" in Java, you know that they are binding to a potentially unsafe language, and in the same boat.

      IMO, a move to managed languages will stop buffer overflows, and we should do it for all UI stuff and other apps where performance is not #1 priority. Which means most apps. Which particular language platform is another issue - C#, Java, Python, they all have their strengths.

    13. Re:managed code by TFGeditor · · Score: 3, Funny

      "The CLI actually isn't a 'garbage collected language'. First, it isn't a language - it is a language infrastructure (the LI in CLI)."

      Gawd. I thought the discussion was about a Command Line Interpreter.

      I'm so old...

      --
      Ignorance is curable, stupid is forever.
    14. Re:managed code by kune · · Score: 1

      I don't buy the argument, that pointers are needed for interoperation with existing libraries.

      Java can interoperate without supporting the pointer concept and P/Invoke (Platform Invoke) can be used on .net without leaving the managed code. BTW it is possible to create pointer issues with P/Invoke without writing a single line of "unsafe" code. Been there, done this.

      However in all VMs calling native code is slow because the VM has to switch to another mode to support it, so the best way is always to implement all algorihtms in the VM environment and switch to native libraries only for device interaction or huge batch jobs.

    15. Re:managed code by xixax · · Score: 1

      An interesting distinction to make is that .NET code itself isn't vulnerable to buffer overflows. GDI+ is an unmanaged component (likely written in C++), and is vulnerable. The problem is that .NET exposes GDI+ functionality through its graphics classes, and since those classes are part of the .NET framework, .NET itself essentially becomes vulnerable to buffer overflows.

      By the same token, the amount of new C++ is being reduced, and things like GDI+ are (hopefully) in a single library rather than being statically included into who knows how many compiled projects.

      Xix.

      --
      "Everything is adjustable, provided you have the right tools"
    16. Re:managed code by Ooblek · · Score: 3, Insightful
      I only wish buffer overflows were the core issue in security problems.

      I believe that the problem is mostly that security is an afterthought. By the time everyone realizes how much work it is going to take to put security into a product, the core functionality is about ready to head to QA. By the time it is ready to head to QA, sales has already been promised a delivery date.

      So the management decides to put some basic security in the product, and save the more security effort for Rev. 2. Rev. 2 then takes a really long time to materialize while they are modify the core functionality to make the product more sellable.

    17. Re:managed code by JCMay · · Score: 2, Insightful

      I don't think drivers CAN be .NET based, since they require access that the Framework doesn't allow or expose.

      I have recently been toying with a .NET managed code interface for a parallel port I2C adapter. As near as I can tell, there's no facility for writing managed-code drivers under Windows. On Linux (or any other OS that can run Mono or dotGNU) I can make use of the /dev/ports and /dev/mem devices to implement my functionality (albeit slowly!).

      No book on .NET I have ever seen includes information on device drivers. I don't think it can be done, at least not with .NET 1.1.

    18. Re:managed code by catherder_finleyd · · Score: 1

      I don't think that Microsoft .Net is necessarily just "ripping off" Java. Managed code has been around from the beginning of the PC. One very good example was the UCSD P-System.

    19. Re:managed code by Anonymous Coward · · Score: 0

      The CLI actually isn't a "garbage collected language". First, it isn't a language - it is a language infrastructure (the LI in CLI).

      CLI is not to be confused with <abbr title="Common Intermediate Language">CIL</abbr> which is a language. Your point is correct; garbage collection is optional.

    20. Re:managed code by steve_l · · Score: 1
      Yeah, you are right there -untainted data is the classic attack on a web site, and managed code doesnt do anything there, not in the Java or .NET world where there is no tainted bit on stirngs.

      I'm the maintainer of the Apache Axis security doc, so if you have any input there, I'd be grateful. We try and be paranoid, but are probably not devious enough.

  3. Blaming the language... by The+Hobo · · Score: 3, Informative

    Glancing over a book called "Writing Secure Code" by Howard and LeBlanc, from the Microsoft Press and that touts the following quote on the front cover:

    "Required reading at Microsoft - Bill Gates"

    Makes me wonder if blaming the language is easier than the possiblity of the code being more sloppy than it should. The book recommends many ways to avoid buffer overflows and such.

    --
    There is another kind of evil which we must fear most, and that is the indifference of good men. -- Boondock Saints
    1. Re:Blaming the language... by mind21_98 · · Score: 3, Informative

      Complex systems are difficult to debug. Simple as that. With something that has as many lines of code as Windows and IE, it's impossible not to miss at least one bug. Sure, a change in policies might help, but you can never get rid of bugs. That said, Firefox does seem to have fewer problems.

    2. Re:Blaming the language... by KingPunk · · Score: 0

      you're right! its not the code, but the coders.
      quality vs. features.. its the biggest issue.
      thats one of the most major issues with oss projects too!
      and time-driven codeweaving doesn't exatly add
      padding to that factor of sloppy code
      not that the language isn't at fault, it by default, is quite old.

      if it were my car, it'd be time to retire it!
      --kingpunk

    3. Re:Blaming the language... by Anonymous Coward · · Score: 1, Interesting
      Which is exactly why security policy should be implemented in a small, simple kernel.

      Then any apps that make requests through this kernel get the security benefits.

    4. Re:Blaming the language... by Moraelin · · Score: 5, Insightful

      The problem is that nobody writes perfect code.

      Yes, we're all nerds, and we're all arrogant. We all like to act as if _our_ code is perfect, while everyone else is a clueless monkey writing bad code. _Our_ bugs are few and minor, if they exist at all, while theirs are unforgivable and should warrant a death sentence. Or at the very least kicking out of the job and if possible out of the industry altogether.

      The truth however is that there's an average number of bugs per thousand lines of code, and in spite of all the best practices and cool languages it's been actually _increasing_ lately.

      Partially because problems get larger and larger, increasing internal communication problems and making it harder to keep in mind what every function call does. ("Oh? You mean _I_ was supposed to call that parameter's range before passing it to you?")

      This becomes even more so when some unfortunate soul has to maintain someone else's mountain of code. They're never even given the time to learn what everything does and where it is, but are supposed to make changes until yesterday if possible. It's damn easy to miss something, like that extra parameter being a buffer length, except it was calculated somewhere else. Or even hard-coded because the original coder assumed that "highMagic(buf, '/:.', someData, 80)" should be obvious for everyone.

      And partially because of the increassing aggressiveness of snake oil salesmen. Every year more and more baroque frameworks are sold, which are supposed to make even untrained monkeys able to write secure performant code. They don't. But clueless PHBs and beancounters buy them, and then actually hire untrained monkeys because they're cheap. And code quality shows it.

      But either way, everyone has their own X bugs per 1000 lines of code, after testing and debugging. You may be the greatest coder to ever walk the Earth, and you'll still have your X. It might be smaller than someone else's X, but it exists.

      And when you have a mountain of code of a few tens of _millions_ of lines of code, even if you had God's own coding practices and review practices, and got that X down to 0.1 errors per 1000 lines of code... it still will mean some thousands of bugs lurking in there.

      --
      A polar bear is a cartesian bear after a coordinate transform.
    5. Re:Blaming the language... by Anonymous Coward · · Score: 1, Insightful

      "And when you have a mountain of code of a few tens of _millions_ of lines of code"

      Isn't that the real problem. No program should include tens of millions of lines of code. That's the whole point of developing software in layers.

    6. Re:Blaming the language... by Tim+C · · Score: 1

      And what do you get when you apply those layers in the creation of a piece of software? A program that essentially contains tens of millions of lines of code. Even if they're mostly in libraries, they're still there.

    7. Re:Blaming the language... by Anonymous Coward · · Score: 0

      Well, why don't we start blaming the tools, then, instead?

      If buffer overflows are a problem, then why doesn't Microsoft have a locked-down version of Visual Studio that has macros for creating suitable language constructs that prevent buffer overflows?

      Need a string buffer, then why not have the IDE spit in the correct structure? Why not hack vi at Microsoft for those developers who want to use something like this (or buy them UltraEdit, TextPad, etc. instead) instead of VS?

      This is what is crazy about software development. In carpentry, there are a few essential skills for building things. Keep it square. Measure twice, cut once. And cut it straight. There's really only one way to toe-nail a stud to a plate or header, etc etc etc., and you sort of learn the right ways to do it, and your job demands that you do it repetitively, and do it well.

      But in software development, there are quite a few commonly used ways of doing essentially the same given task, even for common things like using a buffer structure for various data stores. Even the most consistent programmers and developers will probably do things differently at different times for the same task set and parameters, if only because they've been doing a lot of one structure, and, well, it's just faster to keep cutting-and-pasting than step back and look at it critically, each time.

    8. Re:Blaming the language... by gadget+junkie · · Score: 4, Insightful

      "With something that has as many lines of code as Windows and IE, it's impossible not to miss at least one bug."

      ....a bug in which program, windows or IE?

      The absolute insistence on the part of MS on integrating the browser (and shortly, the media player) into the operating system has bred this kind of exploits and vulnerabilities. I expect that it would be much easier to debug them if they were separate, an aspect that helps Firefox perhaps more than being Open Source.
      One more thing about the article: his "darwinian" approach, by which the most popular program get the most vulnerabilites because they attract the most attacks, has two fallacies:

      1.If it were true, Apache would be the most "vulnerable" server;

      2. All programs below a certain circulation would be immune.

      I have no insight on point 2, but strangely enough the more attacks are reported the more Apache market share grows. and when people are voting with their feet and money....

      --
      "If a boss demands loyalty, give him integrity. But if he demands integrity, give him loyalty." (John Boyd, 1927-1997)
    9. Re:Blaming the language... by mrjb · · Score: 3, Funny

      > God's own coding practices [...] He definitely must not have been following best coding practices. That's why it seemed the world was created in seven days. Anyone knows "Code like hell" programming is a classic mistake... Result: That 40-day flooding really wasn't supposed to happen. Same goes for the various plagues. Truth is, He's still debugging...

      --
      Visit http://ringbreak.dnd.utwente.nl/~mrjb/growingbettersoftware to download your free copy of the book
    10. Re:Blaming the language... by Moraelin · · Score: 5, Insightful

      In theory you are right, and better tools already exist. E.g., Java has array bounds checking by language definition. E.g., dunno abound Microsoft Visual C++, but I've used C compilers before which could generate code with array bounds checking. (TopSpeed C, for example.) It didn't even require any IDE macros, it just plain and simple generated them in the code automatically, if told to.

      The problem however is that, well, no language or library ever can force you to stop making mistakes.

      E.g., Java does throw an Exception if you try to overflow a buffer, but that's not an automatic magic talisman against bugs. You still can't let any ex-burger-flipper loose on the keyboard and say "nah, they can't have bugs or security problems. The language won't let them." What happens in practice is that:

      1. People catch the exception and ignore it, on account that "it can't happen." Or even write "catch (Throwable t) {}" blocks. (Catch anything whatsoever and ignore without as much as a line in the log.)

      2. Which in turn can make the program malfunction in more subtle ways. Even if you don't ignore exceptions is forgetting that the exception may have skipped some code. E.g., closing files or database handles is the most benign, in that it just causes the program to eventually run out of resources and crash.

      A less benign case is when the code skipped was, for example, the login authentication. Carefully malformed data might not execute random code, but allow the user to escallate their rights to super-user.

      And while a buffer overflow might have turned your machine into a spam zombie, this will instead give them all your business data on a silver platter. Nicely formatted, indexed and searchable too. And allow them to change it too.

      3. In a twisted way, a secure language is the worst language because it causes complacency. Yes, it's a bit of an exaggeration, but bear with me while I make a point. Thinking "nah, we're secure because we use Java" (or SSL, or whatever) is the arch-nemesis of security. That way lies madness and skipping a real security analysis.

      E.g., where I work, we had a failed project coded not by us but by a team of uber-expensive consultants from a BIG corporation. Utterly incompetent monkeys, but expensive consultants anyway.

      It allowed a user to change their id to another user by merely editting the parameter in the URL. Since user id 0 was the super-admin, there you go, an easy way for everyone to escalate their privileges.

      It also allowed anyone to access and _edit_ any data, including other users' data and passwords, again by simply editting the URL. Including, yes, changing the passwords for the admin and then logging in as admin.

      It also allowed users to embed HTML text and even JavaScript in their text, which would be faithfully included in the page without quoting. Just in case you wanted to cause a JavaScript exploit or redirect to be displayed in other users' or admins' browser, you know.

      What was worse, though, was that it didn't quote text used to build SQL statements either, basically allowing anyone to exploit the program into giving them all the data in the system. (If they didn't already get to it via the previous two exploits. As they say, three's a charm.)

      Etc.

      Again, personally I'd rate that as _worse_ than a buffer overflow. Attacking a company's own web programs via buffer overflows, and finding your way from there to the data, is something only a die-hard black-hat would do. Even ordinary script kiddies with rootkits won't bother doing much more than installing a spam zombie or warez/porn ftp server there. Whereas this presented an intuitive, menu-driven, user-friendly way to own a company's business data. And _change_ that data as you see fit.

      In a nutshell, that's what happens when you start thinking that the language or libraries are a magic talisman. The moment you think "nah, we don't need a security analysis, because the holy Java will protect us"... that's when you are the most vulnerable.

      --
      A polar bear is a cartesian bear after a coordinate transform.
    11. Re:Blaming the language... by Moraelin · · Score: 2, Funny

      I thought the flood was wiping the test data and starting with a clean database :P

      --
      A polar bear is a cartesian bear after a coordinate transform.
    12. Re:Blaming the language... by realdpk · · Score: 1

      It would be very helpful to find out which big software company did that code. :)

    13. Re:Blaming the language... by Tim+C · · Score: 3, Insightful

      In a nutshell, that's what happens when you start thinking that the language or libraries are a magic talisman

      No, that's what happens when you employ clueless morons to write code for you. No language (that I'm aware of) can protect you from making those sort of fundamental errors. I guarantee that if the same team were to code in C/C++, the code would be full of buffer overflows *as well as* everything else you listed.

      It also highlights one of the potential dangers of completely outsourcing a software project - unless you get constant access to the code during development, you're helpless to prevent this sort of thing from happening. You only find out about it at the end, when it's very much more expensive to put it right.

      Anyway, I hope you got a fair chunk of your money back.

    14. Re:Blaming the language... by Anonymous Coward · · Score: 0

      we're all arrogant.

      I'm not, you condescending twat!

    15. Re:Blaming the language... by Edie+O'Teditor · · Score: 0
      Even ordinary script kiddies with rootkits won't bother doing much more than installing a spam zombie or warez/porn ftp server there. Whereas this presented an intuitive, menu-driven, user-friendly way to own a company's business data. And _change_ that data as you see fit.
      I find it hard to believe that this wasn't intentional. But then I've never really bought into the Hanlon's razor mindset - "Never attribute to malice that which can be adequately explained by stupidity."

      You don't have to be paranoid to believe that it's how they would want you to think.

      --
      If X is the new Y, and Y is "X is the new Y", solve for X.
    16. Re:Blaming the language... by Anonymous Coward · · Score: 1, Funny

      a million ex-burger-flippers typing randomly on a million keyboards for a million years will eventually produce Longhorn

    17. Re:Blaming the language... by Moraelin · · Score: 2, Interesting

      I'm open minded to malice explanations too. Or malice out of stupidity.

      In this particular case, doubly so. It fits just nicely with another "feature" of theirs, namely the ability of a user to erase all traces of themselves. You see, in the old system, users and records were never deleted, they were just flagged as deactivated. In their system, deleting a user, did just that: deleted the record. And because of foreign keys, it cascaded through all tables and erased _all_ records related in any way. Suddenly that user... has never existed, never posted anything and generally was figment of everyone else's imagination.

      However... in this case if they weren't utterly incompetent monkeys, they were damn good at faking it. There were a ton of other bugs and issues for which it's hard to find a malice-based explanation.

      Stuff like that they couldn't parse the phone numbers in the existing database, so they literally requested that some bugger edits a few hundreds of thousands of records per hand to match their format. (And if you think requesting that is idiotic, let's just say a PHB actually approved it. How idiotic is that?)

      Try as I might, I'd be hard pressed to imagine what devilishly clever advantage they'd get out of that. What clever back door can be gained by having one poor soul go manually through that mountain of data? It's just stupid.

      Or whereas the system they were replacing ran comfortably on one PC in Tomcat, their architecture needed a _ludicrious_ server farm to support the same load. Think: literally dozens of computers. Took many hours just to start or stop the behemoth.

      Again, I'm not sure what devilishly clever 0wnage would result from writing piss-poor unperformant code. Were they planning to DDOS it into submission later? Not much point in that, when you can already make yourself the highest ranking admin and cause more trouble.

      So on the whole, dunno, I have no trouble whatsoever assuming that they were, simply put, too stupid for those exploits to have been planned. In fact so stupid that if they had tried to code a back door, it would have probably been too buggy to work.

      --
      A polar bear is a cartesian bear after a coordinate transform.
    18. Re:Blaming the language... by Fulcrum+of+Evil · · Score: 2, Insightful

      A program that essentially contains tens of millions of lines of code. Even if they're mostly in libraries, they're still there.

      Yes, they're there, but 90+% of the code is now in isolated chunks that are easier to debug separately. That's the advantage of layered, modular code.

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
    19. Re:Blaming the language... by pilsner.urquell · · Score: 1
      I once saw a box to be checked labeled ''No buffer over run''. Might want to check that one, you think?

      Microsoft free since the first week of 3.1

    20. Re:Blaming the language... by ajs318 · · Score: 5, Insightful

      It is possible to write bad code in any computationally-complete language. (Corollary: Any language which makes it actually impossible to write bad code is computationally incomplete).

      It's also possible to write good code in a language that lets you write bad code. Perl has a bad {and IMHO undeserved} reputation, but there are two words that will keep you safe: use strict;

      There is a reason why C does not implement bounds checking. It is because the creators of C assumed any programmer either would have the sense to do so for themself, or would have a bloody good reason for wanting to do it that way. It's like a cutting tool which will let you start the motor even without all the guards in place. For the odd, freak case where you have to do something the manufacturers never thought of, it might be necessary to do things that way {think, a really unusual shaped workpiece which fouls on the guard no matter which side you try to cut it from, but which is physically big enough that you can hold it with both hands well clear of any moving machinery; two arrays where you know, from reading the compiler source code, that they will be stored one after another in memory where b[0] just happens also to be referenceable as a[200]}. The fact that I can't think of a plausible situation off the top of my head certainly doesn't mean there isn't one.

      Bounds checking as a matter of course would serve only to slow things down needlessly. Yes, the ability to exceed bounds can be abused. But you don't always need the check, and UNIX/C philosophy eschews performing any action without an explicit request. Sometimes the check is implicit. For instance, if you do a % or && operation, or are reading from a type such as a char, you already know the limits within which the answer must lie; so why need your programming language re-check them for you? And if you're only reading a value from an array and you don't actually set too much store by what comes out {maybe it's just some text you're presenting to the user}, then you could quite conceivably get away without doing any bounds-checking.

      Powerful tools are by definition potentially dangerous, and inherently-safe tools are by definition underpowered. But that isn't the problem. The problem is that programmers today are being brought up on "toy" languages with all the wipe-your-arse-for-you stuff, and never learning to respect what happens when you don't have all the handholding in place.

      Of course it's easier to blame the language, and more so when you are trying to sell people an expensive programming language that claims to make it harder to write bad code {and quite probably harder to write code that runs on anything less than 2GHz, but that's not your concern if you don't actually sell hardware}.


      PS. It's my bold prediction that before "no execute" becomes a standard feature on every processor, there will be an exploit allowing stuff labelled NX to be executed. It requires just one clueless user somewhere in the world with access to a broadband line, and ultimately will royally screw over any software that depends on NX for correct operation. More in next topic to mention this particular red herring.

      --
      Je fume. Tu fumes. Nous fûmes!
    21. Re:Blaming the language... by CoolGopher · · Score: 1
      But either way, everyone has their own X

      I have not only that - I have my own XX!

      (Okay, it's a really bad pun, I admit it...)

    22. Re:Blaming the language... by Fulcrum+of+Evil · · Score: 1

      two arrays where you know, from reading the compiler source code, that they will be stored one after another in memory where b[0] just happens also to be referenceable as a[200]}. The fact that I can't think of a plausible situation off the top of my head certainly doesn't mean there isn't one.

      In the first case, you either allocate a and b in one piece (b = a+200), or you write better code. Never rely on the compiler's internals. The reason C allows such behavior is due to its nature as a portable assembler language.

      PS. It's my bold prediction that before "no execute" becomes a standard feature on every processor, there will be an exploit allowing stuff labelled NX to be executed.

      Too late for that - NX is a standarad feature on x86 and has been for a long time. It is probably included in the other major architectures as well.

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
    23. Re:Blaming the language... by Edie+O'Teditor · · Score: 1
      In their system, deleting a user, did just that: deleted the record. And because of foreign keys, it cascaded through all tables and erased _all_ records related in any way. Suddenly that user... has never existed, never posted anything and generally was figment of everyone else's imagination.
      LOL! I don't know what kind of system it was but imagine that on any kind of business system. Sales clerk leaves ... customer calls up asking "Where's my freakin stuff I ordered?!?" and the person taking the phonecall is like ... "Mmmm, what order? ... and er, who are you?".
      Then six months later, J.Random Taxman turns up and ask why your invoice numbers aren't contiguous.

      Sheesh, even worse, imagine it's a bank!

      There were a ton of other bugs and issues for which it's hard to find a malice-based explanation.
      Smokescreen?
      In fact so stupid that if they had tried to code a back door, it would have probably been too buggy to work.
      Chortle! Nobody said malice and stupidity were mutually exclusive ... maybe the proverb should be amended to say "never attribute to malice alone..."
      --
      If X is the new Y, and Y is "X is the new Y", solve for X.
    24. Re:Blaming the language... by Anonymous Coward · · Score: 0

      "Never rely on the compiler's internals".

      Agreed. Compiler internals are subject to change from one release to another, and in any case one does not always have access to the compiler source for a particular platform.

      "The reason C allows such behavior is due to its nature as a portable assembler language."

      Again, agreed. And a portable assembler is a nice thing to have for doing some of the things one would have otherwise done in non-portable, native assemblers. These things do not however include writing large and complex end-user applications, for which C is akin to cleaning a very large floor with a very small toothbrush just because the toothbrush might fit into some nooks and crannies that a mop won't reach.

    25. Re:Blaming the language... by ajs318 · · Score: 1
      Never rely on the compiler's internals. The reason C allows such behavior [sic] is due to its nature as a portable assembler language.
      Any why shouldn't you rely on the compiler's internals, if you have read and understood the source code? Aren't you relying on the compiler's internals to some extent at least, every time you ever compile anything?
      NX is a standarad [sic] feature on x86 and has been for a long time. It is probably included in the other major architectures as well.
      It's still strictly for decoration, though -- and I hope I don't have to point out why that is so. If anybody actually relies upon non-executability of data marked NX for a mission-critical application, they will be in trouble.
      --
      Je fume. Tu fumes. Nous fûmes!
    26. Re:Blaming the language... by Fulcrum+of+Evil · · Score: 1

      Any why shouldn't you rely on the compiler's internals, if you have read and understood the source code?

      Quoting the AC who replied to me: Agreed. Compiler internals are subject to change from one release to another, and in any case one does not always have access to the compiler source for a particular platform.

      Aren't you relying on the compiler's internals to some extent at least, every time you ever compile anything?

      Only to the extent that it fulfills its role as a compiler, as defined by the language standard and documentation. Internal undocumented behavior is not included.

      It's still strictly for decoration, though -- and I hope I don't have to point out why that is so. If anybody actually relies upon non-executability of data marked NX for a mission-critical application, they will be in trouble.

      Let's see - the NX bit means that pointing your PC register at a protected page causes an exception. How is that decorative? Unless you have a compiler that automatically unprotects the stack, it's pretty damn effective.

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
    27. Re:Blaming the language... by Anonymous Coward · · Score: 1, Insightful

      "Bounds checking as a matter of course would serve only to slow things down needlessly."

      Then have the option to turn it on or off both globally (via a compiler switch) and locally with pragmas. Just leaving it out altogether is I think inexcusable.

      "Powerful tools are by definition potentially dangerous, and inherently-safe tools are by definition underpowered."

      That's why one needs both in the same toolkit. Java, Python et al are not appropriate tools for doing the things C does, hence their inclusion of mechanisms for interfacing with it. However, by the same token, C is not an efficient way of writing large end-user applications because programmers have to spend too much time micromanaging minutiae that have absolutely no bearing on what said large end-user application is supposed to be doing.

      "The problem is that programmers today are being brought up on "toy" languages with all the wipe-your-arse-for-you stuff, and never learning to respect what happens when you don't have all the handholding in place."

      People said exactly the same things about FORTRAN IV, C, and even assemblers in the days when "real programmers" used hex or binary. These "toy languages" isolated people from what was really going on, so they'd never actually know how "the machine" worked, and boy, would they live to regret that when they had to write some piece of code that actually depended on how long it took for the memory drum to rotate!

      There is an old saying which goes thus: "Being able to bang nails in with one's fists a good carpenter does not make. The clever man uses a hammer".

    28. Re:Blaming the language... by ThosLives · · Score: 4, Insightful
      Bugs in the code are simple to fix. The more problematic issue is that often times the bugs are in the design. Part of the problem is that people don't apply good engineering practices to code. I've never heard of a software FMEA (Failure Mode Effects Analysis) or things of that nature. Do people do boundary diagrams for a piece of software? Are all the noise factors analyzed? Do people conform to the specifications? Do people unit test their code?

      Software problems generally exist because the specification was either nonexistant or poorly written, or the specification wasn't followed. Very rarely is it actual incompetance of a coder. But when a spec for a message handler, for instance, assumes that there will only be a certain length and nothing outside that spec guarantees that length, it's not the person coding that function to check for the length - s/he only has the spec by which to go (because people still haven't figured out how to not throw designs over the wall for implementation).

      Complexity of a system does make things difficult, but good design mitigates a lot of problems. (Note I didn't say "eliminates" but "mitigates").

      --
      "There are a dozen opinions on a matter until you know the truth. Then there is only one." - CS Lewis (paraprhase)
    29. Re:Blaming the language... by ThosLives · · Score: 1

      Yes, but you forget that most of the bugs are not in the little modules of code, but in the interaction between those chunks. Buffer overflows are because the thing with the overflow assumed that the thing giving it data would make sure it's a certain length, and the thing that gives it data assumed the chunk would handle different lengths of data gracefully. It's an interface problem, not a code-fragment problem. This is where good testing comes in, and where good system design comes in. A friend of mine has this theory that complexity goes up as N^2, or maybe even 2^N, where N is the number of little parts you have. This is not because each part is complex, but because the interfaces between the parts are complex.

      --
      "There are a dozen opinions on a matter until you know the truth. Then there is only one." - CS Lewis (paraprhase)
    30. Re:Blaming the language... by Moraelin · · Score: 1

      "LOL! I don't know what kind of system it was but imagine that on any kind of business system. Sales clerk leaves ... customer calls up asking "Where's my freakin stuff I ordered?!?" and the person taking the phonecall is like ... "Mmmm, what order? ... and er, who are you?".
      Then six months later, J.Random Taxman turns up and ask why your invoice numbers aren't contiguous.

      Sheesh, even worse, imagine it's a bank! .
      "

      Even worse imagine that it's a business-to-business system. Also imagine that a user (representing another company) can personally cancel their own account. Basically completely removing any trace of himself/herself from the system.

      "What? I never said I'd supply you with X tons of Y for 12 months, at Z dollars per ton. I never even was on your site!"

      And there you have it in all its glory: a whole bloody factory is in limbo for lack of supplies and materials. The costs for that kinda fuckup, I'd assume, are quite nasty.

      --
      A polar bear is a cartesian bear after a coordinate transform.
    31. Re:Blaming the language... by Moraelin · · Score: 4, Insightful

      "No, that's what happens when you employ clueless morons to write code for you."

      You are, of course, right. We can aggree on that wholeheartedly.

      However, it doesn't invalidate what I've said. You just detailed one effect of what I was basically saying.

      The problem is that the moment someone actually believes "nah, we can't have bugs because we're protected by the holy power of Java" (or "we don't need good coders because Java/VB/whatever is easy to program"), they invariably go and hire the cheapest morons they can find.

      It's not even a slippery slope argument. It's not a case of A slowly leading to B which leads to C which eventually leads to D. Here it's direct cause and effect. A straight short road from A to D.

      Being able to write all their programs with 2 ex-burger-flippers paid $5 per hour is _the_ wet dream of the industry. So anything which promises to make that even remotely viable, _is_ in fact used as a justification to do just that: fire all those high paid nerds and hire the cheapest monkey in a suit.

      Unfortunately, it doesn't work that way. No matter how easy the IDE, language or libraries make it to program, they can't force an untrained monkey to understand security, do a security analysis and write secure code. The less skilled people you can use to string together OCX controlls they don't understand in VB.NET (or Java, or whatever other language), the less clue they'll also have about making it secure.

      And even if the language prevents them from having straight buffer overflows, they'll find other ways to make the program even more insecure. Because they don't even understand what they're doing.

      So in a sick and twisted way, as I've said, the better tools you have, the poorer programs you end up with. Among other ways, yes, because the more clueless morons get hired to use those tools.

      --
      A polar bear is a cartesian bear after a coordinate transform.
    32. Re:Blaming the language... by Fulcrum+of+Evil · · Score: 1

      Yes, but you forget that most of the bugs are not in the little modules of code, but in the interaction between those chunks.

      Once you've got your code organized into modules (with restricted interaction), it's easier to lock the interfaces down. This means validating intermodule calls almost as much as validating external data.

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
    33. Re:Blaming the language... by Crash6-24 · · Score: 1

      The point of the article was that with a bad basic design you spend the rest of your life patching and compromising. C/C++ allows buffer overflows - so you can check or not as you wish and have security or not.
      A good programmer is not necessarily a secure programmer - it depends on what the boss wants.

    34. Re:Blaming the language... by Anonymous Coward · · Score: 0

      The problem is that nobody writes perfect code.

      I used to have an acceptance of that, being a programmer myself and knowing my stuff has bugs. But I'm seeing more and more software with MAJOR flaws that I find within minutes of using the application. I'm not asking for perfect software, but I would at least expect them to debug significantly. Some of my favorite programs have bugs that I tend to discover of weeks or months. I should NEVER see significant flaws over minutes, and hours - those are the problems which should have been fixed, but it's becomming common just to push them through the door I guess.

    35. Re:Blaming the language... by BRSloth · · Score: 3, Insightful

      Complex systems are difficult to debug.

      That's why you should *always* do simpler systems that do one small thing, but do it *right*.

      That's the first rule you learn with Unix.

    36. Re:Blaming the language... by ajs318 · · Score: 1
      Aren't you relying on the compiler's internals to some extent at least, every time you ever compile anything?

      Only to the extent that it fulfills its role as a compiler, as defined by the language standard and documentation. Internal undocumented behavior is not included.
      The compiler source code is part of the documentation. Admittedly, it's a highly advanced topic; but it's not one you should be afraid of. Of course, if you assumed without checking that b[0] would follow a[199], and you failed to comment in your code what you were doing when you mucked about with a[200], then you deserve what you get.
      the NX bit means that pointing your PC register at a protected page causes an exception. How is that decorative?
      It's decorative in the sense of a thin paper screen in front of an open fire. In other words, it doesn't actually offer you any real protection at all; but a person who did not fully appreciate what would be the likely consequence of a hot piece of fuel being ejected from the fireplace towards such a screen, might nonetheless feel lulled into a false sense of security by its presence -- and end up getting burned worse than if the screen wasn't there.
      --
      Je fume. Tu fumes. Nous fûmes!
    37. Re:Blaming the language... by brpr · · Score: 1

      The compiler source code is part of the documentation. Admittedly, it's a highly advanced topic; but it's not one you should be afraid of. Of course, if you assumed without checking that b[0] would follow a[199], and you failed to comment in your code what you were doing when you mucked about with a[200], then you deserve what you get.

      It's not part of the documentation of ANSI C, and it's not part of the documentation of the compiler.

      Admittedly, it's a highly advanced topic; but it's not one you should be afraid of. Of course, if you assumed without checking that b[0] would follow a[199], and you failed to comment in your code what you were doing when you mucked about with a[200], then you deserve what you get.

      Why on earth would you want to do this, making you dependant one one version of one compiler? Why not just write the code using one array and make it portable.

      It's decorative in the sense of a thin paper screen in front of an open fire. In other words, it doesn't actually offer you any real protection at all; but a person who did not fully appreciate what would be the likely consequence of a hot piece of fuel being ejected from the fireplace towards such a screen, might nonetheless feel lulled into a false sense of security by its presence -- and end up getting burned worse than if the screen wasn't there.

      It's better than nothing.

      --
      Freedom is not increased by mere diminuation of government. Anarchy is freedom for the strong and slavery for the weak.
    38. Re:Blaming the language... by Fulcrum+of+Evil · · Score: 1

      The compiler source code is part of the documentation. Admittedly, it's a highly advanced topic; but it's not one you should be afraid of.

      Reading the compiler source to see what I can get away with crosses the line between brave and stupid.

      In other words, it doesn't actually offer you any real protection at all

      Explain please. I jump to a stack address and my program blows up. How is that not protection?

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
    39. Re:Blaming the language... by Anonymous Coward · · Score: 0

      Yes, we're all nerds, and we're all arrogant. We all like to act as if _our_ code is perfect, while everyone else is a clueless monkey writing bad code. _Our_ bugs are few and minor, if they exist at all, while theirs are unforgivable and should warrant a death sentence. Or at the very least kicking out of the job and if possible out of the industry altogether.

      Nah, that's not a problem. The trouble is, they think that way too.

    40. Re:Blaming the language... by Anonymous Coward · · Score: 0

      Whoa, i guess the flood was a buffer overflow!

    41. Re:Blaming the language... by tepples · · Score: 1

      Bounds checking as a matter of course would serve only to slow things down needlessly. Yes, the ability to exceed bounds can be abused. But you don't always need the check, and UNIX/C philosophy eschews performing any action without an explicit request. Sometimes the check is implicit. For instance, if you do a % or && operation, or are reading from a type such as a char, you already know the limits within which the answer must lie

      And so does the compiler, if it implements any sort of robust type inference. A compiler that knows the range of values can perform the checks at compile time; otherwise, how would -Wunreachable-code work? If it can't automatically infer the bounds, you can use an assert to tell the compiler.

      And I have a better example than your a[200] immediately followed in memory by b[200]: zero-length arrays at the end of a struct.

      Of course it's easier to blame the language, and more so when you are trying to sell people an expensive programming language that claims to make it harder to write bad code {and quite probably harder to write code that runs on anything less than 2GHz, but that's not your concern if you don't actually sell hardware}.

      Running a compiled Common Lisp program at human-interactive speed does not take 2 GHz to run.

    42. Re:Blaming the language... by ajs318 · · Score: 1
      In other words, it doesn't actually offer you any real protection at all

      Explain please. I jump to a stack address and my program blows up. How is that not protection?
      That sort of thing shouldn't happen in the first place. If it's an accident, something you're using is seriously broken. If it's on purpose ..... well, that's a different matter altogether.

      I have been making veiled allusions to the idea that NX by itself doesn't stop someone running malicious code if they really want to. Obviously these were too heavily veiled, for which I apologise. Since a processor which includes "NX" protection must have the ability to execute code from somewhere, all it takes is for someone to get a programme running somehow, to patch in a new exception handler which will then arrange for the "NX" code to be executed -- whether that be by clearing the NX flag {assuming the hardware is based on legacy designs; the 8080 could execute instructions supplied by external devices for chuff's sake, and that was the real point of the eight RST instructions if you ask me -- they all go 00xxx000 .....}, copying the code to an executable portion of memory, or by implementing an emulator {sounds hard, but where there's a will, there's a way, and believe me, there's a will alright}.

      BTW, someone mentioned memory drums ..... You didn't need stacks in those days. You knew how long your subroutine was, and before you called it you overwrote the instruction after last with a jump to where you wanted to return to. Or, if you were lucky, the address of the instruction that would have executed next had you not jumped would be in a register when you did jump; and you then could store it straight into the address field of a jump instruction that you happened to know was your "return". First-generation ARM processors used to work exactly that way.
      --
      Je fume. Tu fumes. Nous fûmes!
    43. Re:Blaming the language... by Politburo · · Score: 1

      One more thing about the article: his "darwinian" approach, by which the most popular program get the most vulnerabilites because they attract the most attacks, has two fallacies:

      Slow down, buddy. No one said that it was a black and white divide where programs above a certain circulation are targetted and those below are not. One counter-example does not mean that it's "wrong". It's merely a generalization.

    44. Re:Blaming the language... by Fulcrum+of+Evil · · Score: 1

      I have been making veiled allusions to the idea that NX by itself doesn't stop someone running malicious code if they really want to. Obviously these were too heavily veiled, for which I apologise. Since a processor which includes "NX" protection must have the ability to execute code from somewhere, all it takes is for someone to get a programme running somehow, to patch in a new exception handler which will then arrange for the "NX" code to be executed -- whether that be by clearing the NX flag {assuming the hardware is based on legacy designs; the 8080 could execute instructions supplied by external devices for chuff's sake, and that was the real point of the eight RST instructions if you ask me -- they all go 00xxx000 .....}, copying the code to an executable portion of memory, or by implementing an emulator {sounds hard, but where there's a will, there's a way, and believe me, there's a will alright}.

      Ok, how does this work in the real world? All executable memory is read only, the stack is NX, and hardware exception handlers are not available from user code. Patching exception handlers died with DOS, remember. Even if it were possible to work around this protection, you've raised the bar, and by quite a bit.

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
    45. Re:Blaming the language... by runderwo · · Score: 1
      Too late for that - NX is a standarad feature on x86 and has been for a long time. It is probably included in the other major architectures as well.
      Two problems:

      1: NX on x86 has always been on a per-segment basis. The execute protection bit on pages was curiously omitted. Intel was assuming back then that everyone would be using a segmented memory model instead of a flat memory model, apparently. The existing x86 stack protection hacks exploit the per-segment protections at the expense of speed.

      2: NX protection has not existed until recently on some other notable architectures, like MIPS and PowerPC.

    46. Re:Blaming the language... by gadget+junkie · · Score: 1

      "No one said that it was a black and white divide where programs above a certain circulation are targetted and those below are not. One counter-example does not mean that it's "wrong". It's merely a generalization.

      As you will recall, no generalization is true. Not even this;-)

      --
      "If a boss demands loyalty, give him integrity. But if he demands integrity, give him loyalty." (John Boyd, 1927-1997)
    47. Re:Blaming the language... by joss · · Score: 2, Insightful

      > people don't apply good engineering practices to code

      I've heard this argument a lot, but it's wrong.

      When engineers make a new airline/bridge/circuit, they model the entire thing on a computer first. The CAD model is an unambiguous model of the plane. Important subsystems in it are modelled and analysed independently and in conjunction with the components around it.

      So, if writing software was similar, we would first model the software on a computer. Oh, er, wait a moment. In an important sense, software is a design. The only unambiguous design is the actual software [otherwise we could make the design the programming language]. So, one could have a notion of starting with a fuzzy design and gradually making it clearer, but you can still end up with a bad design.

      When someone designs a bad aircraft, the design is modelled, flaws are found and the design is improved. Nobody builds the thing until they feel pretty sure the design is right. However, software is often bad for the same reason that an initial design of anything else is bad. If it was equivalent to an airplane, windows 95 for instance, once designed, would never have been built. However, once the design for a piece of software is complete, one has created the software. The development money has been spent, so the makers will try to get what they can for it. It's *all* design.

      High level programming languages are the most elegent way we can think of to
      describe logic. We can sometimes model the *question* in a better way.
      That is what a detailed spec, use cases, etc are about.

      --
      http://rareformnewmedia.com/
    48. Re:Blaming the language... by ThosLives · · Score: 1
      If the argument is wrong, then why is there not a dearth of good code?

      However, I'd like to address this line: "The only unambiguous design is the actual software" (by "software" I assume you mean "code". I have absolutely no clue what you mean by "..we could make the design the programming language.") Software cannot be the design any more than an automobile is the automobile design. The automobile reflects the design for the automobile, and code must also reflect the design for the software.

      Here is a breakdown of the ideal engineering process:

      1. Get requirements. Make sure they are the right requirements from the customer's standpoint (the customer and supplier both agree on what the supplier is going to give to the customer). In excruciating detail. This is the first point of failure in engineering: people generally get the wrong requirements.
      2. Draft a design. A design cannot be tested directly, but the design must be examined to see that it should meet the requirements. Here's the second point of failure, where the design is not examined thoroughly enough for requirement compliance.
      3. Implement the design. This could be writing some functions in code, building a physical model, or building a virtual model (the CAE to which you referred. Note that CAD is just a drawing - a design - not an implementation. An implementation is something that can tested. Recall that you cannot test a design, only examine it).
      4. Check that the implemented thing meets the design. For hardware, it's making sure the dimensions are correct, that you used the right materials, etc. For code, it's examining the code to make sure it implements the algorithms stated in the design. If the implementation does not meet the design, you have to build another implementation - make a new prototype, make a new virtual model, change the function. This is probably the most common point of failure in any engineering project (although it may not be the most serious - the most serious are usually an incorrect requirement or incorrect design). The failure here is that the implemented thing doesn't actually match the design. An implementation that doesn't match the design invalidates all further testing.
      5. Test the implementation. Here is where you check to make sure the thing you built (code, virtual hardware, physical hardware) meets the requirements. What you're doing here is confirming that your design meets the requriements. If these tests do not pass, you know the design needs to be changed. Typically what happens at this stage is that people just start changing the implementation (change the code, modify parts, etc.) but they don't consult the design. Testing is usually not a big point of failure, although some folks don't know how to define or run tests. More common, probably, is that people ignore the results of the tests.

      The point of all that is to show that, if you don't have a design, your final product may by pure luck meet the requirements - but there's no way to ensure that all future products will without a design. Software is not a design - software is a product. It absolutely reflects the design, but it is not the design.

      I think the confusion between design and implementation is very rampant in all engineering circles - at least in industry (I'm not sure if they're any better in academia). Saying "I need to send a message to tell the customer their car stalled" is a requirement, saying "I'm going to use a red light" is a design (more requirements come from the choice to use a red light - it must use 12 volts, must not consume more than 100 mA, etc.). Using Company Ex part number LED-12345 is the implementation. If you think that using LED-12345 is your design, I'd say that you're mistaken.

      In the software land, you might have a requirement like "I want a program that says hello to the user". The design is "write the sentence 'hello user!' on the screen". You may then have another design choice: "Use C" - or you could have a requirement that says "thi

      --
      "There are a dozen opinions on a matter until you know the truth. Then there is only one." - CS Lewis (paraprhase)
    49. Re:Blaming the language... by Anonymous Coward · · Score: 0
      In theory you are right...


      Yes, in theory. What else would it be?

    50. Re:Blaming the language... by Fortress · · Score: 1

      I think I get what you're saying here.

      It's impossible to make a language foolproof because fools are so ingenious at being foolish. Making a language more foolproof only encourages bigger fools to use it (or be hired to use it).

      Makes some sense, I suppose, but what solution is there? Make all languages potentially non-secure so that companies are scared into hiring the best programmers they can afford? Unlikely, and this wouldn't improve the overall situation.

    51. Re:Blaming the language... by Hentai · · Score: 1

      You forgot step 6, which is 'make sure the implementation which meets the customer's original requirements, meets the customer's current requirements'. Most projects I've seen fail at this crucial step, because the customer's requirements have often changed - in ways like "must accept that I cannot now afford to pay for it" or "must accept that I did not ever intend for this project to be completed, and was in fact being set up for failure by my own superiors". Things like that.

      --
      -Hentai [in vita non pacem est]
  4. Re:Popularity not the problem. by Anonymous Coward · · Score: 0

    Perhaps you could RTFA and then refute specific points rather than reading the blurb and making a blanket statement with nothing to support it other than your reflexive thinking.

  5. Not just C/C++ by Dancin_Santa · · Score: 4, Interesting

    Any compiled language is susceptible to security holes. The problem is that the process of turning source code into binary code is opaque to the developer. He puts some code through the compiler and some binary object code pops out. Things like memory offsets, code areas, data areas, and all these esoteric issues that need to be dealt with are simply left to the compiler to decide.

    Unlike interpreted languages which for the most part implement all code as either line-by-line interpretation or in bytecode form, compiled languages talk directly to the CPU. Interpreted environments have the additional benefit that they run inside of a sandbox that is abstracted from the hardware by some large degree. Because of this, the running code never actually touches the CPU directly.

    Things like the "no-execute" bit on modern CPUs provide an additional layer of security and prevent purposely damaged code from running directly on the CPU. However, until operating systems implement this in their own code, any application that does not want to adhere to the no-exec flag does not have to. This is like flock on Unix which only sets a file locking flag which applications are expected to obey rather than true file locking as implemented on other systems.

    1. Re:Not just C/C++ by Drantin · · Score: 1
      Unlike interpreted languages which for the most part implement all code as either line-by-line interpretation or in bytecode form, compiled languages talk directly to the CPU.


      Huh? Do you mean something like Java, where you have a virtual machine, something like Bash Scripting, which doesn't do what you're talking about, or are you merely advocating writing in ASM directly, which AFAIK is the only language with implement all code as either line-by-line interpretation or in bytecode form
      --
      Actio personalis moritur cum persona. (Dead men don't sue)
    2. Re:Not just C/C++ by Drantin · · Score: 1

      or since this topic seems to be mostly about MS consider .net along with java for the virtual machine category...

      --
      Actio personalis moritur cum persona. (Dead men don't sue)
    3. Re:Not just C/C++ by TheLink · · Score: 4, Insightful

      All languages are susceptible to security problems.

      However C and C++ (and a few other languages) are susceptible to buffer overflows - where it is common for bugs to cause "execution of arbitrary code of the attacker's choice" - this is BAD.

      There are saner languages where such things aren't as common. While Lisp can be compiled, AFAIK it is not inherently susceptible to buffer overflows. OCaml isn't susceptible to buffer overflows either and is in the class of C and C++ performance-wise.

      "arbitrary code of the attacker's choice" can still be executed in such languages, just at a higher level = e.g. SQL Injection. Or "shell/script".

      However one can avoid "SQL injection" with minimal performance AND programmer workload impact by enforcing saner interfaces e.g. prepared statements, bind variables etc.

      How does one do the same thing with respect to buffer overflows and C or C++, AND still have things look and work like C or C++?

      --
    4. Re:Not just C/C++ by themo0c0w · · Score: 4, Insightful
      The problem is that the process of turning source code into binary code is opaque to the developer. He puts some code through the compiler and some binary object code pops out.
      Interpreted environments have the additional benefit that they run inside of a sandbox that is abstracted from the hardware by some large degree. Because of this, the running code never actually touches the CPU directly.

      So is being distanced from the hardware good or bad? If anything, interpreted languages put the programmer more distant from the operating hardware.

      The problem with compiled languages like C(++) are that you DO have to deal with memory management directly, thus creating buffer overflow exploits. However, all languages are vulnerable to input verification problems, of which buffer overflows are a subset. The problem is sloppy programmers, not bad languages, compiled or otherwise.

      Also, no offense, but compilers are pretty damn smart pieces of software. Almost all security problems arise from the application software, not the compiler/interpreter.

      Furthermore, the difference between compilation and interpretation is not particularly distinct these days, anyway, especially when dealing with VMs. You "compile" Java into bytecodes, which are executed by the Java VM, which in turn compiles and executes native code for the host machine. Conversely, many processors perform on the fly "translation" of instructions from one ISA to another.

      --
      ph34r teh p0w3r 0f th3 c0w
    5. Re:Not just C/C++ by ikewillis · · Score: 2, Informative
      Things like the "no-execute" bit on modern CPUs provide an additional layer of security and prevent purposely damaged code from running directly on the CPU. However, until operating systems implement this in their own code, any application that does not want to adhere to the no-exec flag does not have to. This is like flock on Unix which only sets a file locking flag which applications are expected to obey rather than true file locking as implemented on other systems.

      Wrong. sparcv9, for example, implements a non-executable user stack per default. In POSIX, all memory from the heap is pre-marked non-executable (on architectures that support page protections) unless it is explicitly set by the program to be executable (for example, in JIT compilers) using functions like mprotect(). In Windows, this is implemented as a flag passed to HeapAlloc().

      The interface design and OS support is already there, what isn't is people buying non-IA32 CPUs in large numbers.

    6. Re:Not just C/C++ by Foolhardy · · Score: 3, Interesting
      Any compiled language is susceptible to security holes. The problem is that the process of turning source code into binary code is opaque to the developer. He puts some code through the compiler and some binary object code pops out. Things like memory offsets, code areas, data areas, and all these esoteric issues that need to be dealt with are simply left to the compiler to decide.
      Are you saying that all high-level languages that can compile use a process of producing machine language so opaque that the developers cannot produce predictable, consistent and detirminstic code without an extreme amount of effort?

      Any self-respecting language will produce a binary that does what the source code says it should do, in exact detail. As for complexity or how much detail you get in that control, depends on the language. C and C++ are languages that give you some of the strongest control. Unfortunately, this amount of control can get you to hang yourself if you aren't careful. Use the best language for the problem. (they aren't all the same.)
      Unlike interpreted languages which for the most part implement all code as either line-by-line interpretation or in bytecode form, compiled languages talk directly to the CPU. Interpreted environments have the additional benefit that they run inside of a sandbox that is abstracted from the hardware by some large degree. Because of this, the running code never actually touches the CPU directly.
      Protected memory CPUs can provide every bit as much protection for the rest of the system as a VM can; it's hardware VM support for memory. That's the point of protected memory. Also, many VMs provide a on-demand compiler that produces native code so the program can execute directly on the CPU because it's faster. Any limits imposed on the language's environment can be done without a VM.
      Also, user-mode processes never talk to any hardware but the CPU and memory, as allocated by the OS.

      The IBM AS/400 has no protected memory and does not need VMs to provide system security because there are only two ways to get binary code onto the system: 1. From a trusted source or 2. from a trusted compiler that only produces code that adheres to security regulations.
      Things like the "no-execute" bit on modern CPUs provide an additional layer of security and prevent purposely damaged code from running directly on the CPU. However, until operating systems implement this in their own code, any application that does not want to adhere to the no-exec flag does not have to. This is like flock on Unix which only sets a file locking flag which applications are expected to obey rather than true file locking as implemented on other systems.
      The no-execute bit provides hardware negation of a certain type of attack. It does not protect against corruption of program memory, which can lead to crashes and other types of vulns. Yes, like many things, it only works effectively when it's used correctly. The most common form of buffer overrun that can lead to code execution is on the stack. Unless the compiler (or the assembly) produces code that needs the stack to be executable, the operating system can safely mark all thread stacks as no-execute. Although you can move the stack to some private section of memory, the OS is usually aware of where the thread's stack is because it's needed to start the thread and it isn't normally moved. XPSP2 in Windows does this for all threads in system service processes by default when the NX bit is supported, or programs not on a blacklist upon request.
    7. Re:Not just C/C++ by Baki · · Score: 4, Insightful

      Hmm, try putting a web server implemented in shell script on the internet and see what happens :). Shell scripts are interpreted, but have so many "tricks" such as backtick expansion, variable expansion etc. that it is virtuall impossible to write a safe program with it.

      I don't see how program safety has something to do with being compiled or not. It is just a different class of security holes that you get depending on the language.

    8. Re:Not just C/C++ by nihilogos · · Score: 1

      How does one do the same thing with respect to buffer overflows and C or C++, AND still have things look and work like C or C++?.

      In the case of C++ you'd use the standard library containers, which you should be using anyway so I don't understand why people go on about buffer overflows in C++.

      In the case of C you could, for example, use strlen().

      --
      :wq
    9. Re:Not just C/C++ by spongman · · Score: 1

      it should be said that prepared statements and parameter binding usually increases performance, especially if your DBMS is able to cache the query.

    10. Re:Not just C/C++ by Anonymous Coward · · Score: 0

      How does one do the same thing with respect to buffer overflows and C or C++, AND still have things look and work like C or C++?

      You'd take quite a performance hit, and have to change the way you code.. but you could easily create a class in c++ for each memory allocation, and instead of directly writing to memory (e.g. *mem, mem[]), you would use memory.write(address, value), or memory.read(address value). Have these functions automatically ignore out of bounds writes, maybe even give you an alert to stdout.
      You could do something similar with c and structs with an API set.

      What I do though is just allocate all of my memory blocks to powers of two, regardless of how much memory I need. Then I can perform a simple bitwise-and on the memory address before accessing it.
      ex: unsigned char mem[64];
      mem[ (x & 63) ] = value;
      If you need to add pointers, then just use pointer position comparisons.
      ex: unsigned char mem[64], end_mem[1];
      unsigned char *ptr = mem + x;
      if((ptr + y) < end_mem)*(ptr + y) = value;

    11. Re:Not just C/C++ by Brandybuck · · Score: 4, Insightful

      How does one do the same thing with respect to buffer overflows and C or C++, AND still have things look and work like C or C++?

      This is borderline troll material! Would you stop beating that dead horse? You avoid buffer overflows in C by checking the lengths of your buffers. You stop using C strings. You use container libraries. As for C++, you avoid them by using the included string and container classes.

      --
      Don't blame me, I didn't vote for either of them!
    12. Re:Not just C/C++ by Anonymous Coward · · Score: 2, Insightful

      Methinks you have never done any serious coding in C.

      Consider, for example, the following valid bit of C code:

      #include <stdio.h>
      #include <stdlib.h>
      #include <string.h>

      int main()
      {
      char* a = "abcdefg";
      a[8] = 'a';
      printf("%d\n", strlen(a));
      return 0;
      }

      This even compiles on gcc with -Wall without any errors or warnings, yet it segfaults every time you run it.

    13. Re:Not just C/C++ by Anonymous Coward · · Score: 0

      This does not compile under VC.Net.

      The original a string is designated const, so the attempt to change it in the second line causes the compiler to issue an error. If you had wanted to do this in VC, you'd have to malloc the string or declare it as an array.

      VC better than gcc? Say it ain't so!

    14. Re:Not just C/C++ by Anonymous Coward · · Score: 0

      Hahahaha, I prolly just forgot some -std=c99 flag or something. It probably doesn't work with -ansi either :-)

      The point being made still stands, however -- perhaps the original poster was referring to strnlen? In which case you can _still_ get overflows/stack overruns if you are careless about bounds checking and keeping track of how long each string actually is.

    15. Re:Not just C/C++ by archeopterix · · Score: 4, Insightful
      This is borderline troll material! Would you stop beating that dead horse? You avoid buffer overflows in C by checking the lengths of your buffers. You stop using C strings. You use container libraries. As for C++, you avoid them by using the included string and container classes.
      I am sure we all know the theory, but to me it's like saying "you avoid bugs by following good coding practices".

      I am sure that Microsoft, Linux, Apache and whatnot other programmers know the theory too. Too bad that buffer overflows still happen.

    16. Re:Not just C/C++ by mdfst13 · · Score: 1

      "The problem is that the process of turning source code into binary code is opaque to the developer."

      No, the problem with C is that it allows people to do things that they shouldn't. This is why it is a great language when the absolute best performance is required. It doesn't do multiple automatic input verifications; instead, it leaves input verification entirely to the programmer. In other words, C makes the programmer take the responsibility for writing secure programs.

      The kind of problem that you are discussing is more what you see with the use of various APIs. The problem is that there isn't a good way in C to state that an API does or does not do input verification. Further, some of the APIs might be expected to do input verification but not (e.g. the JPEG library vulnerabilities).

      Some people use this to argue that programming languages should be "idiot proofed" from buffer overflows, etc. While this is not ideal (automatic input verifications waste time, since they will check the same data multiple times), modern compilers should be able to compile out most of the inefficiencies. Further, APIs are having to do this anyway. If this is done in the language, then the compiler at least has the chance to compile out multiple instances of the same input checking.

      Of course, this also means that programmers will lose the habit of adding input verification to their programs. This will make it difficult to find people to write the input verification into the compiler, as is required in this model. But then, many programmers never had the habit of writing in input verification; that's why there are so many programs vulnerable to buffer overflows.

    17. Re:Not just C/C++ by geg81 · · Score: 2, Insightful

      There are saner languages where such things aren't as common. While Lisp

      You make it sound as if avoiding buffer overflows is some kind of obscure, costly language feature. No. C/C++ are exceptional (exceptionally bad) in that they permit this; most programming languages don't permit this to happen, and many of them still give you about the same performance and the same low-level control as C/C++.

      How does one do the same thing with respect to buffer overflows and C or C++, AND still have things look and work like C or C++?

      It's not hard, you just need to distinguish two kinds of pointers: the safe variety (like object and array "references" in Java) and the unsafe variety (like the ones used by C programmers). The unsafe variety is where all the problems come from and it only needs to be used rarely.

    18. Re:Not just C/C++ by geg81 · · Score: 4, Insightful

      If it were that simple, than there should be no buffer overflows in modern C/C++ programs. But it apparently isn't that simple, for several reasons. Using container libraries costs extra time and effort, and it is less efficient than error checking that is built into the compiler, for example. Also, using container libraries is not something that the C/C++ compilers help enforce; that is, if some module doesn't use it, nobody ever gets warned about it.

      To dismiss such concerns as "borderline troll material" is just stupid; apparently, you think that any opinion that inconveniences you should just be suppressed. Look at the bug lists and security alerts: the problem isn't going away. We need better tools to help people avoid it, and plain C/C++ apparently isn't enough for real-world programmers not to make these mistakes.

    19. Re:Not just C/C++ by a_n_d_e_r_s · · Score: 2, Insightful

      Thats because thare are way to many programmers who think they know more than that they acutally do.

      For example; they think they know how to program a computor.

      --
      Just saying it like it are.
    20. Re:Not just C/C++ by geg81 · · Score: 3, Insightful

      So is being distanced from the hardware good or bad?

      The issue has nothing to do with distance from the hardware. The kind of pitfalls C and C++ have are avoidable even in low-level languages.

      The problem with compiled languages like C(++) are that you DO have to deal with memory management directly, thus creating buffer overflow exploits. However, all languages are vulnerable to input verification problems, of which buffer overflows are a subset.

      We fix things one problem at a time. We can't do anything about general input verification, but we can help sloppy programmers avoid problems with buffer overflows and memory allocation by automating it.

      The problem is sloppy programmers, not bad languages, compiled or otherwise.

      These are the sloppy programmers that are writing the code we all use. Preaching at them hasn't helped for the last several decades, so it isn't going to help now. Whether it is their moral failing that they produce bugs or not, obviously, they need something else to help them produce better code.

      We put safety features into lots of products: plugs, cars, knives, etc., because we know people make mistakes and people are sloppy. Trying to build programming languages without safety features and then blaming the programmer for the invariable accidents makes no sense.

      Furthermore, the difference between compilation and interpretation is not particularly distinct these days, anyway,

      The presence of safety features does not depend on the nature of the language. You can have a language identical in semantics, performance, and flexibility to C (or C++) and make it much less likely that people will accidentally make errors in it (while probably being more productive at the same time).

    21. Re:Not just C/C++ by fstanchina · · Score: 1

      For example; they think they know how to program a computor.

      ...or grammar.

    22. Re:Not just C/C++ by Anonymous Coward · · Score: 0

      If buffer is already overflowed, strlen won't do any good. You should really keep the lenght of the buffer somewhere and you "safe" functions like strncpy to handle C-style strings (and use them correctly remembering that they don't include terminatin NUL to string).

      In C++ you would create nice class to hold the character buffer, maximum length of it and current length. Then you can test your class with every imaginable way and ultimately get safe string-class from it (well, not necessarely:)

      In C you can make structure to hold character buffer and lengths and make functions which uses those structures in correct way.

      But when you release your code as library I'm 100% sure that there is someone who does some brain-dead code like this:

      std::string foo("bar");
      char *p=(char*)foo.c_str();

    23. Re:Not just C/C++ by Anonymous Coward · · Score: 0

      In the case of C you could, for example, use strlen()

      Congratulations on your new buffer overflow, just waiting to happen. Thanks for being the architypical example of a programmer who doesn't understand how buffer overflows happen in C, too.

      strlen() to avoid buffer overflows. Good grief.

    24. Re:Not just C/C++ by dkf · · Score: 1
      "arbitrary code of the attacker's choice" can still be executed in such languages, just at a higher level = e.g. SQL Injection. Or "shell/script".

      However one can avoid "SQL injection" with minimal performance AND programmer workload impact by enforcing saner interfaces e.g. prepared statements, bind variables etc.

      How does one do the same thing with respect to buffer overflows and C or C++, AND still have things look and work like C or C++?

      You avoid buffer overflows in C (and C++ too) by using a better I/O lib (and yes, they do exist, and as free software too!) and a string library that does bounds checking. You test those rigorously to make sure they do what they say on the tin. You make sure your functions do bounds checking on their input (and you write tests to make sure that the bounds checking works.) You make sure that your code fails fast if it can't succeed in the expected way. It's all basic software-engineering stuff.

      Microsoft's real problem is almost certainly that they have too many people with commit access to their source tree; it's too easy for some fsckwit to check in a bad change and too easy to punt responsibility to someone else. Not that MS are alone in having this problem, but they do demonstrate it quite clearly.

      The problem for them is that the fix is to reduce the size of the development team, split up responsibility clearly, and force everyone to use clear APIs. This is a problem for MS because it has a serious side effect, in that it can slow down the rate at which new features get added (for example, it might involve only adding new features that are a good idea!!!) and this is at odds with their basic business model.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    25. Re:Not just C/C++ by Zorilla · · Score: 1

      It means that any security flaws are limited to the ones in the interpreter - which is probably a good thing since it's not developers creating new ones in the application itself.

      I imagine even Java isn't perfectly secure or stable. (I have seen software segfault it before)

      --

      It would be cool if it didn't suck.
    26. Re:Not just C/C++ by gbjbaanb · · Score: 1

      the problem isn't going away

      actually, that problem (of buffer overflows) *is* going away, slowly but surely. Every security problem that is fixed is another one gone.
      Eventually, we'll have replaced all the legacy code that uses fixed-size buffers. (I'd hope that new code uses string classes instead.. surely newbie programmers will use them instead of that complicated pointer arithmetic-style string buffers. surely)

      However, all the other types of security issues will still be present in all the new code we have to replace the old. Sometimes I think the old C/C++ code we have is more secure than new languages, as all the code has been checked, and fixed, whereas if you think 'well rewrite it' the new version will have all kinds of other bugs in it.

      As for tools, I wholeheartedly agree - and you should check out Microsoft's FXCop and Prefast. I think they're out soon, and hopefully will be free downloads.

    27. Re:Not just C/C++ by Anonymous Coward · · Score: 0

      I have to say that being a developer on a project with 100 developers and over a million lines of code writen over 9 years while all the while being the target of malicious attempts, you are only part right.

      These coding practices became good over time. When these programs were first being written, good practice meant that you should cut a few corners in order to make the user experience snappier.

      We have been going back and progressively fixing these issue, but for example in our software, the ecmascript engine, HTML, CSS, XML, and other parsers, JPEG, GIF, PNG image decoders, plugin library handlers, memory managers, graphics portability libraries, portable message event handling systems, and all the rest of the complex technology involved, it is easy to make a mistake or two along the way.

      If you want to prove me wrong, I dare you to try and write an XML parser which uses as little memory as possible. Doesn't leak, doesn't crash, has no buffer underruns, handles all international texts, has a small footprint, handles XSLT, parses only what it is fed and retains none of the original text data between blocks. Make it also so that it can handle Internet Explorer violations to the XML spec, also so it handles Mozilla and Opera interpretations of the standard.

      If you can even imagine doing that in under 6 months and doing it without bugs or buffer issues, I would congradulate you for having dillusions.

      BTW... performance REALLY REALLY REALLY counts. So make sure that you use length encoded strings. Also keep in mind that copying strings is too slow, so you'll have to use start and end pointers into the source buffer.

      It's easily understandable that Microsoft has bugs. There's no way to avoid it. It would however be nicer if they put each product up for closer scrutiny on a project by project basis

    28. Re:Not just C/C++ by keramida · · Score: 1
      That's why some people consider -Wall insufficient and compile their programs with more strict warnings enabled:

      orion:/tmp/slashdot$ make
      Warning: Object directory not changed from original /tmp/slashdot
      cc -O2 -pipe -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wformat=2 -Wno-format-extra-args -Werror -c slashdot.c
      slashdot.c:6: warning: function declaration isn't a prototype
      slashdot.c: In function `main':
      slashdot.c:7: warning: initialization discards qualifiers from pointer target type
      *** Error code 1

      Stop in /tmp/slashdot.
      orion:/tmp/slashdot$

      The 'initialization' discards qualifiers warning is because "abcdefg" is a (const char *) and not a (char *). Changing the declaration of 'a' to (const char *) then triggers another warning:

      orion:/tmp/slashdot$ make
      Warning: Object directory not changed from original /tmp/slashdot
      cc -O2 -pipe -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wformat=2 -Wno-format-extra-args -Werror -c slashdot.c
      slashdot.c:6: warning: function declaration isn't a prototype
      slashdot.c: In function `main':
      slashdot.c:9: error: assignment of read-only location
      *** Error code 1

      Stop in /tmp/slashdot.
      orion:/tmp/slashdot$

      The 'assignment of read-only location' warning provides a hint of *one* of the problems with this program.

      You do have a valid point about the lack of bound checking support in the language itself though.

      --

      --
      My other computer runs FreeBSD too.
    29. Re:Not just C/C++ by Decaff · · Score: 1

      Any self-respecting language will produce a binary that does what the source code says it should do, in exact detail.

      A great comment, but I have to disagree with this bit. With multi-threaded code running on pipelined, multi-core processors I would argue that its very hard to say in exact detail what the source code does, and the resulting binary could be very hard to understand.

    30. Re:Not just C/C++ by Anonymous Coward · · Score: 0

      Unfortunately your beginner programmer looks up the C library or his favorite book, and starts using strcat(), strcpy() and other "recommended" functions happily ignorant of the security holes.

      I think the libraries are in great need of an update. C ENCOURAGES security holes. That's the difference.

    31. Re:Not just C/C++ by Anonymous Coward · · Score: 0

      Var snäll och lär dig engelska innan du postar på Slashdot. Du skämmer ut oss andra svenskar...

    32. Re:Not just C/C++ by clone22 · · Score: 1

      Are there not code analyzers to warn of possible buffer overflow opportunities?

      --
      Ask me about my vow of silence!
    33. Re:Not just C/C++ by fishbot · · Score: 3, Insightful

      I am sure that Microsoft, Linux, Apache and whatnot other programmers know the theory too. Too bad that buffer overflows still happen.


      Unfortunately, old code seems to live the longest. I know, that sounds daft, but think about it; which is easier to rip out and replace: the nice new code that you understand, or the evil, nasty, hacky arcane nonsense that was there before you even knew what 'compile' meant?

      The GDI+ problem mentioned in other replies just points to the fact that, no matter how spiffy your new code is, if you rely on old nasty code in the background you're in for a world of pain. Unfortunately, as found in most businesses, a ground up rewrite is just not economically viable.
    34. Re:Not just C/C++ by Anonymous Coward · · Score: 0

      ...or spell properly?

    35. Re:Not just C/C++ by Anonymous Coward · · Score: 0

      "The problem with compiled languages like C(++) are that you DO have to deal with memory management directly"

      It has nothing whatsoever to do with whether the language is compiled or interpreted, but rather the way it is designed. Walter Bright's D for example is a fully compiled C-like OO language that overcomes many of C++' pitfalls - Eiffel, Ada, and Oberon are other examples of "safer" compiled languages. By contrast, BCPL was an interpreted language that was actually rather lower-level than C.

    36. Re:Not just C/C++ by f()rK()_Bomb · · Score: 1

      eh, dude i think that was his point, as in they cant spell let alone program.

      --
      "The space elevator will be built about 50 years after everyone stops laughing." - Arthur C. Clarke ~1980
    37. Re:Not just C/C++ by Anonymous Coward · · Score: 0

      I'd hope that new code uses string classes instead... surely newbie programmers will use them instead of that complicated pointer arithmetic-style string buffers.

      There are some areas where fixed-sized buffers make sense. If you don't have the capacity to keep track of them and check sizes where you use them (or better yet, write a class that does it for you), then you probably shouldn't be programming for those situations anyway. But don't write off all uses of fixed-size buffers as outdated, bugridden cruft.

      The real problem is poor programmers. Yeah, tools that let you shoot your foot don't help (and stuff like the standard C string functions that encourage you to...), but if your programmers are competent it doesn't matter. Ask anyone who's been hiring programmers lately, the market is flooded with crap. And open source, while it won't attract many of those, won't filter out many of them either.

    38. Re:Not just C/C++ by 16K+Ram+Pack · · Score: 1
      It also seems to be something that is quite often done on open source projects - people will just rewrite how something works because they've got a "better" way of approaching it and the code is maybe just annoying them. That's one of the beauties of OSS - the consumer is often the creator.

      Try convincing a manager with a budget that they should rewrite something to no significant pay rise benefit.

    39. Re:Not just C/C++ by Anonymous Coward · · Score: 0

      Well, if you have to ask, they obviously aren't widespread.

    40. Re:Not just C/C++ by geg81 · · Score: 1

      As for tools, I wholeheartedly agree - and you should check out Microsoft's FXCop and Prefast.

      We are discussing the shortcomings of C/C++, not .NET. FXCop may still be necessary for .NET applications, but not for the shortcomings we are discussing. With .NET, Microsoft has essentially admitted themselves that C/C++ are a dead end.

      As for the "you should check out", you should get out a bit more if you think that there is anything novel about FXCop or Prefast; those kinds of tools have been around for ages.

      Eventually, we'll have replaced all the legacy code that uses fixed-size buffers. (I'd hope that new code uses string classes instead.. surely newbie programmers will use them instead of that complicated pointer arithmetic-style string buffers. surely)

      Trouble is: even the C++ standard library isn't anywhere near safe, and people are still generating buggy and unsafe code in C++ code; even textbooks encourage them to.

    41. Re:Not just C/C++ by AnotherBlackHat · · Score: 1

      Any compiled language ... Unlike interpreted languages ...


      No.

      There is no fundamental difference between compiled and interpreted code.
      Compiled languages will frequently let you do what you want (good or bad) whereas many interpreted languages will not (good or bad).
      But it's not compiling that makes the languages different, it's the language design.
      You could write a C interpreter and it would be just as insecure as compiled C.

      -- should you believe authority without question?
    42. Re:Not just C/C++ by Anonymous Coward · · Score: 0

      IA32 has a Code/Data segment flag. So that code cant be run in data segments. Also the same is with stack segments.

      But, isnt the problem (in this case) that stack overflows allow you to genrate return address to code anywhere on the system. Using the segmentation features (I know completely evil) can stop (I mean reduce) these problem.

      But, Is it not just down to writting better code. If you remove buffer overflows, other security holds will show up. Its all down to better code.

      Also, (getting on hobby horse) pre-available librarys always have hidden bugs. Trying to get these bugs fixes (esp. from larger supplies, esp. when you are a small software house). Is a real trial. They just dont get fixed. Safer to have someone who knows what they are doing write safe code inhouse -- In any language.

    43. Re:Not just C/C++ by gbjbaanb · · Score: 1

      Actually, I was discussing C++, which is a very valid MS language still - even if they plug C# for everything, most of microsoft's code is written in C++.

      The references to the MS tools (yes, I know there are tools out there, but who really uses them?) were more about the 'marketing' of them as tools that people will use because they're fully integrated and easy to set going - 2 clicks and it tells you what you've done wrong :)

      As for the security flaws in the STL (I meant that, not the C standard library, sorry if that was confusing), I don't think that's going to be less secure than the same thing effectively implemented in other languages.

    44. Re:Not just C/C++ by Anonymous Coward · · Score: 0

      good, fast, cheap.. pick 2

    45. Re:Not just C/C++ by Brandybuck · · Score: 1

      Too bad that buffer overflows still happen.

      Too bad bugs happen in Java, C#, Python, Ruby and Lisp as well. Really they do!

      --
      Don't blame me, I didn't vote for either of them!
    46. Re:Not just C/C++ by Anonymous Coward · · Score: 0

      we can help sloppy programmers avoid problems with buffer overflows and memory allocation by automating it.
      Which is a worthless half-assed pseudo-solution because it fails to address the real problem. Sloppy programmers don't have problems with buffer overflows, they have problems with being sloppy programmers. The problem isn't that the language allows a sloppy programmer to do bad things, it's that sloppy programmers are writing software.

    47. Re:Not just C/C++ by epine · · Score: 1

      If there were programming languages which did not permit programmers to write constructs leading to buffer overflows, this debate would be long over. What these languages do is prevent certain consequences of incorrectly written programs. The fact that every car now comes with airbags and seatbelts does not eliminate the debate about whether driving skills should have been better in the first place.

      The problems posed by C are not unique to programming languages. In mathematics, if you multiply both sides of an inequality by a non-positive number, or you divice both sides of an equality by zero, or you sum a divergent series to a fixed value, you have effectively "bombed out" your entire construct, and anything at all can thence be proven.

      In a mathematical proof, every logical step must be properly guarded within its bounds of validity. This is no different that the discipline required to write correct programs in C. The validity conditions for a buffer manipulation in C are really quite simple. As a point of comparison, the validity conditions for escaping regular expressions or SQL statements or safe shell commands in PHP are much less straightforward. Where is the programming language that prevents those mistakes?

      My position is that if a programmer can't manage to correctly handle the rather trivial validity conditions on buffer manipulation in C, the programmer will have difficulty in correctly handling the validity conditions on any other program construct. My position is that every statement written in a program needs to be written with consideration for its bounds of validity. I don't believe there are any magic languages out there that will save us from having to think so hard, certainly not if correctness is our ultimate goal.

    48. Re:Not just C/C++ by epine · · Score: 1

      We fix things one problem at a time. We can't do anything about general input verification, but we can help sloppy programmers avoid problems with buffer overflows and memory allocation by automating it.

      This is good. Once the sloppy programmer is freed of the burden of buffer allocation, they have more time to be sloppy about everything else. That can't possibly lead to more problems.

    49. Re:Not just C/C++ by anomalous+cohort · · Score: 1

      Blaming C or C++ is just marketspeak that attempts to get its potential customers to believe that the latest cool tool will solve all of their problems. If you will no longer believe that Visual Studio/JBuilder will solve all of your develops, then maybe you'll believe that .Net/Java will. Caveat Emptor, as they say, also you make the very good point...

      I am sure we all know the theory, but to me it's like saying "you avoid bugs by following good coding practices".

      I forget who originally said this but the difference between theory and practice is that in theory, there is no difference whereas in practice, there is.

      Maybe the answer to building more secure and less buggy apps is to use smarter, more disciplined app developers. A hard answer to hear as it takes a lot more to attract and keep good developers than it does mediocre ones.

      Not that the tool/platform doesn't matter at all. Of course it matters. It's very important. There is no "silver bullet" one size fits all solution to every problem. That's why you need an architect.

    50. Re:Not just C/C++ by geg81 · · Score: 1

      even if they plug C# for everything, most of microsoft's code is written in C++

      Yes, but Microsoft has seen the error of their ways.

      As for the security flaws in the STL

      STL doesn't have security flaws, it lacks safety (lack of safety often leads to lack of security, but it has other bad consequences as well).

      I don't think that's going to be less secure than the same thing effectively implemented in other languages.

      No, STL is uniquely bad; it is simultaneously unnecessarily general and lacks crucial error checking. I can't think of any other major language that has such a poorly designed set of collection classes as part of its standard library.

    51. Re:Not just C/C++ by Anonymous Coward · · Score: 0

      The problem isn't that the language allows a sloppy programmer to do bad things, it's that sloppy programmers are writing software.

      So, you seriously think it's easier to fix a million programmers than a programming language? Good luck.

    52. Re:Not just C/C++ by archeopterix · · Score: 1
      Too bad bugs happen in Java, C#, Python, Ruby and Lisp as well. Really they do!
      I wasn't arguing "C/C++ vs all of the world" or even "C/C++ vs languages with built-in safe pointers". I was just saying that following good practices won't get you rid of buffer overruns.

      Why? Because there is just too much code around. Even if avoiding buffer overruns was as simple as not using variable names starting with "b", there would still be programmers forgetting this rule (lack of morning coffee, typos+bad eyesight) unless of course compiler writers enforced it, just like lisp/python/ruby run-time isolates you from raw pointers.

      As to Java, C#, Python, Ruby and Lisp - of course bugs happen in these languages too (that was my point, sort of). Even buffer overflows happen in these languages (statistically, there _must_ be a buffer overflow in one of the lisp interpreters out there). But at least the "unchecked pointer" class of bugs in these languages is limited to bugs in the interpreter and/or linked external code - an order of magnitude less of code potentially introducing this particular kind of bug.

      Really, it's all about tradeoffs. C/C++ makes you care about buffer overflows (and their ilk) yourself, which you might find insignificant and the pointer-safe languages use some CPU cycles on pointer-checking, which (surprise!) you might find insignificant. Ah, and you can write bugs in them too, thanks a bunch for reminding me of this fact!

    53. Re:Not just C/C++ by jgrahn · · Score: 2, Insightful
      Using container libraries costs extra time and effort

      WTF??! Using C strings and arrays, plain pointers to things, homegrown linked lists, etc is what costs extra time and effort in C++. And that's also what causes memory leaks, buffer overflows, exception unsafety and all kinds of nastiness.

      We need better tools to help people avoid it, and plain C/C++ apparently isn't enough for real-world programmers not to make these mistakes.

      Please don't confuse C with C++. I don't think we have seen enough real C++ in security-critical use to say for sure how sensitive it is.

    54. Re:Not just C/C++ by TheLink · · Score: 1

      C is an unsafe design. To use your car analogy, the widespread use of C is the widespread use of cars without any protection at all - no frame around the driver, no airbags, no seat belts. Just engine, drive-train and tyres. Bare-metal...

      Each driver has to build their own protection. If they get practically anything wrong, they're screwed if anything happens. By the time the drivers have added their own custom/3rd party protection most have probably lost any significant performance benefits of having the "raw" car. Or the protection is ineffective - after all most drivers aren't experts in safety - they just want to get from point A to point B.

      Sure a few programmers CAN program in C. But most of them obviously can't - what are the odds of them getting EVERY statement right? The typical slashdotter here talking about programming can barely spell right or get his/her grammar correct.

      You say: "My position is that _every_ statement written in a program needs to be written with consideration for its bounds of validity. I don't believe there are any magic languages out there that will save us from having to think so hard, certainly not if correctness is our ultimate goal.
      "

      That's actually a sign of bad design to me, if you have to think so hard for each line. Either the program is badly designed, or the language is.

      If you "firewall/partition off" sections of code, you can write lots of code without thinking hard and it still won't cause you grief much less "make it possible to execute arbitrary code of the attacker's choice". After all I don't secure every single valuable item in my house. I just stick to securing the entry points, a few rooms and the safe.

      It seems that C makes it hard for programmers to program securely - many still screw up at the "doors and windows" of their code even though they are supposedly concentrating hard on getting those right!

      Don't get me wrong - I work as an IT Security consultant, so if you programmers keep insisting on using unsafe languages and saying the problem is because programmers aren't getting "every statement" right, hey go right on ahead...

      It's just kinda boring to see the same _stupid_ bugs year after year (decade after decade?), when you KNOW there are alternatives.

      --
    55. Re:Not just C/C++ by TheLink · · Score: 1

      Who's trolling here?

      I'd stop beating the dead horse if it's dead. But it's obviously far from dead. In fact it's giving the IT Security industry a pretty good and profitable ride.

      "You avoid buffer overflows in C by checking the lengths of your buffers. You stop using C strings. You use container libraries. As for C++, you avoid them by using the included string and container classes."

      You avoid mistakes by getting things right. LOL.

      How about stop using C and C++? True it's hard. It's harder to switch than to continue using C or C++.

      But which is harder - switching to some other language or using C or C++ CORRECTLY? Using C or C++ _correctly_ appears to be beyond the competence of most programmers.

      --
  6. Tool by radaway · · Score: 3, Insightful

    This is idiotic... The language is simply a tool. If you dont know how to use a hammer without crushing your finger,use screws, or dont and stop blaming the hammer for losing your pinky.

    1. Re:Tool by Concerned+Onlooker · · Score: 5, Funny
      and stop blaming the hammer for losing your pinky.

      That's kind of like ending up with a "null pointer" eh?

      --
      http://www.rootstrikers.org/
    2. Re:Tool by mjfgates · · Score: 0, Flamebait

      Y'know, a hammer with a warped handle *will* bite your thumb every damn' time. Likewise a screwdriver with a trashed head will slip, chew up the screws, etc.

      C++ tries, really tries hard, to cause buffer overflows.

    3. Re:Tool by Anonymous Coward · · Score: 0
      This is a message from your friendly-neighbourhood Big Bro^H^H^H^H^H^HDept. of Homeland of Security office. You have engaged in the un-American terrorist activity of producing bad puns.

      Slashdot User 473481 added to no-fly list
      Slashdot User 473481 added to tapped-land-line list
      Slashdot User 473481 added to tapped-cellphone list
      Slashdot User 473481 added to gps-tracking-chip-in-rectum list

      These additions are required to protect and preserve the integrity of the United States of America, and for the safety of all upstanding citizens. Hail Emperor Bush, leader of the Free World, King of the Castle, Destroyer of Iraq. All Hail the Emperor.
    4. Re:Tool by vrai · · Score: 0
      C++ tries, really tries hard, to cause buffer overflows.

      No it doesn't. You have to be near brain dead to write buffer-overflow susceptible code in modern C++. All that's required to write safe code is to have a decent knowledge of what the statements you're writing actually do, and to think about what you're doing.

      People who can't see that copying input of an arbitrary length in to a fixed size buffer is bad should stick to VB.NET and leave the complicated stuff to the experts.

  7. Re:Popularity not the problem. by Anonymous Coward · · Score: 0

    How do you know he's not just making a joke? How do I know you're not ust making a joke? What's the point of these discussions?

  8. Sometimes you gotta take a look around. by Sheetrock · · Score: 4, Insightful
    This brings up a complaint I've got with the way the industry works nowadays, monoculture being something many large companies seem to share.

    As a programmer, I feel the continual march of progress in computing has been hampered as of late because of a major misconception in some segments of the software industry. Some would argue that the process of refinement by iterative design, which is the subject of many texts in the field -- extreme programming being the most recent -- demonstrates that applying the theory of evolution to coding is the most effective model of program 'design'.

    But this is erroneous. The problem is that while extremely negative traits are usually stripped away in this model, negative traits that do not (metaphorically) explicitly interfere with life up until reproduction often remain. Additionally, traits that would be extremely beneficial that are not explicitly necessary for survival fail to come to light. Our ability to think and reason was not the product of evolution, but was deliberately chosen for us. Perhaps this is a thought that should again be applied to the creation of software.

    It makes no sense to choose the option of continually hacking at a program until it works as opposed to properly designing it from the start. One only has to compare the security woes of Microsoft or Linux with the rock-solid experience of OpenBSD for an example. It makes little sense from a business perspective as well; it costs up to ten times as much to fix an error by the time it hits the market as it would to catch it during the design. Unfortunately, as much of this cost is borne by consumers and not the companies designing buggy products, it's harder to make the case for proper software engineering -- especially in an environment like Microsoft where one hand may not often be aware of what the other is doing.

    Don't be fooled into thinking open source is free of the 'monoculture' mindset, either. While it is perhaps in a better position to take advantage of vibrant and daring new concepts because of the lack of need to meet a marketing deadline or profitability requirement the types of holy wars one might have noticed between KDE/GNOME or Free Software/Open Source demonstrate that there are at least some within every community that feel they hold the monopoly on wisdom.

    --

    Try not. Do or do not, there is no try.
    -- Dr. Spock, stardate 2822-3.




    1. Re:Sometimes you gotta take a look around. by Anonymous Coward · · Score: 0
      the rock-solid experience of OpenBSD for an example

      Seems like there are a lot of bug reports in OpenBSD too. Clean up your own household before crapping too much in others'.

    2. Re:Sometimes you gotta take a look around. by Anonymous Coward · · Score: 0

      "Our ability to think and reason was not the product of evolution, but was deliberately chosen for us."

      FYI: Don't appeal to religion if you want anybody to listen to you. You just destroyed your legitimacy by special pleading.

    3. Re:Sometimes you gotta take a look around. by Baki · · Score: 2, Interesting

      You shall always have evolution on a certain scale. Maybe you may "revolutionize" a single program but you cannot rewrite an operating system from scratch (meaning not even borrowing existing code and libraries as OpenBSD did heavily, such as many libraries, gcc, binutils etc). If you do, it will take years to "mature" which is also a kind of evolution.

      On a somewhat larger scale, within companies you may replace one box with another (running another OS), but you cannot change your complete infrastructure overnight, i.e. replace all network protocols at once. Such changes take years and are a slow and evolutionary process.

      Sometimes you have to take a step back and throw away some old cruft and make it fresh and new. However a certain degree of both evolution and also monoculture is unavoidable. If you have a 10000 employee company throwing in new technologies all the time, allowing for too much heterogenity, you shall have a maintenance and system-management nightmare very soon, leading to collapse of your IT infrastructure.

    4. Re:Sometimes you gotta take a look around. by The+Musician · · Score: 3, Insightful

      1) Extreme programming doesn't mean skipping design, it means building only what you need. You're still building that little bit with the same attention to all facets of software engineering.

      The point being that when you don't know what you'll eventually have to build, no amount of intelligence, forethought, or design will solve that problem. You build what you know you need, and flow along with changing requirements.

      2) Who's to say that the better overall choice is to correct the so-called "negative traits". There is some cost associated with doing so. If they are important enough, they will get fixed. Maybe (as is often the case) getting something that mostly works makes the users happier than something "properly design[ed] from the start" yet six months later.

      (Not to say that design slows down a project; attention to design should and will speed up work. But too much Capital-D Design up front -- before the questions are really explored, and before you have a working version to pound on and gain understanding from -- will end up a losing proposition in the end.)

      The blessing and curse of software development is that everything you are doing is necessarily new in some way. If someone has done it before, why would you be writing it again? That combined with the push to solve the difficult problems in software rather than hardware (because software is *easy* to change!?) means each project is an exploration.

      And to the extent that the exploration is into more and more unknown territory, you need the steps of iterative and "agile" processes to get yourself a good feedback loop into your problem domain.

      Otherwise you end up over time and over budget (if it even works at all), because you had a great design for the wrong problem.

    5. Re:Sometimes you gotta take a look around. by Skapare · · Score: 1

      This brings up a complaint I've got with your signature:

      Try not. Do or do not, there is no try.
      -- Dr. Spock, stardate 2822.3.

      Dr. Spock was a baby doctor. Mr. Spock was a character in the Startrek series and movies. But Yoda spoke those words in "Star Wars: The Empire Strikes Back".

      Maybe if you applied the principles of properly designing it from the start, instead of choosing the option of continually hacking at your signature, it wouldn't be so buggy by the time it hits Slashdot. Or I guess one hand wasn't aware of what the other hand was doing.

      --
      now we need to go OSS in diesel cars
    6. Re:Sometimes you gotta take a look around. by steveha · · Score: 5, Insightful

      It makes no sense to choose the option of continually hacking at a program until it works as opposed to properly designing it from the start.

      There is something to this, I guess. But that's the real trick, isn't it? The problem is that real life isn't like programming class in college.

      In class you get an assignment like "write a program that sorts text lines using the quicksort algorithm." This simple statment is a pretty solid specification; it tells you everything you need to know about how to solve the problem. How many features does this project have? As described, exactly one. You might get fancy and add a case-insensitive flag; that's another feature.

      In real life, you get a general description of a project, but the project implies dozens to hundreds of features. Your users may not even know exactly what they want. "Make something like the old system, but easier to use." You might spend a great deal of time designing some elaborate system, and then when the users actually see it they might send you back to the drawing board.

      So the best approach is generally to try stuff. You might make a demo system that shows how your design will work, and try that out without writing any code. But you might also code up a minimal system that solves some useful subset of the problem, and test that on the users.

      Another shining feature of the "useful subset" approach to a project is that if something suddenly changes, and instead of having another month on the project you suddenly have two days, you can ship what you have and it's better than nothing. As I read in an old programming textbook, 80% of the problem solved now is better than 100% of the problem solved six months from now.

      Note that even if you are starting with a subset and evolving it towards a finished version, you still need to pay attention to the design of your program. For example, if you can design a clean interface between a "front end" (user interface) and a "back end" (the engine that does the work), then if the users demand a complete overhaul of the UI, it won't take nearly as long as if you had coded up a tangled mess.

      One only has to compare the security woes of Microsoft or Linux with the rock-solid experience of OpenBSD for an example.

      I'm not sure this is the best example you could have chosen. Linux and *BSD build on the UNIX tradition, and UNIX has had decades of incremental improvements. Some bored students in a computer lab figure out a way to crash the system; oops, fix that. After a few years of that, you hammer out the worst bugs.

      But UNIX did start with a decent design, much more secure than the Windows design. Windows was designed for single users who always have admin privileges over the entire computer; it has proven to be impossible to retrofit Windows to make it as secure as it should have been all along. The Microsoft guys would have done well to have studied UNIX a bit more, and implemented some of the security features (even if the initial implementation were little more than a stub). As Henry Spencer said, "Those who do not understand UNIX are compelled to reinvent it. Poorly."

      steveha

      --
      lf(1): it's like ls(1) but sorts filenames by extension, tersely
    7. Re:Sometimes you gotta take a look around. by Anonymous Coward · · Score: 0

      Is your sig some kind of flame there, buddy? Dr. Spock? is there link that proves that somewhere?

    8. Re:Sometimes you gotta take a look around. by shirai · · Score: 1

      costs up to ten times as much to fix an error by the time it hits the market as it would to catch it during the design.


      I call bullshit.

      Getting software programs to run error free from the start is extremely expensive. Just ask the guys who send things into space. Their development costs are several orders of magnitude higher because the cost of a bug is the loss of a very expensive piece of equipment. And sometimes they still have bugs.

      I don't disagree that it *would be nice* to catch all the bugs before launch but saying that it is cheaper is a false start. Delaying time to market is also extremely expensive in the face of competitors.

      Note: I'm not saying let's do away with making sure software works. I'm just saying this particular statement is a red herring.
      --
      Sunny

      Be my Friend

    9. Re:Sometimes you gotta take a look around. by foobsr · · Score: 2, Insightful

      Some would argue that the process of refinement by iterative design, which is the subject of many texts in the field ...

      Program Development by Stepwise Refinement
      Niklaus Wirth
      Communications of the ACM
      Vol. 14, No. 4, April 1971, pp. 221-227.

      What is the year now, please ?

      CC.

      --
      TaijiQuan (Huang, 5 loosenings)
    10. Re:Sometimes you gotta take a look around. by xoboots · · Score: 1
      The problem is that while extremely negative traits are usually stripped away in this model, negative traits that do not (metaphorically) explicitly interfere with life up until reproduction often remain. Additionally, traits that would be extremely beneficial that are not explicitly necessary for survival fail to come to light. Our ability to think and reason was not the product of evolution, but was deliberately chosen for us. Perhaps this is a thought that should again be applied to the creation of software.

      Don't forget that the model of evolution includes the environment--the model is the survival of the fittest and survival means outperforming in the tasks required for survival in the environment you exist. That means that "negative traits that do not...explicitly interfere with life" are not negative traits--they are neutral traits and thus inconsequential. The same applies to the other premise: "traits that would be extremely beneficial that are not explicitly necessary for survival fail to come to light"; here you are mislabeling another neutral (no effect) characteristic as one that actually has value. Evolution with competitive natural selection wins just because it optimizes for the proper balance of characteristics that exhibit best-fit properties for the environment. And when it comes to the completely unrelated matter of pre-ordained "creationism", the only question left open for it is the big bang itself and even that one may prove tractable in time.

      On to software: asides from the advantadges of iterative development as mentioned by other posters, the fact is that most software projects are simply too complicated to design full out up-front and many large-scaled designs built on such ideas are breading grounds for non-competive over-engineering and mismatches between technical desires and actual needs. Now as long as we are realistic and assume that our software must compete with other similar software and teams (which is always the case, even for custom contracts) then survival of the fittest ensures that code techniques will also advance as required. When you are competing for money (or usage) your fitness level is a relative measure so just delivering on all of the targets isn't good enough. You have to do it for less money than your competition, you have to do it with less resources, you have to be faster, you have to be easier and the list goes on.

      I think the problem is that we software people too often think we are scientists looking for the grand scheme. Leonardo said of his statues that they existed already under the stones and he merely chipped away the extra bits. He didn't say he had a great plan and executed on it; he may have had an idea in mind but if you ever tried sculpting you will know that sometimes you have to go with what the materials give you and you must work your design to what actually happens. It could be that the results surprised him as much as anyone.

      To sum up: we are here as thinking beings as a direct result of evolution; "designing software properly from the start" depends entirely on the meaning of "properly" and "properly" is never known at the start (and even if it was, we probably are incapable of conceiving an entire soltution all in one go for any large project anyhow); people will be people, no matter how they are categorized.

    11. Re:Sometimes you gotta take a look around. by ignorant_newbie · · Score: 1

      >Try not. Do or do not, there is no try.
      > -- Dr. Spock, stardate 2822.3.

      it's no fun if you give away the fact that you're trolling like this. Everybody knows that Dr. Spock only appeared in the Star Wars Trailer, and that this line was actually said by Dominar Rygel 16 in those PeaceKeeper Wars shorts on the Cartoon Network last year.

    12. Re:Sometimes you gotta take a look around. by LordK2002 · · Score: 1
      Our ability to think and reason was not the product of evolution, but was deliberately chosen for us. Perhaps this is a thought that should again be applied to the creation of software.
      Congratulations on successfully injecting unscientific religious dogma into an otherwise intelligent discourse on a scientific topic.
    13. Re:Sometimes you gotta take a look around. by Anonymous Coward · · Score: 0

      Gee, you don't think he might be a troll do you?

      Logic? On Slashdot? That's just crazy talk.

    14. Re:Sometimes you gotta take a look around. by Anonymous Coward · · Score: 0

      Bravo, sirrah. Seldom have I seen a troll this well written. And modded to +5, as well.

      Again, kudos to you.

    15. Re:Sometimes you gotta take a look around. by TheRaven64 · · Score: 1, Insightful
      But UNIX did start with a decent design, much more secure than the Windows design. Windows was designed for single users who always have admin privileges over the entire computer; it has proven to be impossible to retrofit Windows to make it as secure as it should have been all along.

      Rubbish. The Windows (NT - since that's the heritage of all modern Windows versions, and which inherits ideas from VMS) has supported access control lists from the start. It has also supported a sane method of privilege control - an Administrator user could not access system processes, for example. Access to system objects is fine-grained, and can be selectively granted to users or groups. Contrast this with UNIX where users are either mortals (access to no system objects, or course-grained access via groups) or root (access to all system objects). The problems with Windows NT started when performance became more of a priority than security, and when people started running as Administrator all of the time - not part of the original design which incorporated clear privilege separation - NT was designed for corporate environments where only the IT department would have Administrator access. You can't blame Windows security for people running as Administrator any more than you could blame UNIX security for people running as root all of the time - and the situation would be worse in the UNIX world since root has far more power than an Administrator on an NT system. Oh, and NT was never a single-user operating system, it just ran a single-user GUI. Other users could still have running processes right from the start.

      Those who do not understand VMS are condemned to reinvent it. Poorly.

      --
      I am TheRaven on Soylent News
    16. Re:Sometimes you gotta take a look around. by Deorus · · Score: 1

      Man you really sound like the inexperienced, naive, and "know it all" fool who just finished the university. Get back to the real world and THINK for a change! How many people run Windows? How many people run and are involved with the Linux development? How many people run and are involved with the OpenBSD development? Yes, I am talking about numbers! Few people will bother targetting a system with such a marginal share as OpenBSD's, and even that hasn't stopped OpenBSD from having lots of known security holes in its rock-solid secure kernel!

      Design is all about theory, which is something that does not apply very well in the real world. If you do not yet know that, real world experience will make sure you learn it right. Besides of what you've been told in the university, design and theory are NOT everything.

      A simple and well thought design may address a lot of issues, but only those you were thinking about at the time. As soon as your system becomes more used and the world evolves, you will feel the need to add exceptions to your initial design, exceptions that will make it more and more complex over time and can potentially be used in unpredictable ways to break security. Of course you could chose to rewrite everything from the scratch each time your design was proven to be wrong just because it did not allow user X to perform Y, but that would be rather counter-productive. Either that or you could simply ignore user X, but that would not be a good choice if user X was your client.

      Since you mentioned OpenBSD, lets take it as an example: The secure memory management in OpenBSD on i386 (known as W^X) uses a code segment whose size is smaller than the overlapping data segment's. This means that memory maps allocated below a specific address are executable while maps allocated above that address are not. This allows the system to distinguish between executable and non-executable virtual memory areas with hardware support, and thus, is the perfect* solution to the lack of an executable privilege definition in the pagination system.

      * = There is at least one small (but if you keep reading you will notice that it's not as small as it seems) exception to this perfect solution: mprotect(). Since the execution privilege depends on the virtual memory address and mprotect() is only meant to change privileges, this perfect solution prevents mprotect() from functioning properly.

      When confronted with the evidence, Theo replied with a POSIX quote stating that mprotect() shall fail if the system does not support it. The problem is that usually it does not fail, and therefore software has been written with that non-standard assumption in mind, and that software will break with this implementation, but for Theo if the software does not run is because it relies on insecure implementations...

      One exemple of such an important piece of software that does not rely on insecure implementations and will probably break with W^X is GCC. Recent versions of GCC (since 3.3.0, I believe) now generate code that when assembled resultes in ELFs that change the executable permissions in the stack memory area, and this means writable and executable (W&X) stacks for everyone! To prevent from stack smashing exploits, StackGuard is now included in the mainstream versions of GCC. Why does it do so? Because GCC needs an executable and writable stack in which it can write its trampolines (I would go deeper and explain what trampolines are and how they work, but it's rather offtopic and my comment is already long enough).

      GCC assumes that the ability to modify VMA privileges is present, and therefore uses it to stop decent implementations of secure memory management from crashing programs with trampolines. By ignoring this non-standard functionality just because "in theory noone is going to use it", Theo has made his kernel incompatible with newer versions of GCC. Since OpenBSD users are so few in number, this is not a real issue, but it would be if it was Linux or Windows.

      The above is just a demonstration of how evolution and the real world can turn a supposedly perfect theory into something useless. Things evolve in unpredictable ways, and you are being presumptuous if you really think you can predict everything.

    17. Re:Sometimes you gotta take a look around. by Gadzinka · · Score: 1

      Leave religion out of this, this is stupidity.

      I mean, I live in the country with >90% monoreligious majority which has no problem with evolution as well as non-literal interpretation of Bible.

      Robert

      --
      Bastard Operator From 193.219.28.162
    18. Re:Sometimes you gotta take a look around. by dbIII · · Score: 2, Insightful
      Rubbish. The Windows (NT - since that's the heritage of all modern Windows versions, and which inherits ideas from VMS)
      If only that were true!
      Oh, and NT was never a single-user operating system
      Never ran anything older than NT4, did you?
      Those who do not understand VMS
      ... will confuse NT with it just because some of the same people worked on both. One of the best things about VMS is the documentation, vast amounts of it, so it is a trivial exercise to look it up and see that NT and VMS have very little in common.

      VMS was a mature operating system. NT is such a thing now, but it has taken a very long time, and it is very differetn to VMS.

    19. Re:Sometimes you gotta take a look around. by gbjbaanb · · Score: 1

      Just because it was written a few years back doesn't make it less useful. Some things are universally true, and actually made more valid by still being used after all this time. (eg. Linux/Unix. how old is that design?!)

      The attitude that says 'what 1971, how obsolete' is the reason we get so much cruft created by people who just think they can do better, for the sake of something 'new' and 'different'.

    20. Re:Sometimes you gotta take a look around. by Edie+O'Teditor · · Score: 1
      You just destroyed your legitimacy by special pleading.
      He didn't, however destroy his credibility like that.

      No, as far as slashdot is concerned he did that with his inability to distinguish a well-known childcare guru from a fictional, pointy-eared half-alien science officer.

      --
      If X is the new Y, and Y is "X is the new Y", solve for X.
    21. Re:Sometimes you gotta take a look around. by Anonymous Coward · · Score: 0

      Well Microsoft could have made life easier for non-admins. Windows needs an su command so that when you are trying to do something and cannot continue because you are not an admin, you should be able to type su and continue doing it, instead of having to log out!!

    22. Re:Sometimes you gotta take a look around. by Edie+O'Teditor · · Score: 1

      While your point is valid for application design (and for some applications especially business ones it is, sadly, the only way to do it) operating systems != applications. Or rather they shouldn't be.

      --
      If X is the new Y, and Y is "X is the new Y", solve for X.
    23. Re:Sometimes you gotta take a look around. by T-Ranger · · Score: 1

      That is more or less true. XP is descendent of NT, and NT has built in security.

      But XP uses 9x style user level stuff. The kernel might be the most secure thing in the world, but compromises have been made to graft on insecure high level stuff, screwing up the whole system. And yes, you can blame MS for the always-administrator problem... They have not provided - or at least, they have not advertised to coders - the equivalent of redhats console-helper or su. They have not provided a reverse compatible, but sandboxed environment for programs not specifically flagged as being XP ready (whatever that means). Code not such flagged should be quarantined and restricted by the OS. To the coder, that might only be a one line change, but make them go out of the way to have the OS not treat the program as suspect.

      Apple has gone through two major shifts, from 68k to PowerPC, and from legacy System to OS X. It has happened transparently to the users. Not exactly the same thing, but on the same order of difficulty

    24. Re:Sometimes you gotta take a look around. by BitwizeGHC · · Score: 1

      It is important to note that as soon as Dave Cutler and crew developed the NT kernel, Microsoft marketroids descended upon it like a swarm of locusts and started demanding that this and that feature be added -- till the design itself which was ostensibly very robust was compromised. The "video drivers in the kernel" thing is but one of many examples. And until recently, it seemed to get worse with every NT release: companies were reluctant to switch to NT4 because it had more issues as a server OS than NT 3.51.

      --
      N4st0r, trixx0r h0bb1tz0rz! Th3y st0l3 0ur pr3c10uzz!
    25. Re:Sometimes you gotta take a look around. by EddWo · · Score: 1

      they do, its called runas.
      >runas /user:administrator cmd

      --
      "Taligent is still pure vapor. Maybe they'll be the last who jumps up on Openstep... "
    26. Re:Sometimes you gotta take a look around. by The+Conductor · · Score: 1
      From what I remember of VMS, the big NT/VMS parallel is the concept of "here's a big honkin' API call that does everything," which contrasts with the Unixy apporach of "build it out of a gazillion little functional blocks."

      One typical use for VMS was for one-off in-house projects (like an inventory system or some such). The "rich" API's made development easier, but VMS got displaced by more-reliable unix in this area as Unix development tools got better.

      The other major use I saw was as a development platform for code that would later be migrated to an embedded system. The avionics for military jets were developed this way, for example. Again, the "rich" API sped things along.

      Note that both of those uses required good documentation. Hence, the Big Orange Wall: The better the documentation, the better VMS sold.

      The "rich" Windows API, however, serves an entirely different purpose. It is there to defeat reverse-engineering attempts and impede writing portable code. The worse the documentation is, the better Windows sells. So no big Orange Wall for NT, and you can't use NT like you could VMS, even if it is architecurally similar internally.

    27. Re:Sometimes you gotta take a look around. by Fulcrum+of+Evil · · Score: 1

      The blessing and curse of software development is that everything you are doing is necessarily new in some way.

      Then why are so many software projects rehashes of existing systems on new platforms? Sure, the combination is new, bbut none of the pieces are.

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
    28. Re:Sometimes you gotta take a look around. by Fulcrum+of+Evil · · Score: 1

      Rubbish. The Windows (NT - since that's the heritage of all modern Windows versions, and which inherits ideas from VMS) has supported access control lists from the start. It has also supported a sane method of privilege control - an Administrator user could not access system processes, for example. Access to system objects is fine-grained, and can be selectively granted to users or groups.

      Combine this with legacy code and an expectation that it will run, and everybody runs as admin so their apps will run. Users have access to most of the system by default (even as ordinary users). Sure, the idea is good, but we aren't there yet.

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
    29. Re:Sometimes you gotta take a look around. by Fulcrum+of+Evil · · Score: 2, Insightful

      The attitude that says 'what 1971, how obsolete' is the reason we get so much cruft created by people who just think they can do better, for the sake of something 'new' and 'different'.

      Miss the point much? It's 33 years old, and we aren't doing it yet?

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
    30. Re:Sometimes you gotta take a look around. by johne_ganz · · Score: 1
      It makes little sense from a business perspective as well; it costs up to ten times as much to fix an error by the time it hits the market as it would to catch it during the design.

      Wow. You're right. Bugs are expensive any way you measure them. Since you're the team lead and sr. programmer, I'd like you to stop putting bugs in our products code. And since you're going to be writing less code (total code = useful code + bugs), you should be able to get the product done much earlier. HR will be having a chat with you about your compensation, what with doing less work and all that extra expense you've been causing us all this time.

      Dumbass.

      Let me grab a chair while we wait for your next enlightenment. Next thing you know you'll move the release date up six weeks because that would give us six more weeks of profit.

      Some of the best advice I ever got was understand the difference between activity and acomplishment and avoid people who don't.

    31. Re:Sometimes you gotta take a look around. by sconeu · · Score: 1

      Runas is equivalent to su. You have to give out the admin password.

      But what about stuff that requires admin, but where you don't want to give out the admin password? What they need is the equivalent of Setuid.

      My kids machine is set up with XP. I have set them up as regular users, not admin (to reduce the spyware/worm issue).

      A lot of games rely on being admin (The Sims. Mavis Beacon Teaches Typing (!??!!!?!)).

      I don't want to give out the admin password. But for some stuff, it would be nice to setuid to admin, without having to do password check.

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    32. Re:Sometimes you gotta take a look around. by runderwo · · Score: 1
      I don't want to give out the admin password. But for some stuff, it would be nice to setuid to admin, without having to do password check.
      Try sudo, it's perfect for things like that.
    33. Re:Sometimes you gotta take a look around. by tepples · · Score: 1

      Try sudo, it's perfect for things like that.

      Neither Windows nor Win32 nor Win64 is listed. Or do you suggest purchasing FreeBSD-compatible alternatives to the Windows-compatible printer, scanner, video card, and other peripherals that sconeu owns?

    34. Re:Sometimes you gotta take a look around. by mpe · · Score: 1

      The Windows (NT - since that's the heritage of all modern Windows versions, and which inherits ideas from VMS) has supported access control lists from the start.

      The problem is with the mentality of Windows application writers. The ability to set a file "Read Only" has been around since DOS. Similarly RO media, such as CDROMs, have been around for a long time. Yet it is perfectly possible to find Windows applications which refuse to open Read Only data files. (In extreme cases there are applications which refuse to run without write access to the program directory itself.)

      Access to system objects is fine-grained, and can be selectively granted to users or groups.

      The problem with ACLs is that it is quite easy to end up with a set of highly complex access permissions.

      Contrast this with UNIX where users are either mortals (access to no system objects, or course-grained access via groups) or root (access to all system objects).

      VAX/VMS also supported an access control model similar to UNIX. As well as automatic file versioning, which AFAIK no version of NT supports.

      The problems with Windows NT started when performance became more of a priority than security, and when people started running as Administrator all of the time

      The reason for this is more likely to be able to get a "mission critical" application to run at all.

    35. Re:Sometimes you gotta take a look around. by mpe · · Score: 1

      Combine this with legacy code and an expectation that it will run, and everybody runs as admin so their apps will run.

      Not even legacy code. Some new software has exactly this problem. Ironically some old Windows software can be less trouble to get working with Windows XP compared with some new Windows software...

    36. Re:Sometimes you gotta take a look around. by firewrought · · Score: 1
      Compare the security woes of Microsoft or Linux with the rock-solid experience of OpenBSD

      This is a pretty bad example. OpenBSD's security does not stem from up-front design as it does from iterative refactoring. In addition to disabling most services by default, etc., their basic strategy has been to revisit/re-walk the code everytime they learned of a new type of problem (e.g., buffer overflow, etc.). A better example might be Linux vs. Hurd or Windows vs. Macintosh... in both of these cases, superior product design was undercut by a less perfect but nimbler competitor.

      Our ability to think and reason was not the product of evolution, but was deliberately chosen for us. Perhaps this is a thought that should again be applied to the creation of software.

      Our ability to think and reason is highly flawed. The whole point of iterative design is that you bring external validation into the development cycle as early as possible. If we had a divine ability to see the entire problem and solution up-front, then yes, up-front design would be most effective. If you're confident you can do the up-front design, by all means do it... software design is hard, and you need a cunning mix of strategies to do it successfully.

      --
      -1, Too Many Layers Of Abstraction
    37. Re:Sometimes you gotta take a look around. by Godeke · · Score: 1

      Ignoring the creationist throwaway comment, you have a point. However, the reason that iterative design has had a rise recently is the recognition that traditional design has failed to provide business value in many cases. I work in an iterative design methodology, but it is tempered with as much forward though as I can give a product. The realization that I think has to be made is that no person or team can forsee all requirements and therefor even the obstinately linear design will be iterative, and often the processes are not in place to handle the required iterations when the mindset is *to* linear.

      I have created many large systems for companies. I have also created many small systems. The reality on the ground is most large systems *grow* out of small systems. Yes, I try to think ahead and plan for growth, but you never know which systems *will* grow and which will be one off throwaways. Often the systems that business people are gunning for "big picture" implementations are the ones that get tossed the fastest. Meanwhile, some of the systems that would have seemed to be total tangents have grown into core systems.

      Business reality is composed of one core truth: change or die. Grand designs of linear nature are not good for handling that environment. Now there may be some areas where grand design is possible (I would think that more core science/math based software, or well understood problems like operating systems and programming languages would be good counter examples) but in the realm I work in, where managers change direction on a daily basis, integration requirements change weekly and customer directions change monthly, I would challenge any "grand design" to stand and deliver what iterative design can.

      --
      Sig under construction since 1998.
    38. Re:Sometimes you gotta take a look around. by foobsr · · Score: 1

      The attitude that says 'what 1971, how obsolete' is the reason we get so much cruft created by people who just think they can do better, for the sake of something 'new' and 'different'.

      Ooops, I was not clear enough. I am exactly of the opinion you state but had the impression that the parent was selling s. th. old for new. Obviously my mistake.

      CC.

      --
      TaijiQuan (Huang, 5 loosenings)
    39. Re:Sometimes you gotta take a look around. by steveha · · Score: 1

      A lot of games rely on being admin (The Sims. Mavis Beacon Teaches Typing (!??!!!?!)).

      This is part of what I was thinking when I said "it has proven to be impossible to retrofit Windows to make it as secure as it should have been all along."

      Because of the complete lack of security on early Windows versions, application writers developed some bad habits. I believe that the reason these games require admin access is simply that they insist on storing files in system directories; the game itself has no actual need for admin.

      Now Microsoft has to choose between fixing the security or having all the apps keep running. I'm sure they are trying to get applications rewritten so they can run as a normal user. I'll bet that Microsoft will require apps to run as a normal user before it will give a "Designed for Longhorn" seal of approval.

      steveha

      --
      lf(1): it's like ls(1) but sorts filenames by extension, tersely
    40. Re:Sometimes you gotta take a look around. by HiThere · · Score: 1

      No, but any OS much beyond DOS is too complicated to design in one step.

      When you are dealing with complexity, first simplify. Get a simple part working, and expand from there. If you try to swallow the whole project at once, the explosion of interacting bugs will kill all development. But small pieces can be developed. Standard reciepies can be combined into a larger one. (And then the combination needs to be debugged.)

      You CAN'T do a large project all in one step. It won't work. But you can run through a massive budget trying.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    41. Re:Sometimes you gotta take a look around. by Anonymous Coward · · Score: 0

      And his inability to distinguish a fictional, pointy-eared half-alien science officer from a fictional, pointy-eared green alien muppet Jedi Master.

    42. Re:Sometimes you gotta take a look around. by EddWo · · Score: 1

      Well they are working on a compromise for Longhorn, Filesystem and Registry redirection. The app running under a limited user account will try to write to HKLM or System files and the operation will appear to succeed, except the api call will be redirected to the limited users profile instead. So the app goes on running but the system is protected.

      More details here Security in Longhorn: Focus on Least Privilege

      Apps must be already be able to be run under a limited user account to even get a Designed for Windows XP, somehow there don't seem to be that many programs that work all that well so far.

      --
      "Taligent is still pure vapor. Maybe they'll be the last who jumps up on Openstep... "
    43. Re:Sometimes you gotta take a look around. by runderwo · · Score: 1

      Sorry about that. I read only one part of your post and assumed what the question was instead of actually reading... anyway, if you're on a Unix system, sudo works great :D

    44. Re:Sometimes you gotta take a look around. by Erik+Hollensbe · · Score: 1

      Actually, I would argue that the combination is old, and the pieces are new.

      Too many times I see developers who write libraries that already exist because it's missing such a small tidbit of functionality - what amazes me is that they do this due to a convenient language construct or adoption of a design paradigm. Too often the NIH syndrome could be solved with simple wrappers.

      But the applications are essentially the same - web browser, mail application, desktop shell. The Mac touts it's "revolutionary" interface, but it's still square windows, titles at top, and pointers to the application. It's what's between all that that's different.

      FORTRAN and C are great examples in many ways of designs that work, not because they're good, but because they're somewhat universally adopted. Both languages have standards boards, compilers go to great lengths to meet the standards, and then the compilers and development environments expand on that with API's and "frills". The result is that, in general, compilers for C and FORTRAN are unarguably some of the best code generators as far as languages go.

      However, C++ is still getting trouble getting people to adopt the STL. I imagine it's only a matter of time, but the fact that GNU has the most complete STL implementation says quite a bit about the goals of commercial compilers. VC++ is touted as having a great IDE by many, but it's STL support is anemic in comparison to what we have on the GNU side. One could say that the Windows API eliminates much of the need for the STL.

      Take this problem and extend it to applications, and you'll see a similar problem - doing web pages is a pain in the ass, not because the "glue" is different, but because there are 3 renderers for at least 3 browsers. Gecko and KHTML are going a long way, but Microsoft and Opera will most certainly not be giving up their own renderers anytime soon.

      And that leaves us web developers writing user-agent dependent CSS and HTML pushers. And that makes browsers setup features which change the user agent. It's a needless cycle and unfortunate for everyone - yes, even microsoft. It costs money to maintain IE, and I don't know anyone who's actually using Windows because it has IE on it (now or before). They have different reasons.

      A great example of all of this is GNOME vs. KDE. Basically your choice in development revolves around whether you want to use C or C++. The KDE C support is relatively anemic and likewise for the GNOME C++ scenario. Of course, I haven't been paying attention for several years, so this might have finally changed. The fact that they're just starting to place nice with ORB implementations is just disgusting.

    45. Re:Sometimes you gotta take a look around. by cburley · · Score: 1

      costs up to ten times as much to fix an error by the time it hits the market as it would to catch it during the design.

      I don't disagree that it *would be nice* to catch all the bugs before launch but saying that it is cheaper is a false start. Delaying time to market is also extremely expensive in the face of competitors.

      I think you're both right.

      It is definitely less expensive to ship software without a bug than to ship it with that bug, deal with bug reports from the field, diagnose the bug, fix the bug, risk regressions, and send out patches or new versions.

      For highly buggy software, then, the question becomes, what percentage of actual bugs (in shipped software) will actually go through that cycle?

      Let's assume 10% of the actual bugs result in user complaints. Right there, that means the extra expense dealing with incoming bug reports would have to be at least 10 times what it would have cost to not ship the bug in the first place for the extra attention to correctness to pay off.

      Then, of user complaints, only a certain percentage of bug reports are actually investigated. (Usually, they're prioritized, and the highest-priority ones get investigated first; so, lower-priority bugs might never even be investigated during the product's lifecycle.)

      Investigation costs more, but, typically, a lower percentage of overall bugs will be investigated than will be reported.

      Repeat this analysis for fixing bugs (which includes providing workarounds, such as "don't use this feature anymore" warnings in documentation) and shipping new software...

      ...and you end up with the cost-benefit model for Microsoft and its ilk, as well as most FOSS (including Linux, GCC, Emacs) and its ilk.

      That is, with most of that software, the actual bug count is assumed to be too high to ever have to worry that all those bugs will come home to roost during the product's lifecycle.

      There are exceptions, such as djb's software, including qmail, which (compared to other MTAs) has few features out of the box but has been nearly bug-free (and rock-solid in terms of security) since the 1.03 release many years ago.

      But qmail actually highlights the problem: to get almost any feature most Internet sites need for an MTA, third-party patches have to be applied, leading, in many cases, to bugs, even security holes.

      IMO the best approach is to decide, for a given product, what sorts of bugs are acceptable and what aren't. For an MTA or anything open to the outside world and especially running as "root", the djb approach of making security a #1 concern seems best, so choose a design that makes it hard for security flaws to exist, especially to propagate among components.

      For any software in which a human being composes something online -- this would include text processors, word processors, drawing and painting programs, audio manipulation and music composition programs -- IMO the #1 priority is to NEVER LOSE THE USER'S DATA.

      So the language chosen, the coding style, etc. should all be designed to allow the program to crash anytime without losing more than, say, the preceding 1 second of user input, and, ideally, saving (journaling) the user's work in an industry-standard form so the user always has the option of switching over to another product to complete the work.

      For a compiler, IMO the #1 priority is to NEVER GENERATE BAD CODE.

      Here, the cost of bugs that generate bad code is extremely high. So the design should make it hard for coding errors within the compiler to lead to incorrect code being generated -- better for the compiler to crash and burn than for it to add even more bugs to a program it's generating.

      In all these cases, there are eminently practical ways to architect, design, and implement programs accord

      --
      Practice random senselessness and act kind of beautiful.
  9. Does this mean C++ is dying? by Anonymous Coward · · Score: 2, Funny

    Can someone confirm this at NetCraft?

    1. Re:Does this mean C++ is dying? by Anonymous Coward · · Score: 0

      No, it means that someone will die unless asses are covered.

  10. The difference is by chirayuk · · Score: 2, Insightful

    ...that with .net - a patch to the framework can fix the buffer overflows (and other bugs) which are discovered and the benefits will be instantly seen by all applications using it. With C/C++, etc - you need to scan and fix each individual application for bugs. Its easier to fix the runtime than individual apps because every exploit would generally be exploiting the runtime (as long as its managed) which would make the runtime very robust. WIth C/C++, each time you discover a buffer overflow or similar exploit in an app, it does say anything about other apps which might have similar problems.

    1. Re:The difference is by ufnoise · · Score: 1

      If the software was compiled using shared system libraries, you can do the same thing with C/C++ apps. If there is a flaw is in the program, and not in the "framework", you'd have to redistribute (or patch) the application anyways.

    2. Re:The difference is by Anonymous Coward · · Score: 0
      That sounds totally wrong.

      With C/C++ you'd scan and fix the .so shared libraries in the same way you would a Mono .dll.

      I bet even in Microsoft's world, if a .net thingy is written without sharing code it'll have to be scanned individually; while if a C++ library is shared, fixing it will benefit all programs that use it.

    3. Re:The difference is by Anonymous Coward · · Score: 0

      Fine in theory, but we all know that problems inevitably arise due to incompatibilities in various versions of shared libraries. On Windows, this led to the syndrome affectionately called "DLL hell", while Linux has the "the version of XXX..." message that means one has to keep various versions of shared libraries kicking around because some software requires older .SO files (.SO hell?).

  11. Authors Impartiality by Anonymous Coward · · Score: 4, Informative

    ...[switch to a] minority product... ...open-source tools like Linux, Apache...

    From netcraft:
    Apache 67.92%

    Sure... Minority Product.

    Author obviously isn't the most impartial of writers.

    1. Re:Authors Impartiality by Anonymous Coward · · Score: 0, Funny

      NETCRAFT CONFIRMS IT!

    2. Re:Authors Impartiality by Anonymous Coward · · Score: 0

      APACHE IS DYING!

    3. Re:Authors Impartiality by julesh · · Score: 2, Informative

      I've seen a lot of people here commenting on Jeff D's opinions in this piece, assuming that he's arguing from the perspective of an MS fanboy who thinks very-high-level languages are the greatest thing since sliced bread.

      As someone who knows a little bit about the man, I think I need to put the record straight a little:

      - He is an open source advocate -- his company, Coriolis Press, specialises in producing books about technical aspects of open source software
      - He clearly doesn't believe that high level languages are the only way to write software -- his book, Assembly Language Step-by-Step 2nd ed. (Wiley) is one of the best introductions I've ever seen to assembly language programming on Linux.

      So, he was mistaken about how popular Apache is. In his defense, it is popular for mass hosting services and higher volume sites, but in the mid-range band I believe IIS is more popular. That mid-range band is also the most profitable to target with worms and other attacks, because it is the band that is least likely to be managed by a competent admin who has kept up-to-date with patches.

    4. Re:Authors Impartiality by rkhalloran · · Score: 1

      Actually, Jeff & Keith Weiskamp parted ways with Coriolis a couple of years back. His new operation, Paraglyph Press, is being distributed by O'Reilly, and while it does have a number of Windows-oriented books (let's be fair, that's the majority of the market), it does have Mac, Java, Perl, and even Kylix (not surprising for the man who wrote the definitive Turbo Pascal reference) books also.

    5. Re:Authors Impartiality by miu · · Score: 1

      "Assembly language Step-by-Step" is really an introduction to x86 architecture guide for people who missed out on those kind of classes in college, be warned that Jeff D is actually a filthy pascal fiend at heart :)

      --

      [Set Cain on fire and steal his lute.]
  12. 2@1time by l3v1 · · Score: 3, Insightful

    [...]popularity and market share of Microsoft's products that are responsible [...] the problem is largely with C/C++ [...]

    Yup, that's 2 bullshits in one sentence.

    --
    I am putting myself to the fullest possible use, which is all I can think that any conscious entity can ever hope to do.
    1. Re:2@1time by geg81 · · Score: 1

      He is right on. But it takes a lot of people like you in the industry, people who just don't get it, to keep the current state going.

    2. Re:2@1time by Toby_Tyke · · Score: 1

      And the merry go round spins round again.

      Every time /. carries a story about security flaws in MS products the same two argumants are trotted out.

      MS-Apologists/fanboys: The only reason you hear about all these problems is because Windows is so popular, so the bugs are more likely to be found. People who hate MS (ie:everyone else on /.): No no no, it's because M$ write poor insecure code.

      Unfortunatly, this is not a zero sum game. Both arguments have some truth to them. There is no doubt that Microsoft have a terrible record on security, and that they have implemented many features which are simply unsafe (active X anyone).

      On the other hand, there are far more script kiddies and crackers attacking M$ than there are Linux and Mac OS. Yes, as I said above, this is partly because it's easier. But it's also because it's more popular. After all, if Windows was as secure as, say, Mac OS, and there were 100 virus writers working on Mac OS and 10 on Windows, you would expect 10 times as many viruses to be writen for Mac Os.

      Of course Windows is insecure and badly written, which makes the situation worse. But if Mac OS or Linux had the market share Windows has, more viruses and exploits would exist. Far fewer than for windows, but still more than presently do.

      --
      "I realise this is not a very popular opinion but it's the truth, and there for needs to be said" -Bill Hicks
    3. Re:2@1time by RAMMS+EIN · · Score: 1

      Man, I want to get modded up for writing one-liners like that! I think both of these "bullshits" are more true than you suspect.

      Tackling the latter one first: if you read a security list like Bugtraq, you will see that nearly all vulnerabilities are buffer overflows, format string vulnerabilities, cross-site scripting vulnerabilities, or number overflows. All of these are symptoms of language weaknesses. Buffer overflows and format string vulnerabilities are pretty much a trademark of C - few other popular languages are as vulnerable to them.

      As to popularity: you can't be sure one way or another. I am sure the author does not have the evidence to prove his claim. I'm also sure you don't have the evidence to refute it. Yes, Apache is more popular than IIS, but gets exploited less often. That's one case - what about the general trend? And even if it is a general trend, that doesn't mean anything about the quality of the products. IIS might be broken into more because its attackers try harder, or are more skilled, or because IIS sysadmins are less skilled, or pretty much anything else. You can never rule out all the factors (neither in the wild, nor in a controlled experiment), so you can never rule out popularity. Common sense says that bigger targets are easier to hit.

      --
      Please correct me if I got my facts wrong.
    4. Re:2@1time by Anonymous Coward · · Score: 0

      I have a real hard time understanding all these C apologists. Sure, in the real world C and C++ are very useful languages and their popularity and level of control make them a very good choice for many projects, but that doesn't somehow make it a bullshit argument that C and C++ cause bugs. It's a fact that almost any other halfway popular language avoids many of the worst pitfalls of C and C++, and it's disingenious to deny the problem and go on as before.

      So, C++ is the best choice in your circumstances, great. It doesn't mean that it is the perfect solution to every problem and that any slight towards it is necessarily wrong. There are real problems and they must be addressed if we are to improve the quality of the software we produce. Maybe you have enough on your hands not to worry about security vulnerabilities. Fine, but why deny the problems? That's just stupid.

  13. he's right about some things by EllynGeek · · Score: 3, Insightful
    But not many. Just another Microsoft droid spouting the same tired propaganda, and completely devoid of facts. First of all I don't believe 90% market share, especially not worldwide.

    Secondly, its record speaks for itself- windows, outlook, and IE are exploited because IT'S SO FREAKING EASY. Sure, you can maybe sort of lock out users from core system functions, but you can't lock out applications from altering core system files. Hello, the Registry! Hello .dll and .vxd! Just visit a Web site and poof! ownz0red. Just leave your winduhs system connected to the Internet, and bam! Instant spam relay. such a friendly lil OS!

    Really dood, you call yourself a programmer- you should know better. Face the facts. If you can.

    --

    we will end no whine before its time

    1. Re:he's right about some things by Anonymous Coward · · Score: 0
      Do the research yourself. MS definitely has 85-90% marketshare of desktops, with the remainder split with Apple and other operating systems. Servers are a different matter and are not themselves devoid of bug reports and a plethora of patches.

      Does anyone outside of high school use the spelling, "dood"?

    2. Re:he's right about some things by Anonymous Coward · · Score: 0

      But not many. Just another Microsoft droid spouting the same tired propaganda, and completely devoid of facts. First of all I don't believe 90% market share, especially not worldwide.

      Secondly, its record speaks for itself- windows, outlook, and IE are exploited because IT'S SO FREAKING EASY. Sure, you can maybe sort of lock out users from core system functions, but you can't lock out applications from altering core system files. Hello, the Registry! Hello .dll and .vxd! Just visit a Web site and poof! ownz0red. Just leave your winduhs system connected to the Internet, and bam! Instant spam relay. such a friendly lil OS!

      Umm, yes, you can prevent applications from altering core system files. Don't run with Administrator privileges and C:\Windows, HKEY_LOCAL_MACHINE are both read-only to both yourself and applications that you run. Perhaps you are the one spouting garbage that is devoid of facts.

    3. Re:he's right about some things by 0x461FAB0BD7D2 · · Score: 4, Insightful

      What is ultimately interesting is that if IE was not as popular as it is, the bugs would still exist, and it would still be exploited. The only difference is that it wouldn't have the impact that it does now.

      The interesting thing is that C/C++ is not to blame. C and C++ provide enough means to avoid buffer overflows as they do the means to create them. But in any software company, getting products out in time takes precedence over good code. That is the problem. The language used only changes the exploits and vulnerabilities available, not the fact that they exist.

      The only way to reduce such security concerns is to change the culture in the software world.

    4. Re:he's right about some things by DigiShaman · · Score: 1

      I'm a Windows NT user myself (I love XP). Call it a user comfort zone for me. However, I just hope the Apple Mac platform gets more popular with time. Maybe then Microsoft will feel the market pressure to develop better code in order to compeate with Apples market share.

      --
      Life is not for the lazy.
    5. Re:he's right about some things by westlake · · Score: 1
      But not many. Just another Microsoft droid spouting the same tired propaganda, and completely devoid of facts. First of all I don't believe 90% market share, especially not worldwide

      "Current trend is that Windows XP is growing fast. The windows family counts for more than 90% " OS Platform Statistics Face the facts. If you can. Where is your proof that Microsoft has anything other than overwealming dominance on the PC desktop?

  14. Blaming the language is just an excuse by Anonymous Coward · · Score: 4, Insightful

    It's really not that hard to avoid buffer overflows in C/C++. It's not the fault of the language, but of the programmer. Obviously, avoiding buffer overflows is an added thing to think about when coding in C/C++, but I've worked with enough Java programmers to know that no language can compensate for a poor/ignorant programmer.

    It's just an excuse, plain and simple.

    1. Re:Blaming the language is just an excuse by Lisandro · · Score: 1

      I was just going to post the same. C/C++ are more prone to buffer overflows, given - if the language is compiled the possibilty can't be avoided, even less with such "low level" ones like these. But it's not that hard to harden (pun!) C/C++ against overflows: if you're inputting data, of any kind, and no matter what, check it for validity. Presto!

      C# and Java are nicely sandboxed and have many nice features both C and C++ lack, but all of that comes with a performance hit, no matter how minor. For some people it's not a choice, and like the parent said, writting secure C/C++ is no rocket science. At all.

    2. Re:Blaming the language is just an excuse by jilles · · Score: 1

      99% of security bugs are about exploiting buffer overflows. It doesn't matter how stupid a Java programmer is because as long as he sticks to Java he will not create a buffer overflow.

      By your definition the programmers of, amongst others, sendmail, the linux kernel, ssh, apache, bind are incompetent and the compiler didn't protect us from them for the long list of bugs which are still being found in these programs.

      --

      Jilles
    3. Re:Blaming the language is just an excuse by tesmako · · Score: 1

      Not unlike how it is actually not that hard to drive safely while intoxicated.

    4. Re:Blaming the language is just an excuse by Anonymous Coward · · Score: 0

      They're trying to herd people towards their "safe" languages instead of addressing the issue of programmer quality and appropriate deadlines. They know deadlines are shorter as competition and/or greed increases, so they're basically saying "use our safe languages (C#/Java) and you can write safe and secure code without much experience in no time," and management eats their bait all the time.

      Then come the hardware vendors repeating the mantra trying to sell management hardware to run the old software, but written on new "safe" languages.

    5. Re:Blaming the language is just an excuse by Anonymous Coward · · Score: 0

      What happens if you declare an array of 10 integers in Java, and then do a[12]=0;

      Exception? That's still a buffer overflow, although it isn't a stack smashing buffer overflow. Whether it's a security problem depends on the catch. E.g. if it terminates the application, it's a denial of service attack.

    6. Re:Blaming the language is just an excuse by Kjella · · Score: 1

      A tightwire over a chasm and an overhead walkway with rails have one thing in common, you don't fall down if you move perfectly straight and balanced.

      Yes, a drunk person could tumble over the rails and kill himself too. But is there any reason to make it much easier than necessary?

      Personally, I use the C++/QT library. QStrings and QByteArrays, no direct pointer arithmetic. Unless you're doing something really performance critical (e.g. cell phones, 3d engine core, crypto library), I don't see any reason to mess around with straight pointers.

      Kjella

      --
      Live today, because you never know what tomorrow brings
    7. Re:Blaming the language is just an excuse by cmarkn · · Score: 1

      I don't see how you can do this through input. Your program could read the ten integers and you supply 12, but what Java reads is Strings. They have to be explicitly converted. So your scenario can't happen.

      Besides, how do you get an exploit out of this? Crashing the application, even if you could do it, is a pain, but it is completely different from being able to poke new code into the instruction space. That's what makes buffer overflow a serious problem, not invalidating data.

      --
      People should not fear their government. Governments should fear their people.
  15. technically by Anonymous Coward · · Score: 0

    Buffer Overflows are avoidable with good programming practices and good code maintance. This what Microsoft failed at. Furthermore they are a nice juicy security target so their multitude of mistakes are taken advantage of. Market share is only one part of the equation, one most not overlook "quality".

  16. I dissagree....MS is simply to rich, lazy, sloppy by Anonymous Coward · · Score: 0

    Microsoft had it's chance to make good, stable, reasonably priced OS's but they took the easy road of quickly pushing out products out the door, numerous un-ethical marketing and fear marketing programs, very unethical buisiness practices and they have only themselves to blaim that linux now threatens them in the long term...hiding behind patents won't work in the long term...the only thing that will work is good, stable operating systems...its not like cpu architectures wear out...so a good operating system will last a very long time. Only an idiot would want 5000 versions of windows when linux is availible.

  17. Huh? by Anonymous Coward · · Score: 3, Insightful
    Our ability to think and reason was not the product of evolution, but was deliberately chosen for us.
    A statement on the origins of thought and reason founded on the use of neither...Interesting!
  18. TFA as AC! Say no to whores! by Anonymous Coward · · Score: 5, Informative

    The Lessons of Software Monoculture
    by Jeff Duntemann

    November 1, 2004 --

    Last summer, much was made of Slate author Paul Boutin's harangue in his June 30, 2004 "Webhead" column. Boutin basically told his readers to drop Microsoft's Internet Explorer like a hot rock and move to Mozilla's Firefox, because of the increasingly nasty security holes turning up in IE. Problem is, Slate is owned by Microsoft.

    Ouch.

    It really has gotten that bad, and it's easy to be left with the impression that Microsoft creates lousy software, rotten with bugs that allow the black hats to break into our networks and bring the global Internet to its knees. The anti-Microsoft tomato tossers insist that if only Microsoft cleaned up its products, we'd be rid of the security holes and the black hats who thrive on them.

    It's not that simple. Microsoft has some of the best programmers in the world working on its products, and books like "Writing Solid Code" from the Microsoft developer culture are seen as classics that belong on every programmer's shelf. Nonetheless, Microsoft software has bugs; all software has bugs, which is a crucial point that I'll return to later.

    What we have to understand is that our current problems with Internet Explorer have less to do with bugs than with success. When a product has 90% of a huge worldwide market, there will be problems. It doesn't matter what the product is, and it matters only a little how good it is. What matters is that Internet Explorer is virtually the sole organism in an ecosystem that the world's technology industry depends on. When IE catches a cold, the networked world gets pneumonia.

    This metaphor from biology is called software monoculture. Ubiquitous high-bandwidth communication has turned the world of computing from countless independent islands into a single global ecosystem. The fewer distinct organisms at work within this ecosystem, the easier it is for a bug--any bug--to become a threat to the health of the whole.

    Worms and viruses that depend on these bugs replicate and travel automatically, and unless they can assume that the next system is identical (bugs and all) to the one they're leaving, they can't propagate as quickly nor do as much damage. If only one in 20 systems allowed such worms and viruses to take hold (rather than nine out of 10) it's doubtful that they could ever achieve any kind of critical mass, and would be exterminated before they got too far.

    Software monoculture happens for a lot of reasons, only a few of them due to Microsoft's sales and marketing practices. In the home market, nontechnical people see safety in numbers: They want to be part of a crowd so that when something goes wrong, help will be nearby, among family, friends, or a local user group.

    In corporate IT, monoculture happens because IT doesn't want to support diversity in a software ecosystem. Supporting multiple technologies costs way more than supporting only one, so IT prefers to pick a technology and force its use everywhere. Both of these issues are the result of free choices made for valid reasons. Monoculture is the result of genuine needs. Technological diversity may be good, but it costs, in dollars and in effort.

    As if that weren't bad enough, there is another kind of software monoculture haunting us, far below the level of individual products--down, in fact, at the level of the bugs themselves.

    If you give reports of recently discovered security holes in all major products (not merely Microsoft's) a very close read, you'll find a peculiar similarity in the bugs themselves. Most of them are "buffer overflow exploits," and these are almost entirely due to the shortcomings of a single programming language: C/C++. (C and C++, are really the same language at the core, where these sorts of bugs happen.) Virtually all software written in the United States is written in C/C++. This includes both Windows and Linux, IE and Firefox. A recent exploit turned up in Firefox that was almost identical to one

    1. Re:TFA as AC! Say no to whores! by niittyniemi · · Score: 2, Insightful

      The C/C++/C#/Java debate is a complete red-herring.

      The FA's author's analysis:

      software monoculture + network + "unsafe" languages = security problems

      is overly simplistic to my mind.

      Imagine a world where OpenBSD (written in C) was the predominant OS, is he really saying that we would have the same problems?

      My opinion is that there is no economic incentive for MS to produce an OS or applications that are robust and secure. After all we're dealing with a monopoly here which doesn't have to compete on the desktop space.

      If they did, where would the "upgrade income" come from? The "upgrade income" comes from people who need more features but more importantly need the promised stability of MS's latest platform.

      We were promised that the NT based XP would deliver us from the evils of the DOS based Windows (yet things have got worse), now we are promised that Longhorn will do that (I'll lay money on it that it wont).

      If they produced a platform as solid as OpenBSD securitywise, then people have all of a sudden lost a good deal of incentive to upgrade and fill the MS coffers.

      It beggars belief that MS with their money, programming talent and a "safe" language can't produce a solid OS. Apple can with a lot less resources, so you have to ask yourself:

      "Why don't Microsoft want to produce a solid platform?"

      ...and then follow the money....

      Their business model requires that their platform is always semi-broken and the answer to all the brokenness is the next MS platform round the corner (although it never is, of course).

      If they didn't have a monopoly, then this business model would come crumbling down. Yet the articles author has nothing to say about the MS monopoly, the upgrade cycle (in the commercial software world) and how it impacts security.

      --
      The Machine stops.
    2. Re:TFA as AC! Say no to whores! by gammoth · · Score: 1

      Thank you for your thoughtful analysis.

  19. purify? by Anonymous Coward · · Score: 0

    I mean why can't a company with the financial resources of Microsoft invest some back into solving these kinds of problems. If buufer overflows are determined to be the problem then Purify and get on with it...

  20. Re:Popularity not the problem. by Anonymous Coward · · Score: 0

    How do I know you are not making a joke about the other people making a joke?

  21. IIS vs. Apache? by whoever57 · · Score: 3, Insightful

    Once again, another defender of Microsoft's software fails to explain why IIS, with it's smaller market share, has had far more vulnerabilities and more severe vulnerabilities than Apache.

    I think what all MS apologists ignore is the security in depth that exists in *NIX systems. They ignore issues like a vulnerability in Apache may not result in a root compromise, because it is running as an unpriviledged user.

    --
    The real "Libtards" are the Libertarians!
    1. Re:IIS vs. Apache? by man_of_mr_e · · Score: 2, Interesting

      Sorry, but IIS doesn't have a smaller market share. Considering that a server is vulnerable, not a host, there are more servers that run IIS than run Apache according to a (dated, but probably still relatively accurate) Netcraft study.

      IIS runs on about 50% of the physical servers out there.

      Further, IIS can be run as a non adminstrator as well, and defaults to this configuration in IIS6, which, btw, has only had 1 moderate vulnerability in it's > 1 year on the market.

    2. Re:IIS vs. Apache? by Anonymous Coward · · Score: 0

      And then Why do you count from 2003?. The other virus/worms before doesn't count?.

    3. Re:IIS vs. Apache? by geg81 · · Score: 1

      Software development isn't physics, so there are many random exceptions to rules.

      Of course, Apache and IIS have lots of other differences: in the number of people working on them, in the kind of people working on them, in the kinds of libraries they use, etc., so it doesn't even even have to be an exception. For example, simply the fact that Apache is an open source project might be enough to explain why it is less buggy than IIS despite being widely used and being written in C.

    4. Re:IIS vs. Apache? by mark-t · · Score: 1
      The question that Microsoft doesn't want you to ask, however, is why should a less popular system (or even roughly equally as popular system, as you suggest) be so vastly much more targetted than other systems if Microsoft was a target simply because of their popularity?

      The answer is that their popularity cannot be the (sole) reason for the attacks, and MS is deluding themselves to continue to believe this is the case.

    5. Re:IIS vs. Apache? by man_of_mr_e · · Score: 1

      You are correct that popularity is not the sole reason. Other reasons include: A bias against them in the hacker/cracker community, a single hardware architecture (it's easier to target 100 million machines all running x86 than 100 million running x86, sparc, PPC, MIPS, Alpha, etc..

      If all those other factors were not there, I would guess that you would see roughly similar attach rates. Remember that the vast majority of the worms, viruses, attacks, etc.. are taking advantage of a very small number of vulnerabilities.

  22. Re:Popularity not the problem. by Anonymous Coward · · Score: 1, Funny

    how do i know any of you actually exist. How do i know i exist. Fuck, there goes sleeping for the night.

  23. odd ideas about programming by belmolis · · Score: 2, Insightful

    Maybe I'm just ignorant and ill-read, but I've never even heard of Writing Solid Code, which according to the article is a classic. I somehow missed it while reading The Art of Computer Programming, The Dragon Book, The Structure and Interpretion of Computer Programs, Software Tools, and the like.

    I'm also amazed at the idea that competant programmers in a decently run company can't avoid writing software full of bugs because C and C++ lead to buffer overflow errors. They're easy enough to avoid. I've never had one in anything I've written and its not as if I've never had a bug.

    1. Re:odd ideas about programming by Anonymous Coward · · Score: 0

      Actually, none of the books which you claim to have read approach the problem of software security.

      TAOCP is known for being a thorough treatment of algorithms. It does not contain anything related to software security (as in preventing programming errors)

      The Dragon book is about compilers. While you may glean quite a bit of information about how to parse a syntax tree, nothing in there is going to teach you how to prevent yourself from walking off the end of an array.

      And so on and so forth. All those books rely on you having the ability to program well in the first place. A badly written compiler doesn't get brownie points because its author read Sethi's post doctoral thesis on accelerated BNF parsing theory.

      WSC is for all the college graduates who think they've figured everything out when in reality their code has never had to face the scrutiny of a QA team. It's not the best book about software construction, but it does hit on some very important topics about coding defensively and clearly.

    2. Re:odd ideas about programming by belmolis · · Score: 1

      The books I listed are examples of real classics. I never suggested that they dealt with secure programming. Your insinuation that I haven't read them is baseless but fitting for an Anonymous Coward.

    3. Re:odd ideas about programming by Anonymous Coward · · Score: 0

      I insinuated no such thing.

      Classics, yes, indeed they are. However, does having read the classics imply that you are somehow better than someone who read all those in addition to other offerrings?

      Writing Solid Code is like the Star Wars of computing literature. It has enough meat to be interesting and keep you coming back for more, but it ain't Gone with the Wind.

    4. Re:odd ideas about programming by belmolis · · Score: 1

      I said nothing about being better than anybody, nor did I suggest that I had read only the classics. I merely compared real classics with what the article claimed to be a classic. Writing Solid Code may well be a perfectly useful book - I have no opinion of it since I haven't read it. What I wondered was whether it is really a classic since, unlike many real classics, I had never heard of it. Thus far the response I've seen makes me think I was right - it may be a good book, but calling it a classic is hyperbole - but I was prepared to learn that I was wrong and had missed a true classic.

      When someone mentions things that he has read and you respond with a reference to the books he "claims" to have read, you're casting doubt on whether he has read them. That's the insinuation to which I referred.

    5. Re:odd ideas about programming by nate+nice · · Score: 1

      Ahh, The Dragon Book. I've read that myself, and it's a fine book on compilers, but man is it hard to read. The topics and theory are right on and easy to digest, but talk about a dry book. I had to stop myself from reading but thinking of other things so many times in that book.

      I recommend to anyone interested in computer programming to read it, and if you want to write any type of compiler or compiler like system. But beware, this book is D-R-Y.
      I would also recommend "The Pragmatic Programmer" as well as "Mastering Regular Expressions".

      --
      "If you are a dreamer, a wisher, a liar, A hope-er, a pray-er, a magic bean buyer ..."
    6. Re:odd ideas about programming by Anonymous Coward · · Score: 0

      WSC may be considered a classic in the sense that McConnell's Code Complete, Eckel's "Thinking in XYZ" series, and Brooks' Mythical Man Month are. Well worth the time to read them.

      None of those are exceptionally good, but they come up in technical conversation (as in this article) enough that to not know of their existence is a little worrisome at first glance. It's not necessary to agree with everything in them, but to have an opinion about them is usually indicative of having broad horizons as a software engineer/manager/etc.

      Did you not claim to have read those books? Did I say anything other than that you had claimed so? Perhaps you are reading too much into my posts.

    7. Re:odd ideas about programming by man_of_mr_e · · Score: 3, Insightful

      I would find it difficult to believe that you've *NEVER* had a buffer overflow error in any program you've written unless:

      1) You've not written any programs (or programs of any complexity)
      2) You've only used scripting, interpreted or runtime languages (ie Perl, Java, etc..)
      3) ... I can't think of any other reason

      I would tend to believe that you did have vulnerabilities in your code, and were simply unaware of them. Buffer overflows can sometimes be very difficult to spot, since you must also know the inner workings of libraries and other code which you pass pointers to.

      You're right, it's not difficult to avoid the vast majority of buffer overflows, but there are whole classes of subtle overflows that can go undetected in code for decades (for example, not too long a number of such bugs were uncovered in BIND that had been there for 10+ years.)

    8. Re:odd ideas about programming by joto · · Score: 1

      Yes, it's a "classic", in the sense that it's been there for a while, many good programmers have read it, and many good programmers recommend it. Disclaimer: I'm not among those who have read it, or recommended it.

    9. Re:odd ideas about programming by bigbird · · Score: 1
      Maybe I'm just ignorant and ill-read, but I've never even heard of *Writing Solid Code*, which according to the article is a classic.

      If you are a programmer you should have heard of it. And it is certainly a classic that *every* programmer should read.

    10. Re:odd ideas about programming by chthon · · Score: 2, Interesting

      What I find lacking in this whole discussion is that nobody seems to run their code through lint or splint.

      I think that would narrow down a whole lot of errors.

    11. Re:odd ideas about programming by Stu+Charlton · · Score: 1

      What I wondered was whether it is really a classic since, unlike many real classics, I had never heard of it.

      What makes a classic? You seem to be referring to computer science classics. Books like Writing Solid Code are software development classics -- by practitioners, for practitioners. It also helps if you've had exposure to software development on Mac, DOS or Windows as these books tended to evolve from the PC development community in the early 90s, prior to Linux's rise.

      In some circles, Design Patterns is considered a classic, particularly in C++ circles. Steve McConnell's Code Complete also is.

      Then there are books like The Mythical Man Month, Peopleware, and The Psychology of Computer Programming that are more about human factors in softwre development. They're not CS related either, but have had tremendous impact on the field of software development.

      --
      -Stu
    12. Re:odd ideas about programming by belmolis · · Score: 1

      Of course I can only speak of detected bugs, but no, I can't recall ever having a buffer overflow bug. I've written tens of thousands of lines of C, so it isn't because I haven't programmed or have only used scripting languages. Although the security issues with buffer overflows were not an issue when I learned C, I remember learning early on to be careful about buffer size. As far back as I can remember, I used input routines that either terminated input on reaching the end of a fixed buffer or allocated storage dynamically, used strncpy instead of strcpy, and allocated fixed size buffers large enough to contain the largest possible input rather than something typical.

      Its hard to be sure, but I suspect that one reason I have always been particularly sensitive to this issue is that a lot of the software that I have written has been for the purpose of processing text, which draws ones attention to the text. It's probably easier to get sloppy about textual input when the focus of the program is something else and the textual input is something secondary such as configuration information,

    13. Re:odd ideas about programming by belmolis · · Score: 1

      As it happens three of the four books I mentioned are CS books, but Software Tools seems to me to be more of a programming book. And I have read books like The Mythical Man Month and, just recently, ESR's The Art of Unix Programming, so my reading has not been restricted to pure computer science.

      I suspect that a major factor is that almost all of my programming experience (other than very early Fortran on mainframes and assembly language and Basic on an old minicomputer) has been in a Unix environment. I've never written for the Mac or MS Windows environments, and only a little under DOS. As you say, the PC world is somewhat different from the Unix world, and books popular in one may not have the same status in the other.

  24. ActiveX by LittleLebowskiUrbanA · · Score: 1

    I really don't think C/C++ are to blame for ActiveX vulnerabilities.

    1. Re:ActiveX by omicronish · · Score: 3, Insightful

      I really don't think C/C++ are to blame for ActiveX vulnerabilities.

      I completely agree. The problem with ActiveX and some other Microsoft ideas is that they're fundamentally flawed with regards to security. You simply don't allow arbitrary code to download and execute. ActiveX shouldn't exist at all, and you're right, the problem is deeper than the language chosen.

    2. Re:ActiveX by Anonymous Coward · · Score: 1, Insightful

      I remember ten? years ago when the first ActiveX stuff was introduced and thinking and hearing others mention how it was "fundamentally flawed with regards to security."

      It was generally agreed upon that "You simply don't allow arbitrary code to download and execute." And that "ActiveX shouldn't exist at all."

      That it took the Retards From Redmond a decade to figure out what even the most junior engineer should know about computer security is a damning indication that the problems at MS are "deeper than the language chosen."

    3. Re:ActiveX by Moraelin · · Score: 4, Insightful

      Wrong. You do let arbitrary code download and run all the time.

      Each time you go to a web site that uses JavaScript, guess what? You download and run arbitrary code. Interpreted code, yes, but arbitrary code nevertheless.

      Each time you download a Java or Flash applet, even if just as an ad on a page, you are downloading and running arbitrary code. In Java's case even downloading and compiling it to binary code for your CPU.

      As I've said before it would be possible to sandbox ActiveX to hell and back. Make it run in a virtual environment where it can't touch any files that it didn't create itself (e.g., a chroot jail), open any ports, or even call the OS methods without first going through a sanity checking layer.

      Now Microsoft doesn't do that, and it's guilty as charged of bad design there. That much we can aggree upon.

      But dismissing it all as "You simply don't allow arbitrary code to download and execute." is simplistic. And in fact it's over-simplified thinking like "Java=good, binary code=bad" is the arch-nemesis of security.

      Real security doesn't involve mindlessly pinning magic talismans onto the code, nor repeating fashionable mantras. It involves a real security analysis. Who's going to attack us? How? What _can_ happen? How can we prevent that? Etc.

      Again, obviously MS didn't do a real security analysis there. We can aggree on that. But that's no reason to assume that one can't possibly be done by anyone.

      --
      A polar bear is a cartesian bear after a coordinate transform.
    4. Re:ActiveX by Anonymous Coward · · Score: 0

      Javascript and flash shouldn't exist either. And java is hopeless for web pages, for on thing it loads so slow.

    5. Re:ActiveX by Anonymous Coward · · Score: 0

      I think the possibility of a sandbox was covered by the word "arbitrary". If you run the code in a checked environment, then you are not really allowing "arbitrary code" to run -- you are allowing only non-malevolent code to run.

    6. Re:ActiveX by Anonymous Coward · · Score: 0

      Well, sandboxed code isn't arbitrary in at least one sense of the word arbitrary.

  25. easy... by MoFoQ · · Score: 1

    Microsoft

    Just think, if code was perfect, then there would be no need for upgrades; a valuable source of revenue.

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

      They don't make money from sloppy code updates, only from new-feature updates or complete code-base rewrites. Any updates from sloppy code comes from MS-Update, and *gasp*, it's free.

      Don't be such fucktard.

    2. Re:easy... by Anonymous Coward · · Score: 0

      Ummm, this Slashdot, where tin-foil hats are optional, comprendo buddy? To sum up: Bush sux (I agree with that one), Microsoft Sux, Linux rulz, FOSS rulz, virginity is the norm. Have a nice day, thank you for your time.

    3. Re:easy... by Curunir_wolf · · Score: 3, Insightful
      They don't make money from sloppy code updates, only from new-feature updates or complete code-base rewrites.

      I call bullshit. There was at least 1 Windows upgrade that was MARKETED by Microsoft because it had X bug fixes (something like 5000). This was the primary reason to BUY the upgrade.

      And if you check out the Visual Studio .NET updates, you'll see that bug fixes are not going into service packs or free updates, they are going into the next release. Check out some of the forums on .NET, developers find bugs, MS acknowledges them, and then promises to have the bug fix ready for the next release (Whidbey) *which you'll have to pay for* !!!

      --
      "Somebody has to do something. It's just incredibly pathetic it has to be us."
      --- Jerry Garcia
    4. Re:easy... by MoFoQ · · Score: 1

      exactly my point.

      at least with VS6, they came out with service packs.

      And also, the DX9 SDK is suppose to be free...yet they don't bother to update it.

    5. Re:easy... by MoFoQ · · Score: 1

      VS.Net is a prime example to the contrary.

      No free service packs, just a newer version with bug fixes which you have to pay for.

  26. C++ to blame by delta_avi_delta · · Score: 5, Funny

    Obviously it's all the fault of C++... because no other vendor but Microsoft uses this obscure and arcane language...

  27. So which of these will it fix? by interiot · · Score: 2
    So which of these things will an all-maanaged-NET-code environment fix?
    • Companies who insist on putting maximally-powerful scripting languages in every possible application and document format they can get their hands on
    • Companies who are only now implementing the concept of a root account
    • Companies who choose to develop ActiveX web objects over Java applets, because money is better than security
    • An environment where users download and install spyware themselves
    1. Re:So which of these will it fix? by julesh · · Score: 2, Insightful

      Companies who are only now implementing the concept of a root account

      I'm not quite sure what you're getting at here. Windows NT has had an Administrator account, being similar in principle to the unix idea of 'root', since it was first released over 10 years ago.

    2. Re:So which of these will it fix? by interiot · · Score: 1

      I'm not terribly knowledgable about the internals of windows, but my impression was that there were many areas where the security of the admin account was put in a lot of risk from core networking services having to be run in root, or something like that? I just got the impression that Microsoft didn't want to do the extra work to ensure that "root" was kept secure, because it didn't benefit their bottom line until recently.

  28. Re:Popularity not the problem. by Anonymous Coward · · Score: 5, Insightful

    It's odd to refute specific points of the article when its basic premise is flawed, but the one that applies is "all software has bugs". This is a defeatest attitude that is contradicted by the existence of formal methods for proving a piece of software to be bug free, and even of automatic theroem provers for showing software to be bug free (such as ACL2). This is the part that I was complaining about, and it is fair to criticise that without having to go into the finer points of the rest of the article.

    To further expound on my original complaint, the article argues that microsoft's bad reputation is due to the popularity of its software, but this is only valid if it is impossible to make software better than Microsoft. The article seems to lean this way by stating that Microsoft has some of the smartest developers around working for it, but having the smartest developers doesn't mean that it produces the best code. Microsoft has earned its bad reputation by allowing so many bugs into such critical software like an Operating System.

  29. I would agree with TFA if not for one thing.... by Vladan · · Score: 5, Insightful

    Methodology matters.

    I would agree with TFA if the author were comparing Internet Explorer 4 with, let's say, Netscape 6 or Opera 7. If he were, then I would whole-heartedly agree that IE is a victim of its own popularity and that software monocolture is an "evolutionary" reality mirrored in biological systems.

    But...

    There is a difference between how IE code gets written and how Mozilla code gets written. I'm not going to make any asinine qualitative comparisons between the skills of Mozilla contributors and MS staff (I respect both), but let's face it....

    YOU know the difference between writing a commercial product with an unrealistic deadline, a list of new features four pages long (most of which are crap) and under the direction of non-technical managers who like Gantt charts and daily productivity reports and writing a project for your own self-satisfaction.

    Mozilla code is written incrementally, with the goal of quality in mind, under public scrutiny (no peer review beats public scrutiny) and many of the contributors are doing it because they want to do it and want to do a good job. It's their pet project.

    Compare the quality of code you write for work or in college under strict deadlines, and the code you write for fun.

    - How many alternatives algorithms do you go through with each?
    - Do you settle for "good enough" when you are writing code for yourself?
    - Are you doing your own corner-case QA as well as you could be when you make that check-in into the company CVS when you know that QA will most likely test it (as an intern, I used to share a desk with QA guys, the catch is that they love to cut corners).

    Not to mention endemic problems with large corporate projects of any type: corporate pride which prevents people from going back on bad decisions (ActiveX and IE security zones), lack of management support (how many top coders are still actively developing IE? any?), and all kinds of office politics. Many of these are avoided with well managed open source projects.

    Cheers,

    AC

    1. Re:I would agree with TFA if not for one thing.... by man_of_mr_e · · Score: 1

      If there's really such a difference, then why has Mozilla recently had a bunch of similar flaws to IE flaws?

    2. Re:I would agree with TFA if not for one thing.... by Vladan · · Score: 2, Interesting

      I'm not a contributor to Mozilla so I really can't answer that question fully. If someone reading this is, maybe they can give a more accurate explanation of why rather than my generalizations. But anyways, here goes... My reply is: the bugs aren't very similar, there are fewer, and they are handled better. I find it suprising that whenever a new Mozilla security issues is discovered, a certain % of Slashdot members always suggests the same argument as this article: it's the same crap as IE, but it has less exposure. I'm not going to use the Apache vs IIS example, I assume you've read it on the way down to this comment. Have you ever written code? Mozilla is software written by humans. Complicated software will always produce unexpected interactions of components. Bugs are inevitable. BUT: 1. How many bugs? 2. How long does it take to fix the bug? Look at the turnaround time. 3. Are you sure the bugs are fixed? Consider transparency. Were you kept in the dark? Did you not have access to the bug database? Were you not able to see first-hand the diff for the fix and verify independently that it was fixed soundly? 4. What type of bug? Is there a buffer overflow issue every two damn weeks? Most of the Mozilla security issues I've seen are high-level issues (XUL, tabbed browsing, shell://). It's not that the coder didn't pay enough attention or didn't dedicate himself body mind and soul to writing secure code, it's that these exploits are just clever ways of messing up software that most developers wouldn't think of. I believe these types of bugs are inevitable. Careful re-design could minimize them. Basically, I'm trying to say that bugs are a fact of life in software development whether closed or open source. Half-assed focus on security isn't.

    3. Re:I would agree with TFA if not for one thing.... by Anonymous Coward · · Score: 0

      IIRC, there was a problem of using the GDI+ DLL under windows, which was mostly misplaced trust, no?

    4. Re:I would agree with TFA if not for one thing.... by abertoll · · Score: 1

      I would agree with TFA if the author were comparing Internet Explorer 4 with, let's say, Netscape 6 or Opera 7. If he were, then I would whole-heartedly agree that IE is a victim of its own popularity and that software monocolture is an "evolutionary" reality mirrored in biological systems.

      Although I do agree with what you're saying in your post... I think one thing people need to consider is the fact that the average user may still be using IE 4, which spreads this problem. I mean tech savvy people update their systems, while in general the public does not. (How many people would still be using Windows 98 even if XP WAS free?)
      --
      "he drew his sword Ringil that glittered like ice... and he wounded Morgoth with seven wounds..."
  30. He makes good points.. by d_jedi · · Score: 1

    That's not to say all of the security problems in software are the "fault" of C++ (if you're careful, you can use it securely), but the runtime checks that C++ neglects in favour of execution efficiency certainly play a large part. I would expect C/C++ (in it's current form) dies off as the dominant language of software development within the next 5-10 years because the additional execution efficency will become less and less significant with hardware improvements.

    --
    I am the maverick of Slashdot
    1. Re:He makes good points.. by Anonymous Coward · · Score: 1, Insightful

      I would expect C/C++ (in it's current form) dies off as the dominant language of software development within the next 5-10 years because the additional execution efficency will become less and less significant with hardware improvements.

      We've been hearing this for years now. Unfortunately, computers will never be "fast enough" where speed no longer matters. Games will always push as many polygons as possible, and when they have so many that you can't tell the difference, they'll up the resolution and start again. Emulators will always aim for higher and higher targets (look at PearPC, for example. Can that take a large performance hit for security?). Cryptography tools and video / audio codecs will also need to push higher and higher bitrates through. Point being: there will always be a need for c/c++, and even assembly. It's just that now, it's less likely neccesary for that text editor you're working on, or that picture viewer.
      I do, however, agree that with time (a lot longer than 5-10 years), the majority of applications that do not need cutting edge speed will be written in different languages. Much like what happened to x86 assembly during the past 10 years or so.

  31. Makes Sense by Fringex · · Score: 3, Funny

    Being the most popular always came with negativity. Honestly, why would anyone care about writing virii, worms and other means of computer assault on Linux. It fills an extremely small gap in the number of consumer desktops used worldwide. It is more fun to hash the Big Redmond Giant.

    You don't make something opensource if you wanna make money. That is a straight up fact. Have there been successes? Oh yeah, there have been plenty. If you wanna make the big bucks you keep it in house so no one can profit off your work. However, your company can't make money if you are continuously working on a product and not selling it. So does Microsoft release buggy code? Yeah.

    It is a matter of money. Bill Gates didn't start Microsoft because he wanted to touch lives, he made the company to make money. That is the general reason anyone starts a company. Dollar signs.

    So you have deadlines. A good example is the rush developement and release of EQ2. Hell you can even compare it to any EQ expansion. Full of bugs, exploits, instability, etc. Why? Money. You don't make money programming to make it perfect. You make money by having a product good enough that people will use it. Why else has EQ maintained a stable subscription base over five years. Granted there have been jumps in either direction but it has been stable enough to open more servers.

    Expansions like Gates of Discord, Luclin, Omens of War and Planes of Power all had more than their fair share of bugs. Money is the underlying issue. The expansions were good enough to release but not solid.

    The same can be said for Microsoft. Windows is good enough but can always be fixed through patches. If they are gonna keep it in house forever, then they will never make money.

    1. Re:Makes Sense by mccalli · · Score: 1
      You don't make something opensource if you wanna make money. That is a straight up fact...If you wanna make the big bucks you keep it in house so no one can profit off your work.

      I'll mention it to IBM.

      Cheers,
      Ian
      (yes, I know they make money from services. As an independent contractor, I compete against them for one thing...)

    2. Re:Makes Sense by zpok · · Score: 1

      How can this be modded funny?

      Insightful, or simply "truthful" would make sense, but funny? As in sarcastic maybe, but what the poster says is plain and simple truth, no one at MS or any other corporation would deny it.

      BTW it only is shameless if you don't at least try a leeetle bit to be better than average. I've been told MS actually makes good developer tools. Maybe it's there that they find redemtion for all the crap they inflict on unthinking customers or hapless office victims of Office?

      --
      I think, therefore I am...I think.
    3. Re:Makes Sense by Fringex · · Score: 1

      Take Apple for example. They used the Mach 3 Kernel which if I am not mistaken is Open to the public. I even remember them offering it to download and such. However, what is important is what they kept in house. The whole rest of the OS pretty much. Sure the Kernel is available but the good stuff is all closed. I am not saying you can't make money off OpenSource. What I am saying is that if you really wanna make money off OpenSource you gotta keep half in the Open and half to yourself.

  32. Crisy underflow? by Doc+Ruby · · Score: 1

    Microsoft's got billions of dollars and thousands of developers, in a market where there are many thousands more developers looking for jobs. Why don't they write a tool that search/replaces C/C++ source code for buffer allocations and replaces them with calls to a class or struct with bounds checking? It's not a trivial problem, but if they put their money where their mouth is, their pledge to prioritize security would match this whining about C/C++ buffer bugs. Unless their agenda is merely to herd everyone into programming C#, at the expense of the massive losses while legacy C/C++ code is still in vogue.

    --

    --
    make install -not war

    1. Re:Crisy underflow? by MikeBabcock · · Score: 1

      Is longhorn being written in C#? :-)

      --
      - Michael T. Babcock (Yes, I blog)
  33. The problem with the "king of the hill" scenario.. by mark-t · · Score: 2, Insightful
    Is that it doesn't really work.

    The claim is that windows gets attacked so much because it's the most popular... but consider the following:

    Look at the different web servers in the world, and look at what percentage of them run Microsoft's webserver and what percentage of them run another system.

    Now take a wild guess which webserver actually has the greatest number of exploits for it floating around. Anyone who pays any attention at all to their access logs on their webserver will tell you they get almost insane numbers of IIS exploit attempts on their webservers each and every day.

    But Microsoft doesn't have the marketshare in the web server market to justify the disproportional number of attacks it gets, yet it's _CLEARLY_ in the lead for being attacked.

    Conclusion: Microsoft's view that they are being "picked on" because they are in the lead is false. They are being picked on because they are highly accessible target that develops software that is easy to exploit, and Microsoft is simply too stubborn to admit that it has a real problem, insted amounting to blaming it on something resembling "jealousy".

  34. unpriveliged user by Anonymous Coward · · Score: 0

    Then run your IIS as an unpreveliged user. Windows allows you that flexibility.

  35. Summarizing, then... by nigham · · Score: 4, Informative

    C/C++ as a language has bugs.
    Actually, any program has bugs.
    IE and Firefox are both programs written in C/C++.

    Therefore,
    1. What is wrong with IE is wrong with Firefox
    2. The quality of coding is mostly irrelevant to the quality of a program, it being mostly dependent (inversely) on how many people use it.
    3. If Firefox gains market share, it will have bugs! It has to! You'll see!!

    Listen to little brother crying...

    --
    I don't want to read /. I want to go home and re-think my life.
    1. Re:Summarizing, then... by man_ls · · Score: 1

      Firefox has retarded bugs, at that.

      Download counters wrap around and go negative, time starts counting backwards or at a negative interval...then the time eventually reaches 0 from the other side, some kind of Divide by 0 error occurs, and the browser crashes with a "403 could not write network stream" little popup message.

      (I've replicated that behavior about 5 times downloading >4GB ISO images of Fedora Core 2 and associated Linux OSes.)

    2. Re:Summarizing, then... by marsu_k · · Score: 1

      Why on earth would one want to download >4GB ISOs with a browser? I'm not questioning what you are saying as I've never tried to do such a thing with Firefox, but really, what's the point? Why not wget it?

    3. Re:Summarizing, then... by dmaxwell · · Score: 1

      >4GB single file downloads are an atypical use case for most people. Did you at least file a bugreport?

    4. Re:Summarizing, then... by tepples · · Score: 1

      Why not wget it?

      Because people don't know that a Wget or a GUI frontend exists.

      Because many servers block Wget as a DOS tool.

    5. Re:Summarizing, then... by PitaBred · · Score: 1

      Wget will report itself as whatever browser you want it to. It's an option. man wget.

  36. Sure, blame C and C++ by Sivar · · Score: 4, Insightful
    "...and he notes that the problem is largely with C/C++ and mostly because of the buffer overflow problems."

    OpenBSD and OpenVMS are written in C. Qmail and djbdns are written in C.
    Is it difficult to prevent buffer overflows? If you are reading a string, either use a string class, or read only as many characters as the character array can store. (What a novel idea!) If you are writing a string, among other things, set the last possible character of that string to null, just in case.
    These are but single simplified examples, but it is not impossible by any means, or even all that difficult, to write solid code.
    Among other things, the problem is that it takes individual effort to make sure every static-sized buffer isn't abused. As Murphy would tell you, human error is bound to crop up--increasingly so as the complexity of the project increases. I believe there was a post on the formula for this not too long ago.

    As to the solution, well, that's a tough one. Higher level languages (Java, C#) help reduce these problems (and help reduce performance as well), but are just a band-aid. Perhaps the Manhattan Project (no, not that one) will come up with something better.

    Until then, try to avoid products which have proven themselves to be full of holes year after year, week after week. And no, this doesn't just include all Microsoft server software. BIND and Sendmail come to mind.
    --
    Computer Science is no more about computers than astronomy is about telescopes. --E. W. Dijkstra
    1. Re:Sure, blame C and C++ by Anonymous Coward · · Score: 0
      .. and OpenVMS are written in C.


      Uh, one of the languages is C, yes.

      Qmail and djbdns are written in C.


      So you've found one guy producing safe code? Ok, no need to comment that one.
    2. Re:Sure, blame C and C++ by Anonymous Coward · · Score: 0

      Well. I think you're entirely right. If you were working for MS, I'm sure all of their problems would be solved.

      I'm not sure why so many people can sit back and say they can do better than a company. (And don't say that it's because it has been proven through successful open source projects. If you like open source software, use it and find something else to complain about.)

    3. Re:Sure, blame C and C++ by MikeBabcock · · Score: 1

      In the glib library, there are even nice little helper functions that allow copying and concatenating strings while allocating the necessary memory (in C) like a string class would for C++.

      string2 = g_strdup_printf("blah %s blah %d", a, b);

      (drawing a blank on function names; sorry) ... wherein string2 is allocated to be the correct size to store the resulting string instead of guessing in advance.

      djb uses a similar tool in his applications (qmail, djbdns, etc.) called stralloc and it works very well for avoiding these memory issues.

      For the sake of performance, you may wish to use a malloc implementation that's good at handling many small allocations, mind you.

      --
      - Michael T. Babcock (Yes, I blog)
    4. Re:Sure, blame C and C++ by jonastullus · · Score: 2, Insightful

      OpenBSD and OpenVMS are written in C. Qmail and djbdns are written in C.

      *oh*, come on now! qmail and djbdns are so limited in scope and LOC and were actually written with the sole purpose of being secure... that's comparing apples and oranges!
      of course you CAN write secure code in C. but at what COST?? is it really good to use a low-level language that was written with operating systems in mind for highly abstract software that doesn't need the 5/10/15 percent gain of performance??
      shouldn't programmers rather concentrate on solving the problem in the most straightforward way conceivable and without having to worry about how to pass arrays, who is responsible for freeing variables and which of the 100 ways to copy a string is suitable??? why be so masochistic to use C/C++ when you could use some real high-level language?
      (note: i am writing c++ myself at the moment, but that is out of necessity not because i chose to!)

      Is it difficult to prevent buffer overflows?

      YES!

      read only as many characters as the character array can store. (What a novel idea!)

      someFunc(char *str)
      {
      char *copyOfString = (char*) malloc(sizeof(char) * (strlen(str) + 1));
      strncpy(copyOfString, str, strlen(str)); /* something else using the copy destructibly */
      }

      in that case the strncpy is just BOGUS!! if the incoming string were actually null-terminated, the strncpy would not be neccessary and otherwise the strlen won't work! of course the above example is really dumb, but should you really have to think about copying a string (or even worse, need years of experience for this kind of thing)?

      If you are writing a string, among other things, set the last possible character of that string to null, just in case.

      YOU ARE SUCH A JOKER!!! how exactly are you going to find the last character if the string isn't null-terminated. and even if you calloc all your arrays, there will still be some bogus data in your string which could do quite some harm! it won't be a buffer overflow but surely some very weird behavior!


      Among other things, the problem is that it takes individual effort to make sure every static-sized buffer isn't abused.


      yes, true. but if strings were simply managed by adding the string length to the data type, much of the confusion would be ended! surely, many string data types do this, but for some reason they just aren't used!!! still, the main problem lies in C just being too low-level for the kind of abstract problems that are commonly solved with C++! it's just not the right language for the job!

      jethr0

    5. Re:Sure, blame C and C++ by runderwo · · Score: 1
      why be so masochistic to use C/C++ when you could use some real high-level language?
      Because frequently it's the right tool for the job. Such as a lot of things, when you leave apparently religious preferences out of the debate.
      Is it difficult to prevent buffer overflows? YES!
      For inexperienced C (or likewise, assembly) programmers, you are correct. Perhaps those people should not be producing software in C that needs to be secure.
      in that case the strncpy is just BOGUS!!
      Your example is bogus. Not everything stored in a C array is a string, and anyway, using strncpy (and then setting strlen(str)-1 to '\0' prevents any problem with that code assuming the array was null terminated in the first place.
      how exactly are you going to find the last character if the string isn't null-terminated.
      There's no such thing as a C string that isn't null-terminated. Once the null terminator has been lost, the data stored in the array is no longer a C string. It follows that if you want your array to remain a valid string, you had best preserve the null terminator.
      but if strings were simply managed by adding the string length to the data type
      You are free to write your own string struct/class that does this. In fact there are quite a few that exist already. You have the choice not to use C strings, so it seems ridiculous for you to continue to use them when you have demonstrated that they are beyond your capability.
      it's just not the right language for the job!
      How do you know that? What is the job? Or are you just generalizing?
    6. Re:Sure, blame C and C++ by jonastullus · · Score: 1

      Because frequently it's the right tool for the job. Such as a lot of things, when you leave apparently religious preferences out of the debate.

      full ack! C has its place as a language, but the predominance of C++ in application development stands in no proportion to its suitability for most high-level problems.

      For inexperienced C (or likewise, assembly) programmers, you are correct. Perhaps those people should not be producing software in C that needs to be secure.

      GREAT, so people will write insecure code in C until some day they are experienced enough to use it safely! if road traffic were managed like this i wouldn't dare leave my home!

      Your example is bogus

      AS i wrote myself. but you don't always have control over where you get your "strings" from and have no way of knowing whether they are actually null-terminated. and THAT is a bad thing in itself!

      Once the null terminator has been lost, the data stored in the array is no longer a C string.

      *whuppdidu*. so you NEVER allocated a string one short, i assume. maybe you are even infallible!
      the point of high-level programming languages is to reduce the binding between your machine and your programs and to offer a sane standard library which will allow you to write acceptable code with a few months!
      the arcane syntax-tricks and the not-so-suppreme standard library (see "gets", "strcpy", ...) together with manual memory management make C a very powerfull and often well-performing tool, which will just as well might cause you serious harm the next moment!
      i am not at all against C as such! it is a marvelous step away from machine-dependant assembly code and just the right (well, hopefully ;-) tool for operating systems and small system utilities. it may also be quite suitable for many huge software projects, but the fact of the matter is, that it takes you such a long time to learn all its hidden traps, that I don't see it as the suitable standard language for your average problem.

      You have the choice not to use C strings, so it seems ridiculous for you to continue to use them when you have demonstrated that they are beyond your capability.

      how can you be so arrogant?? "beyond my capability"!!!
      even if you had never had any problems with C char pointers, it would be rude to tell me about my capabilities and abilities with such an attitude. but i don't even think that you never made a mistake using them, so you better show some humility!

      yes, alternatives are available, although not in the standard library of C (which is a strong shortcoming) and even if you are using the C++ string class, you won't be able to avoid all the syscalls involving C char pointers! (for example: using ostream::write will require you to use char pointers!)

      How do you know that? What is the job? Or are you just generalizing?

      okay, that was a bit of a generalization. but from the above it should be clear what i meant to say!
      please be a little humbler before accusing others of being incapable of using some arcane and dangerous technique.

      jethr0

    7. Re:Sure, blame C and C++ by DunbarTheInept · · Score: 1

      is it really good to use a low-level language that was written with operating systems in mind for highly abstract software that doesn't need the 5/10/15 percent gain of performance??

      When the real world starts having examples of languages that solve these problems with only an additional overhead of 10-15% in memory and runtime versus C, your comment will start making some sense.

      (However, it is true that for many user-level applications, the extra wasted resources aren't worth worrying about. But for the kinds of code being talked about here, that are part of the OS, I want all the efficiency I can have. I want as much of the resources going to the userland programs, and as little going to the OS, as is possible.)

      The simple solution is to use C but then use a string library for the user-input. There's no reason you can't use a C++ basic_string from the STL for reading user input, and then drop it down to a C null-terminated string for processing.


      YOU ARE SUCH A JOKER!!! how exactly are you going to find the last character if the string isn't null-terminated.

      I'm not the one you replied to, but here's your answer anyway:
      // assuming "str" is a string of unknown length,
      // and "buf2" is declared like so:
      buf = calloc( N, sizeof(char) );

      // Then strncpy str into buf like so:
      strncpy( buf, str, N-1 );
      buf[N-1] = '\0';
      That is what the poster was talking about. If your fixed-size string holds N chars, you're not SUPPOSED to be reading N characters into it. You're supposed to read N-1 characters into it and null-terminate the last character.

      (But better yet, just use strdup() which allocs and copies the string as one operation, and you don't need to bother with pre-allocating the size. Oh, that's right. You don't think easy solutions like that exist in C.)

      If you're going to make a point, try doing it like an adult.

      --

      Don't label something "offtopic" unless you know the topic well enough to tell what's on topic.

    8. Re:Sure, blame C and C++ by runderwo · · Score: 1
      the predominance of C++ in application development stands in no proportion to its suitability for most high-level problems.
      I fail to see a character string issue that cannot be solved with a wrapper class or a smart pointer.
      GREAT, so people will write insecure code in C until some day they are experienced enough to use it safely!
      Exactly. And until they have demonstrated their competency, their code should not be used in security-critical environments.
      *whuppdidu*. so you NEVER allocated a string one short, i assume. maybe you are even infallible!
      Of course I have, and I also don't place non-debugged and/or unaudited code into a production environment. I guess others have lower standards, but they get what's coming to them. You can make very insidious mistakes in high level languages too.
      the point of high-level programming languages is to reduce the binding between your machine and your programs and to offer a sane standard library which will allow you to write acceptable code with a few months!
      Quite. However, "high-level programming" is all relative. C is high-level compared to assembly. The C standard library provides functions such as snprintf, fgets, and strncpy which are usually suitably safe. If those functions cramp your style, use something like glib instead.
      it takes you such a long time to learn all its hidden traps
      Please elaborate. Perhaps instead of traps, you meant unfamiliar nuances. That's not a euphemism unless you regard the language as hostile, which is a ludicrous notion. C just exists. You either know how to use it or you don't. Petulance and indignation do not substitute for learning.
      that I don't see it as the suitable standard language for your average problem.
      Right. So who was claiming that C was the right tool for the average problem? The frequent ill-informed argument from CS 101 types is that C is the wrong tool for any problem and that {Java|PHP|Python} is the universally correct tool.
      how can you be so arrogant?? "beyond my capability"!!!
      You used a specious argument to support your general claim that C is useless because there is no native string type. I supposed that this was something that you had encountered, and instead of learning something from your mistake, decided to bash the language; that is a common reaction by frustrated people new to C.
      but i don't even think that you never made a mistake using them, so you better show some humility!
      Exactly how am I displaying arrogance? Of course I have made mistakes with pointers as I learned the language. I don't make them any more, and that's because I recognized their utility and learned how to use them properly rather than blaming the language.
      to avoid all the syscalls involving C char pointers! (for example: using ostream::write will require you to use char pointers!
      And what would be your solution to this? Introduce an opaque string type into the kernel interface alongside the existing read/write functions?
      please be a little humbler before accusing others of being incapable of using some arcane and dangerous technique
      I think you are reading emotions into my words that are not there. I find nothing arcane or dangerous about C strings at the hands of a competent programmer, no more than I find a loaded gun in the hands of a responsible and trained person dangerous.

      There is a rather salient argument against people new and inexperienced with C writing code that is accessible from outside a particular machine, so let's leave the conclusion at that: C newbies should not be writing networked code; and not try to extend that conclusion to say that C is invariably a munition waiting to explode no matter who is writing the code.

    9. Re:Sure, blame C and C++ by jonastullus · · Score: 2, Insightful

      When the real world starts having examples of languages that solve these problems with only an additional overhead of 10-15% in memory and runtime versus C, your comment will start making some sense.

      i know you will just shrug this off, but well-performing solutions to all kinds of problems were written in CAML, lisp, haskell, to some extent java, ...
      claiming that "safe" languages have a performance hit of more than 15% is just wrong! for memory usage i partly agree, but then how could anything on earth use more memory than microsoft windows ;-)). it is not just a coincidence that many companies have come to adopt java, as it allows safer software (no memory leaks, no dangerous pointer arithmetic, no reference/pointer duality) and for large programs the overhead of the java runtime environment has proven not to be the problem!

      But for the kinds of code being talked about here, that are part of the OS, I want all the efficiency I can have.

      how exactly are the internet explorer and the netscape/mozilla supposed to be part of the OS or really performance critical??

      There's no reason you can't use a C++ basic_string from the STL for reading user input, and then drop it down to a C null-terminated string for processing.

      i didn't say C can't be used to solve problems or that C is incapable of producing secure/safe software. but why go to the lengths of this kind of workaround, when there are viable alternative languages available. (apart from the fact, that the software industry should put a lot more effort in creating such viable alternatives!)

      If your fixed-size string holds N chars, you're not SUPPOSED to be reading N characters into it. You're supposed to read N-1 characters into it and null-terminate the last character.

      yup sorry for that typo/thinko, but that's just one of the things i am saying! the idiom of allocating and strcpy'ing is widely used (falsely, of course), but it still is! and being able to make 5 or more errors through minor typos for such a trivial thing as string copying is not really acceptable (for most applications).

      my point was (formulated badly i admit) that you often get char pointer from elsewhere and have no idea whether the "string" you just got is actually null-terminated or not! ONE glitch and you'll never recover again and overwrite some memory instead!
      the glitch might occur in somebody elses code or in a library, but there is no way of knowing and THAT is a bad foundation for robust software!

      Oh, that's right. You don't think easy solutions like that exist in C.

      If you're going to make a point, try doing it like an adult.


      i seem to have created a lot more animosity than intended. i really gotta work on not coming about as a total jack-ass, but i really can't understand why you are protecting C/C++ as a general purpose language.
      of course stringent coding practices make many problems go away, but the level of detail (as far as i see it) is too low to be able to concentrate on bigger issues! i have no problem at all with writing C-code when it is appropriate. but C++ being used by all kinds of non-masters of the language is pretty much a time-bomb!

      <SARCASM>
      premature optimisation is supposed to be bad, but let's all just do without array bounds checking and generic variable initialisation because we are going to safe SOOO much time doing this!
      oh, and let's also not use function calls because they have a performance penalty and instead write one monolithic piece of code!!!
      </SARCASM>

      we should be concentrating on solving the problems not how to avert shooting ourselves in the foot with the language we are using. why not develop in a "slow" and clean language and then optimise those bottlenecks that remain?? obviously i am not talking about system call implementations, but with our multi-GHz machines shouldn't we focus more on robust software that is developed more painlessly instead of going about programming as if we were toggling the operating system in in octal?

      my apologies if i have been a jack-ass. as i said, i am going to work on that!

      jethr0

    10. Re:Sure, blame C and C++ by DunbarTheInept · · Score: 1


      claiming that "safe" languages have a performance hit of more than 15% is just wrong!

      I repeatedly hear claims of this, but it doesn't seem like it in practice. I find it really hard to believe. In an optimized test that doesn't excercise the problem areas much, I could see a hit of only 15%, but that would have to be a program that just prints out strings, and maybe does some math. But in practice a real program is going to contain lots of data structure manipulations, and that's where the performance hit is (and that's the main point of using a 'safer' language, too.)


      and being able to make 5 or more errors through minor typos for such a trivial thing as string copying is not really acceptable (for most applications).

      But I am of the opinion that a programmer that makes those errors that often should not be writing my operating system's core programs (e-mail server, web server, etc). I *want* a programmer for whom bit-twiddling and memory tricks is second nature. If you can't keep strncpy() straight, then I don't want you writing TCP/IP socket code, or writing programs that fork() and have to avoid zombies or any of that sort of thing. These programs aren't entirely OS, and aren't entirely application. They sit at the bridge between them.

      Now, that being said, I *would* be in favor of writing the code in a stratified approach, where the OS interaction is in C, but the higher-level stuff is in something else. (For example, a web server should have the TCP/IP, and threading, and resource management engine stuff in C, but the HTTP syntax parser can be written in something more high-level.)


      you often get char pointer from elsewhere and have no idea whether the "string" you just got is actually null-terminated or not!

      Then you are using an undocumented call, just as much as if the documentation had forgotten to tell you the return type, or forgotten to tell you if a variable was pass-by-value or pass-by-reference. Not once have I encountered this problem with the stuff in stdlib. The manpage documentation for every function call that deals with strings is very explicit about null termination.


      with our multi-GHz machines shouldn't we focus more on robust software that is developed more painlessly

      No. Not at all. When I pay Intel a pile of cash to buy a faster chip, I want that cash to buy me faster programs. There is no such thing as "fast enough". For example, if the computer gets fast enough to render a realtime 3d animation at 30 fps, and still have plenty of cycles to space, then great - that means there's now an opportunity to use that extra clock time to add more details to the scene, or perhaps render more than one scene at a time.

      There is no limit beyond which the speed no longer matters. It always matters.

      --

      Don't label something "offtopic" unless you know the topic well enough to tell what's on topic.

    11. Re:Sure, blame C and C++ by brpr · · Score: 1

      I repeatedly hear claims of this, but it doesn't seem like it in practice. I find it really hard to believe. In an optimized test that doesn't excercise the problem areas much, I could see a hit of only 15%, but that would have to be a program that just prints out strings, and maybe does some math. But in practice a real program is going to contain lots of data structure manipulations, and that's where the performance hit is (and that's the main point of using a 'safer' language, too.)

      Just because you find it hard to believe doesn't mean it isn't true. There are plenty of very high level languages (e.g. O'Caml) that have no more overhead in manipulating data structures than C does. O'Caml does (verifiably) have performance comparable to C.

      But I am of the opinion that a programmer that makes those errors that often should not be writing my operating system's core programs (e-mail server, web server, etc). I *want* a programmer for whom bit-twiddling and memory tricks is second nature. If you can't keep strncpy() straight, then I don't want you writing TCP/IP socket code, or writing programs that fork() and have to avoid zombies or any of that sort of thing. These programs aren't entirely OS, and aren't entirely application. They sit at the bridge between them.

      In other words "if you're a good programmer, you will never make trivial mistakes". Bullshit.

      Then you are using an undocumented call, just as much as if the documentation had forgotten to tell you the return type, or forgotten to tell you if a variable was pass-by-value or pass-by-reference. Not once have I encountered this problem with the stuff in stdlib. The manpage documentation for every function call that deals with strings is very explicit about null termination.

      Ah, but what if there's a bug in the library? In C, you depend not only on the correctness of your own memory management code, but also on that of any library which you use.

      No. Not at all. When I pay Intel a pile of cash to buy a faster chip, I want that cash to buy me faster programs. There is no such thing as "fast enough". For example, if the computer gets fast enough to render a realtime 3d animation at 30 fps, and still have plenty of cycles to space, then great - that means there's now an opportunity to use that extra clock time to add more details to the scene, or perhaps render more than one scene at a time.

      Of course there's such a thing as fast enough. My email client and web browser have been running fast enough for years. Now I'd rather have an (unnoticable) 20% performance decrease than have them crash every few days.

      Note that there's also no such thing as "clever enough". If you want to write a smart program, it's easier to do it in a high level language.

      --
      Freedom is not increased by mere diminuation of government. Anarchy is freedom for the strong and slavery for the weak.
    12. Re:Sure, blame C and C++ by DunbarTheInept · · Score: 1


      Just because you find it hard to believe doesn't mean it isn't true. There are plenty of very high level languages (e.g. O'Caml) that have no more overhead in manipulating data structures than C does. O'Caml does (verifiably) have performance comparable to C.

      Provide a link to this proof.


      Ah, but what if there's a bug in the library? In C, you depend not only on the correctness of your own memory management code, but also on that of any library which you use.

      True. But since this is also true of every other language, this isn't relevant to your point. (If you think high-level languages never end up dropping down to doing things in a low-level C way inside their libraries, you are kidding yourself. Eventually every program talks to the OS at some point, even if it's just in the libraries, and that's going to mean the libraries will have C calls in them.)


      In other words "if you're a good programmer, you will never make trivial mistakes". Bullshit.

      I agree that that statement is bullshit. Your claim that it is a summary of what I said, however, is also bullshit.


      Of course there's such a thing as fast enough. My email client and web browser have been running fast enough for years.

      If that's all you want to use your computer for, then don't waste your money on a faster computer. For those who do want more speed, stop dictating that they must waste it on needs which are already served by cheaper hardware.

      --

      Don't label something "offtopic" unless you know the topic well enough to tell what's on topic.

    13. Re:Sure, blame C and C++ by brpr · · Score: 1

      Provide a link to this proof.

      You could take a look at the great computer language shootout. It's also a pretty general consensus wrt O'Caml, and not in the least bit surprising because O'Caml's high level features are mostly related to its type/module system, rather than to automagical features (such as you tend to find in scripting languages, etc.) As far as closeness to the hardware is concerned, basically all that distinguishes O'Caml and C is that O'Caml is GC'd. This doesn't create much of a performance hit, as the benchmarks show. O'Caml is also a better candidate for optimisation than C because it doesn't have so many pointer issues (pointer aliasing, etc.)

      True. But since this is also true of every other language, this isn't relevant to your point. (If you think high-level languages never end up dropping down to doing things in a low-level C way inside their libraries, you are kidding yourself. Eventually every program talks to the OS at some point, even if it's just in the libraries, and that's going to mean the libraries will have C calls in them.)

      Only if the OS is written in C. You're correct that since most popular OSs are written in C, it's pratically impossible to write safe string manipulation code (and lots of other kinds of code, natch), in any language unless you trust the kernel code very strongly. This is just one more black mark against C, so far as I can see.

      I agree that that statement is bullshit. Your claim that it is a summary of what I said, however, is also bullshit.

      You implied that a programmer who was good enough to do [various complex coding tasks] could be trusted not to make errors in simple string manipulation code. Erm, bullshit. If you do in fact believe that any coder, however good, is capable of writing buggy string manipulation code, then the argument that C is safe if you know how to use it properly doesn't go through, i.e. there would still be a class of bugs which a grade A programmer could make in C that they couldn't make in (say) Java. Being unable to know for sure the length of any array created by untrusted code would be one example.

      If that's all you want to use your computer for, then don't waste your money on a faster computer. For those who do want more speed, stop dictating that they must waste it on needs which are already served by cheaper hardware.

      1) It's not all I want to do, but you did not qualify your statement that "there is no such thing as fast enough". As a point of fact, there is such a thing as fast enough for many, many applications which currently tend to be written in C/C++.

      2) I wasn't dictating anything.

      --
      Freedom is not increased by mere diminuation of government. Anarchy is freedom for the strong and slavery for the weak.
    14. Re:Sure, blame C and C++ by DunbarTheInept · · Score: 1


      As far as closeness to the hardware is concerned, basically all that distinguishes O'Caml and C is that O'Caml is GC'd.

      Then I'll have to check it out. It sounds useful (I like GC, but hate a lot of other features of high level languages, and I do recognize that despite the bad rep it has, that GC is not the cause of the slowness of high level languages - that's a bad rep dating back to lisp machines that had really slow GC implementations). But, I still have to wonder about this: You claim O'Caml is just as close to the hardware as C except for having GC, but then went on to say that it doesn't have the pointer issues of C. Those are incompatable statements. You need pointers to be close to the hardware. Imagine trying to write a kernel in a language that doesn't let you move chunks of memory around as you wish. (I'm not denying that it sounds like a good language. I'm denying that it could ever be a drop-in replacement for C, used for the same tasks.)

      You're correct that since most popular OSs are written in C, it's pratically impossible to write safe string manipulation code (and lots of other kinds of code, natch), in any language unless you trust the kernel code very strongly. This is just one more black mark against C, so far as I can see.

      This is a non-problem, because if you don't trust the kernel code that strongly, you've got much, much bigger problems than this to deal with, such that arguments over string libraries in languages become piddly and irrelevant if you can't even trust that the kernel is managing your program's memory correctly, for example. This has nothing to do with C. Even if the kernel was written in something else it would still have to be a language that allows for memory twiddling because that's what the kernel DOES. It's very goal is inherently dangerous memory twiddling type of activity - scheduling traps for the CPU to interrupt itself and let the scheduler move programs about in memory, that sort of thing. In other words, the language chosen is not the cause of the fact that you have to trust the kernel developers to be good at memory twiddling. The task they are trying to do is the cause of that. C was chosen becaues it happens to be designed to be good at that task.

      It's not that "Choosing C causes the kernel to do dangerous memory twiddling." It's "Having to do dangerous memory twiddling causes the kernel to be written in C."

      And eventually everything becomes machine language, and that is where the unsafe untrustworthiness is at. So if you write an OS in a high-level language, you aren't removing the "have to trust something you didn't write" problem - you're just moving it to the language compiler's author instead of the kernel writer's author.


      If you do in fact believe that any coder, however good, is capable of writing buggy string manipulation code, then the argument that C is safe if you know how to use it properly doesn't go through,

      It's good that this isn't my argument, then. I don't have to believe that C is perfectly safe in order to deny your claim that C is unsafe so you should use something else. There *IS* a middle-ground between the two.


      there is such a thing as fast enough for many, many applications which currently tend to be written in C/C++.

      I invite you to re-read what I already wrote. I did say already that I favor a stratification of code such that the high-level code is in a high-level language and only the OS-interaction is in C. It's just that even things like web browsers still have to have OS interaction code in them.

      Something like a web browser should probably have only about 10-20% of the code being in C. You're advocating for 0%, and all that does is push the problem down to another layer (a library). That doesn't get rid of it. You spend all this energy bitching about having to trust the kernel code, yet are perfectly willing to trust the library code that goes along with your high-level languages, which has the same sort of problem potential. This is not a consistent attitude.


      2) I wasn't dictating anything.

      Except for that whole insisting that programmers should stop using C thing you were doing, yes.

      --

      Don't label something "offtopic" unless you know the topic well enough to tell what's on topic.

    15. Re:Sure, blame C and C++ by brpr · · Score: 1

      But, I still have to wonder about this: You claim O'Caml is just as close to the hardware as C except for having GC, but then went on to say that it doesn't have the pointer issues of C. Those are incompatable statements. You need pointers to be close to the hardware. Imagine trying to write a kernel in a language that doesn't let you move chunks of memory around as you wish. (I'm not denying that it sounds like a good language. I'm denying that it could ever be a drop-in replacement for C, used for the same tasks.)

      Not sure I agree. Virtually all the sensible things you can do with pointers you can do with arrays and references (by which I mean pointers without pointer arithmetic). If you're writing an OS kernel and need to do some non-sensible things, then you're going to be writing some ASM anyway, and it wouldn't be hard to hack up an O'Caml interface to pointers if you really needed it (assuming O'Caml can be linked with ASM fairly easily -- never tried to do this). In any case, the notion that C pointers are some direct representation of actual hardware pointers is a bit of a myth, since they abstract away from segmentation/paging and so on. The things which you can do with pointers while remaining within the behaviour defined by the C standard are basically exactly the same things you can do with arrays, iterators and references. If you want to do something more, then you may just as well use OCaml-with-extended-semantics as C-with-extended-semantics, given that hacking up the extended semantics will be trivial compared to writing a kernel, or whatever.

      Kernel's are admittedly a special case, and even I think that you can make good arguments for writing them in C ;) The trouble is that C has a tendency to percolate up the levels of the OS. One minute you have a kernel written in C, the next you have a web browser written in C which depends upon layers and layers of C code, with thousands of lines of manual buffer management code, all of which is potentially buggy.

      I don't have any particular brief for O'Caml btw, I could have said the same things about a decent Lisp implementation. And of course there's a bit more proof of concept in Lisp land what with Lisp machines, etc.

      This is a non-problem, because if you don't trust the kernel code that strongly, you've got much, much bigger problems than this to deal with, such that arguments over string libraries in languages become piddly and irrelevant if you can't even trust that the kernel is managing your program's memory correctly, for example.

      It's not entirely a non-problem. You could have a kernel which was perfect except for one bug involving a string buffer passed to a system call. Such a bug might be less serious if the kernel was not written in C. I'm not trying to say that this is a likely scenario, merely pointing out that it is not inevitable that any high-level language must trust tens of thousands of lines of low-level code to handle memory correctly. If you have a kernel in a high-level language, (many) string memory management problems could be localised to a few hundred/thousand lines of very heavily tested code. My argument is not that people should genuinely be worried about bugs in kernel functions most of the time, merely that having lots and lots of unsafe low-level code is not the only option.

      It's good that this isn't my argument, then. I don't have to believe that C is perfectly safe in order to deny your claim that C is unsafe so you should use something else. There *IS* a middle-ground between the two.

      Well, you keep telling me what your argument isn't but I (honestly) can't work out what it is. To stop this getting into a silly metadiscussion, I'll instead give my argument, which I think is relevant to your argument (whatever that is). However good you are, it is possible to write buggy C code which is buggy in ways unique to low-level languages. Therefore, it's likely that software written by equally good programmers

      --
      Freedom is not increased by mere diminuation of government. Anarchy is freedom for the strong and slavery for the weak.
    16. Re:Sure, blame C and C++ by DunbarTheInept · · Score: 1


      the notion that C pointers are some direct representation of actual hardware pointers is a bit of a myth, since they abstract away from segmentation/paging and so on.

      The C lanaguage does NOT do that. The OS does. If your program runs on top of an OS that does segmentation/paging and so on, then *ANY* such program, written in *ANY* language, is still going to be one level removed from the hardware due to segmentation/paging. It *must* be that way or else the OS has no memory protection. (Any OS that does segmentation or paging has to do so in a manner that will work on ANY generic program, written in ANY language, from shell scripts all the way down to machine-language.)

      But, if you're writing the OS kernel itself, then that's not true anymore - you *can* (and must) get down to pointers on raw hardware. It is entirely possible in C to have pointers to raw hardware addresses, if you are writing a program that is not running on top of a protected memory OS. (for example, a vending-machine embedded program, or the linux kernel itself).

      There is actually very little that has to be done in direct assembly code in the kernel. If you tried writing it in a higher level language that doesn't let you use pointers, there would have to be MORE assembly code.

      And that is the irony is that if you do what you suggest. Write the kernel in a high-level language and you end up with MORE dangerous code, not less, because despite how dangerous C can be with this stuff, assembly is much worse, and not using a middle-level language like C means even more stuff has to be done in a low-level language like assembly than is done that way now.


      Well, you keep telling me what your argument isn't but I (honestly) can't work out what it is.

      C is unsafe, yes. But that's becuase it manipulates memory exactly how you ask it to, and lets you shoot yourself in the foot. But that is not a sufficient reason to stop using it, because some tasks need to be approached that way, like writing a kernel, or passing byte buffers around as is often done in network programming.

      C is a middle-ground between assembly code and a high-level langauge. Until such middle-ground tasks for which it is optimal dissapear, there is still a need to have it around.

      --

      Don't label something "offtopic" unless you know the topic well enough to tell what's on topic.

    17. Re:Sure, blame C and C++ by brpr · · Score: 1

      The C lanaguage does NOT do that. The OS does. If your program runs on top of an OS that does segmentation/paging and so on, then *ANY* such program, written in *ANY* language, is still going to be one level removed from the hardware due to segmentation/paging. It *must* be that way or else the OS has no memory protection.

      The C language does do it. Pointers in C do not correspond directly to any hardware concept. It's true that if you're not writing kernel code, you are prevented to some extent by the OS from manipulating addresses at the hardware level, but it's still the case that C pointers have different semantics to hardware memory addresses. For example, a C pointer becomes invalid if it's incremented beyond the bounds of the block of allocated memory its pointing within, according to the ANSI standard, and C pointers abstract away from segmentation/paging/whatever. It is not possible to have direct access to any hardware features in a portable language -- there is necessarily a layer of abstraction.

      (Yes, C may be a little less abstract than other languages, see below for discussion of this...)

      But, if you're writing the OS kernel itself, then that's not true anymore - you *can* (and must) get down to pointers on raw hardware. It is entirely possible in C to have pointers to raw hardware addresses, if you are writing a program that is not running on top of a protected memory OS. (for example, a vending-machine embedded program, or the linux kernel itself).

      Yes, but those pointers still abstract away from details of the memory architecture somewhat because they're single numbers rather than segment-offset pairs (or whatever), and have less richly-defined semantics. I'm not saying that there's anything wrong with this, just stating it as a fact. If you want to do low-level pointer manipulation in C, you have to extend its semantics beyond those defined in the ANSI standard (by writing inline asm code, using extended pointer arithmetic semantics, etc.) As I said, the situation is no different with a higher level language -- you just extend the semantics of the language to cover low-level features of the hardware when necessary. Low-level access doesn't have to be built into a language any more than database querying does. C comes with a little bit more builtin capability in this regard, but the task of adding the necessary stuff to another language is completely trivial compared to the task of (say) writing an operating system. You basically just need a MemoryAddress abstract datatype and a few (inline) functions to manipulate it and interface pointers with arrays.

      C is unsafe, yes. But that's becuase it manipulates memory exactly how you ask it to, and lets you shoot yourself in the foot. But that is not a sufficient reason to stop using it, because some tasks need to be approached that way, like writing a kernel, or passing byte buffers around as is often done in network programming.

      C does not in any sense give you complete control over memory management. You can ask for a block of memory and reference elements within the block. You can pass pointers to elements within a block around. Most of the other stuff you can do leaves memory useage up to the compiler (e.g. the internal structure of unions is very loosly defined by the standard; the semantics of pointers are very constrained). Given that C is designed to be portable to just about any architecture (even a VM), it's obviously impossible for it to provide complete control over how memory is managed. Most people who think that they are getting low-level control from C are not in fact programming ANSI-standard C. You could get the same effect using non-standard Lisp or non-standard ML.

      As for the rest: only kernel code really needs to manpiulate memory directly, although there may be a few rare cases where you need to do this in userland; byte buffers can be passed around in most any language.

      C is a middle-ground between assembly code and a high-level

      --
      Freedom is not increased by mere diminuation of government. Anarchy is freedom for the strong and slavery for the weak.
  37. how many buffer overflows holes linux? by Anonymous Coward · · Score: 0

    This article makes me wonder about the potential security problems with overflows in open source code. Are we more vulnerable than m$? or should we all switch to openBSD?

  38. I'm Not Sure Anyone Knows by nate+nice · · Score: 3, Interesting

    I'm not convinced this man, Microsoft or anyone else for that matter knows why they have the problems they do. If they did, I'm sure Microsoft would be very interested in obtaining this information so they could make higher quality software.

    My guess is, and since I do not work at Microsoft or know their culture first hand, is they are a bloated, over managed institution that provides a fertile breeding ground for errors to compound. It's like NASA in some respects, where you just have too many layers of accountability which allows many things to slip through the cracks.

    I'm not sure it's fair to blame the programming languages used for errors. Bad code is often proclaimed as a major short coming of C++, but in the end it comes down to the design, programming and process. Many very large and successful software projects have been constructed using C/C++, so I find it a lame excuse to blame the language.

    One big problem that many agree on is in the case of Microsoft there is a large market pressure to release things before they are ready. This allows you to get your product out to customers who will then be less likely to use a computers product, even if superior, but released later. Everyone knows the price of bug fixes goes up after the software is released, but I'm sure the mathematicians at companies like Microsoft have calculated the bug cost to profit ratio in releasing the software in particular states and the most profitable option is taken, regardless of acceptance.

    I would be interested in knowing what Microsoft's error to lines of code ratio is. Larger than typical, smaller? I mean, Microsoft apparently has really good talent working for them. You would imagine they would produce really good software. What gives?

    --
    "If you are a dreamer, a wisher, a liar, A hope-er, a pray-er, a magic bean buyer ..."
    1. Re:I'm Not Sure Anyone Knows by ratboy666 · · Score: 1

      nate nice:

      It's very clear why.

      The answer is that microsoft components are inappropriately shared. For example, the html render component used in userland is used to render help pages for system administration. Yes, the SAME binary.

      And... there isn't any way to decouple these things. At least, not without redesign, and "opening" up the Windows platform to competition.

      Now, it IS happening. but it must be coupled with an overhaul of the user experience (GUI). The user must perceive that certain things take more time and effort because certain ring barriers cannot be crossed (eg. more trusted code can NEVER call on less trusted code).

      This stuff isn't new, and these "mis-features" are hardly limited to Windows. For example, I have seen a component in the Linux world that allows the VFS layer in the kernel to actually invoke user level programs to implement "convenient" file systems. Lots of fun for the experimenter, but a PRIME attack point. I mean, think, a crack in a user level component can now give greater than root (ei. kernel) access. Who's your daddy?

      Ratboy

      --
      Just another "Cubible(sic) Joe" 2 17 3061
    2. Re:I'm Not Sure Anyone Knows by Anonymous Coward · · Score: 0

      I'm not convinced this man, Microsoft or anyone else for that matter knows why they have the problems they do. If they did, I'm sure Microsoft would be very interested in obtaining this information so they could make higher quality software.

      C'mon, Microsoft knows exactly where these problems come from. They come from systematically compromising engineering principles, not to mention business ethics, in exchange for wealth and power.

      The problem for Microsoft now is that, while it may be able to spin the ethical problems into oblivion, a history of deeply compromised software engineering is much harder to repair.

      I tend to crow about this a bit because I saw the strategy coming out of Microsoft long ago. I therefore made the difficult and sometimes expensive professional choice not to use or support Microsoft products in any form. But now I can take satisfaction in knowing that every one of the hundreds of systems I've built are stable, interoperable, and completely free from all of these Microsoft security problems. And nobody is locked into these systems.

      I do agree with you, though, that Jeff Duntemann doesn't have much of a clue. But that fits the pattern of every Microsoft apologist I've ever met. To be fair, it's hard to build a rational argument when favorable supporting material is so scarce.

  39. I haven't used C++ in a long time, by Anonymous Coward · · Score: 0

    so please correct me if I'm mistaken, but IIRC vector<T> and the like aren't boundary checked, are they? If they aren't, then C++ code using the STL containers could be just as susceptible to buffer overflows as C.

    1. Re:I haven't used C++ in a long time, by cmad_x · · Score: 0

      While the [] operator doesn't isn't boundary checked, the at() function is.

    2. Re:I haven't used C++ in a long time, by cmad_x · · Score: 0

      Where did "doesn't" come from? :S

  40. MS on standards by Anonymous Coward · · Score: 0

    I he seriously trying to say non-compliant software would be more secure???

    "Standards are good, and you'll pry C and C++ out of our programmers' cold, dead hands."

  41. All a matter of effort by RocketRainbow · · Score: 2, Insightful

    You know, maybe there's a point here. Perhaps if everyone switched to some other language, bugs and exploits would trend down. But there's more to it than this, and this isn't the biggest issue.

    If you want to remove the errors from your code you have to dedicate the time to do so. Microsoft have shown that they are not willing to do so - they optimise for speed, integration and good looks rather than security and effectiveness.

    And now they're falling apart on their traditional specialty too, because their software is like Swiss cheese. You can use it to make a sandwich, but you can't build on it.

    As people have pointed out, Microsoft is not the monolith most laymen assume. Oh, sure, you and I see a Microsoft logo or picture when we turn on our computer, but who knew that most of the Internet was running on Linux, BSD and a handful of related OSes? Who knew that most of the world's fileservers were Novell? These are the real targets in the networked world, yet it's IIS that gets it. It's Windows 2000 Server that gets it.

    Duntemann is right - Microsoft don't hire total retards to write their programs. Given the opportunity, they have shown that they can do what they're supposed to do. But they aren't supposed to do security, so they don't.

    Microsoft may be changing their minds now. They are certainly marketing in that direction, but who knows? They're one of the most successful marketing companies in the world, but their lies are wearing thin (remember all those blue screen TV ads for Windows XP?)

    It's no accident that they're using the languages they are at Microsoft, and it's no accident their work is inefficient and full of holes. They neglected these areas on purpose so that they could focus on "it runs fast and it comes with the computer."

    --
    *#*#*#*#*#******* I love peanut butter sandwiches!
  42. Sloppy code is sloppy code by Angst+Badger · · Score: 1

    Most buffer overflows are the result of simple laziness. For almost all cases, it is possible to write a generalized set of functions or, in C++, a class to manage dynamic buffers. There are, in fact, umpteen million implementations of resizeable buffers. This is not a flaw in C or C++ any more than a gun is flawed because it can be used to shoot yourself in the foot. Being careful and alert is a prerequisite for using most powerful tools.

    Of course, it grieves me to be in the position of defending C++, since the whole type-safety nonsense was largely a response to the lamentable fact that some programmers can't bother to read a function prototype or treat void pointers with respect.

    But then, C++ is a perfect example of the futility of attempting to design tolerance for carelessness into a language. C++ did indeed fix many of the problems of C, but as Microsoft and many others demonstrate, sloppy, careless coders are perfectly capable of writing sloppy, careless code in any language. Buffer overflows may be impossible in Perl, but have you noticed any shortage of buggy, poorly conceived code in Perl? Java? Python? For every correct implementation, there are countless trillions of incorrect ones. How are you going to plug that hole with a yacc grammar?

    The currently dominant languages have a lot to recommend them. And for most of them, there are excellent tools for checking the correctness of code, enforcing good programming practices, generating accurate and up-to-date documentation, and so on. But if you don't use them, or you don't put serious and careful thought into design, implementation, and maintenance, you're going to produce buggy software in whatever language you're using.

    Lack of competition and poor design and implementation are Microsoft's problems. Buffer overflows are just the characteristic symptom of careless coding in C and C++. If Microsoft switched to Java or Eiffel or ML tomorrow, the buffer overflows might vanish, but something else would take their place.

    --
    Proud member of the Weirdo-American community.
    1. Re:Sloppy code is sloppy code by Anonymous Coward · · Score: 0
      ... since the whole type-safety nonsense was largely a response to the lamentable fact that some programmers can't bother to read a function prototype or treat void pointers with respect.


      The type-checking nonsense enforces people to treat data with some respect.

      there are countless trillions of incorrect ones. How are you going to plug that hole with a yacc grammar?


      What makes you think that one tool will alone solve the problem? A type system stops people assigning strings to numbers, it won't stop them from dividing by zero.
  43. His reasoning looks very flawed to me by jesterzog · · Score: 5, Insightful

    His argument, spelled out, seems to be:

    • MSIE and Firefox are both written in C/C++, therefore:
    • MSIE and Firefox both have lots of buffer overflow related bugs.
    • MSIE suffers more because it's more popular and more homogeneous, allowing worms to spread more easily.
    • People can flock to Firefox, but if this happens then Firefox will become more popular and more homogeneous. Consequently,
    • There's no point flocking to Firefox. Give in to software monoculture, and wait for an answer that he already admits probably hasn't been invented yet.

    Personally I find this argument to be quite baseless, and I'll believe it when I see it. Even if he is correct and Firefox might have as many bugs (because hey, it's written in C/C++), he doesn't seem to've provided any logical reasoning for people who are about to move to change their mind.

    Even Jeff Duntemann admits that MSIE supposedly has at least as many bugs are Firefox. Given this reasoning, there's the choice between deploying MSIE (which is proven over and over again to be unsafe and full of security holes), and Firefox (for which nothing is proven).

    It seems very shallow --- he's pitting something proven versus something unproven, and essentially claiming that we should assume they're both identically bad. I'll take my chances with Firefox, thank you very much. If everyone flocks to Firefox and it suddenly becomes a big security risk, I'll deal with it at the time.

    1. Re:His reasoning looks very flawed to me by Darren+Winsper · · Score: 1

      It's worth noting that a lot of Firefox is actually implemented in XUL and Javascript, which is managed code. Thus, Firefox is more secure than IE :P

    2. Re:His reasoning looks very flawed to me by EddWo · · Score: 1

      Well only the very top layer. Most of the core engine is xpcom componants written in C++. Thats where any major buffer overflow errors are likely to appear. It won't just be Firefox thats effected but the whole Mozilla suite. Mozilla, Firefox, Thunderbird, Sunbird, Nvu, Camino, Galeon, KMeleon etc.

      --
      "Taligent is still pure vapor. Maybe they'll be the last who jumps up on Openstep... "
    3. Re:His reasoning looks very flawed to me by Darren+Winsper · · Score: 1

      True, I was being somewhat tongue-in-cheek with my comment, but there is some truth in my statement. For example, extensions rarely need native code, so you could make it so that truly paranoid people could disable loading third-party native code.

    4. Re:His reasoning looks very flawed to me by _Sprocket_ · · Score: 2, Insightful


      Even Jeff Duntemann admits that MSIE supposedly has at least as many bugs are Firefox. Given this reasoning, there's the choice between deploying MSIE (which is proven over and over again to be unsafe and full of security holes), and Firefox (for which nothing is proven).


      Of course, this tends to miss the whole issue of monocultures. Whether Firefox is as bug-ridden as MSIE or not is an interesting point, but not the only one. What bugs exist for MSIE are not likely to exist in Mozilla / Firefox. And in a truely mixed environment, this alone creates a speedbump (if not roadblock) for malware.
    5. Re:His reasoning looks very flawed to me by Beryllium+Sphere(tm) · · Score: 1

      We know that Firefox has bugs, and we know from Michal Zalewski's work that Firefox can crash on any of a large number of malformed inputs. If those crashes are memory overwrites, then we're looking at potentially exploitable bugs.

      A defeatist would say that the top browser would always be exploited. A pessimist, more constructively, would say that since everything has bugs you should decide what to use based on how fast bugs get fixed.

      Where I see the original article going wrong is that it only looks at tactical problems like buffer overflows and not at strategic problems like ActiveX. IE's cross-zone vulnerabilities don't have any analog in Firefox.

    6. Re:His reasoning looks very flawed to me by MikeBabcock · · Score: 1

      At least with Firefox there's bugzilla -- I can go check on how the bugs are doing, and even assign my own developpers to fixing them if they bother me enough.

      --
      - Michael T. Babcock (Yes, I blog)
    7. Re:His reasoning looks very flawed to me by xnot · · Score: 1

      This brings up a good point. Security is not equivalent to market share, I.E. just because something is popular, doesn't mean it's more or less secure. If something was created with security flaws, then the flaws exist regardless if the product is popular or not. It's just that they are MORE VISABLE with a popular product, because more people are using the product (more discovery time for flaws), and the flaws are discussed to a greater extent because the product is popular. Nobody is going to care about the flaws of an unpopular product.

      Something to be learned from all of this? Fix your flaws before you ship, and be ready for a time when your product is popular. Because if you think small and assume that your flaws won't be noticed enough for it to make a difference to your sales, you might discover with alarm that one day people really DO like your product, and then you are screwed trying to patch all the flaws after the fact.

    8. Re:His reasoning looks very flawed to me by Anonymous Coward · · Score: 0

      It also could be said that the Firefox 'extention' layer opens the world of spyware/hacks/security holes to lower-skilled script developers.

      At least that was the argument about the ILOVEYOU scripting interface in Outlook.

      (I'm sure someone will explain how that's really not the case and Firefox extentions aren't the same thing as IE BHOs/Toolbars despite how similar they look to the enduser...)

    9. Re:His reasoning looks very flawed to me by Torne · · Score: 1

      It also could be said that the Firefox 'extention' layer opens the world of spyware/hacks/security holes to lower-skilled script developers.

      Unfortunately, yes, you're more or less right; malicious Firefox extensions can do an awful lot to compromise your system. You can execute arbitrary binaries as the user, for a start, though that is of course nonportable... if you'd like a cross-platform exploit, try sending their bookmarks, browsing history, cookies..etc over the 'net (just submit them to a webform somewhere - web browser extensions wouldn't be much use if they didn't have permission to, uhm, connect to web sites).

      This is why Firefox, by default, will *not* allow you to install extensions or themes that aren't downloaded from update.mozilla.org - the extensions there are hopefully vetted by enough people that a malicious one would be caught.

      Executing arbitrary binaries could be prevented (but is not, because it can be useful - see the IE View extension, for example) but the potential for abuse of the browser's internal API can't, really - removing the features that allow these things (ability to connect to websites, ability to read the user's bookmarks, etc) would pretty much break every single extension that exists ;)

    10. Re:His reasoning looks very flawed to me by abertoll · · Score: 1

      But if the average user downloaded and installed Firefox, would they ever upgrade the bug fix? That's part of the problem that many people overlook. The kinds of people who use Firefox are also more capable. Even if Microsoft came out with a patch instantly for a bug, so many people would never even install it.

      --
      "he drew his sword Ringil that glittered like ice... and he wounded Morgoth with seven wounds..."
  44. Author's slant by catwh0re · · Score: 4, Insightful
    the author tends to slant on it being more a problem of buffer overflows from the C/C++ etc languages.

    Where the problem with Microsoft has got a lot more to do with their management forcing competitors products into the ground ensuring that they get those high 90s market share figures.

    Microsoft is rather better known for poor security tactics.

    The argument that it's some inherent flaw in C doesn't hold water, as it can be not only programmed around, but a multiple layer approach to security would as a minimum ensure that each bug found had limited damage, instead of the typical issue in MS products which is that a single hole will render the entire system to be a remote control for anyone on the Internet. This is the same for viruses on the windows platform, and part of the basic structure of how the OS handles commands sent between software. (Such as the famous trick to elevate your priviledges in 'secured' windows boxes.)

    In the end, shipping an OS with just about every internet service and port open by default is not a fault in the C programming language. It's a filthy oversight.

  45. Re:Popularity not the problem. by Anonymous Coward · · Score: 0

    I fart, therefore, I am. The rest of comment has been typed out to avoid the lameness filter, thank you for your time.

  46. C/C++ Or *Some* Poor C/C++ Programming by mushroom+couch · · Score: 0

    The subject says it all. There are very good C/C++ programmers and there are very bad C/C++ programmers. Is the language really the problem? Sure overruns and exploits can happen with C/C++, but look at Linux and how it compares to Windows. Both are build on C/C++ and both have different histories wrt to security issues associated with application programming errors irrespective of language. I'm not saying that windows is bad or linux is good. I am saying that the issue is a little over-generalised in my opinion! :-)

    1. Re:C/C++ Or *Some* Poor C/C++ Programming by yermoungder · · Score: 1

      One could generalize further in that, IMHO, there are a lot more bad programmers than there are good programmers. Given a good education in what consitues 'good programming practice', a good programmer will be a good programmer in most any language. The arguement then is "how can we improve the performance of those below 'good'?". Using the best tool during each phase of development seems like an obvious statement - but then why do people insist on sticking with C/C++? Language choise can have a severe impact on performance - see http://www.stsc.hill.af.mil/crosstalk/2000/08/mcco rmick.html

  47. I Know The Real Cause by nate+nice · · Score: 2, Interesting

    After further review, the main reason they have error and exploit prone software is because they can. They don't care because it does not effect their sales at all. I'm sure they would prefer better systems, but really it is not a priority. The real priority is stomping out competitors with their monopolistic strategy.

    This is the very reason we have antitrust laws. Face it, Microsoft doesn't have to make quality software because they own everything. They won't strive to make error resistant software until they are forced to.

    The best part is, everyone has to pay for this through tech departments, maintenance, paid updates and general time spent fixing things as well as data loss, etc,..except Microsoft.

    --
    "If you are a dreamer, a wisher, a liar, A hope-er, a pray-er, a magic bean buyer ..."
  48. This has got nothing to do with programming by biased_observer · · Score: 1

    This business of security in Microsoft's products
    has got nothing to do with coding - and everything
    to do with marketing. Else, would someone like Dave Cutler (be forced to) put out an O-S like Windows NT?

  49. As usual, most of you seem to miss the point by Anonymous Coward · · Score: 0

    The point isn't that C/C++ is full of bugs, or allows bad code, or wether the programmer is bad, or whatnot.

    Face it, there's no such thing as a perfect programmer. Nobody writes perfect code. And while you might never have written a buffer overflow bug in your whole life, chances are that if you work on a team, that team will produce such a bug, if it's possible in the tool you use.

    No, the problem is, as the author of the article points out, with market share.

    Nobody bothers attacking Firefox or opera. Why ? Because the virus, worm, whatever wouldn't spread past the friends of the virus writer.

    No, in order to get the virus to stay in business, you attack the majority of people, and to do that you attack the operating system or software most people have.

    And most people have Microsoft and IE, so this is the best way to spread the virus. Hence, you start digging into those pieces of software to find holes.

    "Nobody" digs into Firefox in the same way. If you think that your testers or programmers are enough to find bugs, think again. When you have scores of teenagers all having the time of their life digging into these tools, having a couple of hundred programmers isn't going to stand a chance of having the same time to look through the source.

    If for some odd reason Firefox, Opera, or whatnot, should become the next big browser and gain a 70%+ marketshare, it will be attacked too. And when that happens, you'll know that it will have the same security problems as everything else.

    Chances are that by this time, the .net managed version of IE will be fairly free of such bugs.

  50. A relevant quote by curmi · · Score: 5, Interesting

    "A poor workman blames his tools"

    1. Re:A relevant quote by Anonymous Coward · · Score: 0

      The really poor workman can't even find his tools.

    2. Re:A relevant quote by Detritus · · Score: 1

      A smart workman uses the right tools.

      --
      Mea navis aericumbens anguillis abundat
    3. Re:A relevant quote by Anonymous Coward · · Score: 0

      In newer Russia
      A poor workman can't buy tools.

    4. Re:A relevant quote by _Sprocket_ · · Score: 2, Insightful

      Enthusiasts and professionals get very concerned over their tools. And no wonder - their ability to do what they do well relies on the availability of quality tools (or at least, tools they are comfortable using).

      Sure, a carpenter can likely hew out a basic piece with a hammer and a screwdriver. But they won't produce the quality of work that sets them apart from the average layman.

      The saying "a poor workman blames his tools" certainly has a degree of truth to it. But it can lead one to overlook the importance of good tools. An importance that any craftsman will immediately recognize.

      Incidently, within the depths of any tech jihad, someone will eventually utter "it's just a tool." They're right. But they miss point - the reason why people would have any passion over "just a tool."

    5. Re:A relevant quote by Zangief · · Score: 1

      In soviet russia, the tools blame YOU!

      (I should know, with my user name and all)

      Really, there are better languages than C/C++, but none has the support that those have.
      --
      Wiki de Ciencia Ficcion y Fantasia

    6. Re:A relevant quote by DunbarTheInept · · Score: 1

      A good workman blames his tools when he has no choice but to use the wrong ones (see, pointy-haired-boss).

      --

      Don't label something "offtopic" unless you know the topic well enough to tell what's on topic.

    7. Re:A relevant quote by xutopia · · Score: 1

      funny I recognize a good worker by his tools.

  51. And how hard exactly.. by Phil246 · · Score: 1

    is it to just to make sure that EVERY time you use a buffer, you make bloody sure it wont overflow. even if it means trucating the data being poured into it up to the buffers capacity?

  52. brainwashed author by thrad · · Score: 2, Insightful

    It is well known and widely-accepted that you can write bad code with good language. AND you can write good code with bad language.

    And, of course, a nice virtual machine or bytecode interpreter/runtime compiler can make zillions of check of your code to deal with your lazyness. But hey, who said the VM itself is secure? Alot of VMs I know of are written in guess what? C/C++ :-)

    What I am afraid of, however, is M$ is implying that C/C++ is so flawless and that is really has to be replaced with C#.. just a short step and bright future awaits us. And people take all that as Gospel

    1. Re:brainwashed author by man_ls · · Score: 1

      IBM's RVM is a bit of C++ to bootstrap, the rest of the RVM is written in Java.

      Java runs itself, basically. :)

  53. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  54. "All popular software will have holes"... yeah. by QuantGuy · · Score: 5, Informative

    The same old canard is being recycled again here... if only OS X, GNU/Linux, et al were more popular, they'd be plagued by security holes just like Windows. Anybody who's thought about this for more than ten seconds knows this is crap for a single reason: not all software coded in the same language (C-ish variants, in this case) is created equally. Some software is just designed badly.

    Just as a f'rinstance, here are three aspects of Windows that show just how much design, not installed base, drives vulnerabilities:

    • Windows registry. All users (and by extension all programs) need read-write access by default to a small number of files that are critical for system functioning: the Windows registry. All the houses in the neighborhood, so to speak, are emptying their sewage onto the same grassy field. Why commingle security concerns this way? In OS X, by contrast, applications manage their own preferences, and these are in almost all cases stored in the user's home directory in separate files. This makes security issues potentially much easier to compartmentalize, because applications are (or can be) restricted at the file system level.
    • Vulnerable services run by default. Much ink has been spilled in other places about how Windows (especially pre-XP SP2) leaves vulnerable network services listening by default, even in an out-of-the box install. Under such conditions, the half-life of a virgin XP desktop is what, 15 minutes? In contrast, the Mac ships with exactly zero ports open.
    • No "speed bump" for administrative operations. Windows doesn't have the concept of Unix sudo. Instead, users with administrative privileges can do anything without being challenged or even audited. Privileged users typically include Windows service accounts, application runtime accounts, and even Aunt Millie -- who granted herself admin rights at install just like the nice wizard told her to do. Compare this to OS X (or Linux). An operation requiring extra privileges forces the user to re-authenticate interactively; the command itself is logged for posterity.

    None of these issues have anything to do with the language they were coded in. For that matter, they could have been done in .NET. But they do help explain how certain design choices have helped create the Windows Security Pandemic. That monoculture's one hell of a petri dish.

    My point here is not to trumpet the marvelous advantages of OS X (or, say, Linux) over Windows. It is simply this: there is no Law that says that the number of vulnerabilities automatically increases with popularity but without regard to design. "Duntemann's Assertion" (aka Ballmer's Baked Wind) ain't like Moore's Law.

    1. Re:"All popular software will have holes"... yeah. by donatzsky · · Score: 1

      > Windows doesn't have the concept of Unix sudo.

      Actually it does have something to that effect, but as you point out yourself most people are logged in as admin, so it doesn't really matter.
      In Win2k hold shift when right-clicking an .exe and there will be a "Run as..." menu.

    2. Re:"All popular software will have holes"... yeah. by dmaxwell · · Score: 1

      The funny thing is that can fail more often than not. I usually attempt to use Run As to install software for a user without logging back in with admin rights. About a quarter of the time, it will simply fail and I have to re-login anyway.

    3. Re:"All popular software will have holes"... yeah. by Torne · · Score: 1

      All users (and by extension all programs) need read-write access by default to a small number of files that are critical for system functioning: the Windows registry.

      The user registry is kept in seperate files, one per user, stored in the user's home directory (their profile). The system registry is certainly not writeable or even readable by users - there are, rather, system calls which will retrieve the value of a key on your behalf, after checking the access control list associated with the registry key you are trying to read. Registry keys are protected by the same ACL system as the filesystem. Even the user registry has entries which are not writeable by the user, only by system components - just because the user can write to the file doesn't mean it will actually work if they try - it's permanently opened and locked by at least one system process if the user is logged on (Winlogon) and thus cannot be opened directly, only accessed via the appropriate API.

      The rest of your points are valid, but the registry is not anywhere so vulnerable as you make out.

    4. Re:"All popular software will have holes"... yeah. by sconeu · · Score: 1

      Runas is equivalent to su, not to sudo.

      Under sudo, if I want Joe to be able to do xxx as root, I authorize him for xxx and xxx only. Plus I don't have to give him the root password.

      For runas, Joe gets the admin password, which means he can do whatever the hell he wants to as admin, including logging in. Plus, my admin password is known by Joe, and whoever he decides to tell it to, or whoever reads the little sticky note he taped to his monitor.

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    5. Re:"All popular software will have holes"... yeah. by imipak · · Score: 1
      Sorry, I'm afraid you're mistaken.
      • The Registry certainly is an ugly hack. However, granular permissions (NOT just 'read/write/execute' - the full NTFS permissions) can be applied to arbitrary chunks of the Registry data.
      • Vulnerable services by default - absolutely true, but have you tried nmapping a default Linux install? I dunno about Debian et al but it took me several days of hacking about, reading man pages and searching to web to turn off everything my Mandrake 10 install had listening on external interfaces.
      • "Windows doesn't have the concept of Unix sudo" - this just isn't true, there's a 'runas' command accessible from the commandline or the right-click context menu. 'sudo' does have ncie logging but the fact is that you can configure Windows to log very detailed info on privileges - not just those using 'runas' but logging any use of privileges by any process, including system level stuff, applications etc.

      I personally am 100% Microsoft free (this comment is powered by GNU Emacs :), but we don't do the Free/libre movement any favours by misrepresenting Windows. Various canards are trotted out every time the topic comes up, such as the "windows is not properly multi-user", "windows has no concept of access controls" when in fact the Win32 perms are MUCH more granular than the archaic RWX Unixland stuff. Hopefully we'll see SELinux stuff incorporated in the kernel and then (crucially) see programmers actually using those access controls. When that happens Linux will have better access controls than win32. Where windows is weak is that (a) application programemrs, including MS' own, don't use the security features that do exist, and (b) users, especially home / SoHo / small businesses, don't want to spend the time neccessary to understand what their machine is actually doing. Neither factors change according to the OS being used; witness the steadily rising (but still very small) number of hidously insecure RH7 / 8 installs which I've come across whilst penetration testing.

      What they really want is something like OS X, with safe and sensible default code and system behaviour, out of the box.

      cheers
    6. Re:"All popular software will have holes"... yeah. by mpe · · Score: 1

      The user registry is kept in seperate files, one per user, stored in the user's home directory (their profile).

      Which means any application can alter USER.DAT in any way. If this file gets corrupted in certain ways a user may be either completly unable to log in or never get anywhere near having a usable desktop.

      The system registry is certainly not writeable or even readable by users - there are, rather, system calls which will retrieve the value of a key on your behalf, after checking the access control list associated with the registry key you are trying to read. Registry keys are protected by the same ACL system as the filesystem.

      This appears to be a horribly complex way of doing what having multiple configuration files would do by default.

      Even the user registry has entries which are not writeable by the user, only by system components - just because the user can write to the file doesn't mean it will actually work if they try - it's permanently opened and locked by at least one system process if the user is logged on (Winlogon) and thus cannot be opened directly, only accessed via the appropriate API.

      Which makes the whole thing vulnerable to the machine being reset, especially a hard reset.

    7. Re:"All popular software will have holes"... yeah. by Zangief · · Score: 1

      You are right, but only theorically. Because in practice, all those granular permissions are wasted, by applications which just ignore the standards.

      You have to recognize, that, in the current state, it is almost imposible to a non privileged user to use a windows box. He HAS to be given full permission. This is due to fundamental flaws in Windows design, that won't be corrected by any amount of security embellishment that Microsoft will add, because:

      -Third party Software developers will ignore them, because they are unnecesary to their application
      -Microsoft itself doesn't enforce them.

      On the other hand, the simpler Unix security schemes work because:

      -Even if you ignore them, the OS will impose them (unless you run everything as root, which may happen, as more clueless users arrive to the plataform)
      -Eventually, when you need root access to install a program, you don't need root access to run them afterwards (almost universally). In Windows, some program won't run unless you are administrator.

      Do also note that some people have been advocating the creation of a Linux Registry, and it may happen, as Desktops Managers like KDE and Gnome are trying to present an unified configuration center to the system, like windows has (and which is a good thing, but not totally necessary , IMHO)

      --
      Wiki de Ciencia Ficcion y Fantasia

    8. Re:"All popular software will have holes"... yeah. by DunbarTheInept · · Score: 1

      I can't believe I'm defending windows here, but the need for a sudo to give partial admin-like privileges without giving ALL admin privileges is something Windows doesn't *need* because it has the concept of different levels of admin-ness. Unix tends to be all-or-nothing, root or normal user with nothing in-between. So, largely Sudo is adding functionality to Unix that was sort of already there in Windows. (This is just like, from the other side, when I first heard windows advocates claiming Windows is so much better than unix because it has PC-Anwywhere for administration, and I sat there looking at my fvwm window manager in X, running seven programs on three different hosts and just laughed at their ignorance.)

      --

      Don't label something "offtopic" unless you know the topic well enough to tell what's on topic.

    9. Re:"All popular software will have holes"... yeah. by sconeu · · Score: 1

      OK, tell me how to let my kid run "Mavis Beacon Teaches Typing" without being admin.

      Thank you.

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    10. Re:"All popular software will have holes"... yeah. by Torne · · Score: 1

      Which means any application can alter USER.DAT in any way. If this file gets corrupted in certain ways a user may be either completly unable to log in or never get anywhere near having a usable desktop.

      No, they can't, it's locked.

      This appears to be a horribly complex way of doing what having multiple configuration files would do by default.

      It's identical to having a filesystem - in fact, the registry can be regarded as a filesystem. To read a registry key you make a syscall with a path, it does permission checks, then it gives you the data if you're allowed - to read a file, you make a syscall with a path, it does permission checks, then it gives you the data if you're allowed. What's the difference?

      Which makes the whole thing vulnerable to the machine being reset, especially a hard reset.

      No, it's not vulnerable to that. Both registry hives are stored as transactioned databases - notice the .LOG next to each .DAT. They're written using the standard, safe, recoverable algorithms used by databases since the dawn of time. File-based configuration is only similarly protected if stored on a journalled FS (which admittedly most are these days).

      I'm not trying to argue that the registry is better than having configuration files - I was simply pointing out that the original poster's argument was based on false premises. The *real* downsides of the registry are inherited from the downsides of Windows - inadequate access controls. If Windows apps stored their configuration in seperate files, then they'd *still* all be writable by the user (and thus by all the apps the user runs) simply because Windows doesn't have per-process access control. The same problem is reflected in the registry, but it's not having a registry that's causing the issue.

      (note that Linux/BSD/Mac OS X/etc don't have per-process access control by default either.. Linux can have it added through the security hooks used by RSBAC/SELinux, or by GRSecurity - I don't know whether the same can be achieved on BSD..etc).

    11. Re:"All popular software will have holes"... yeah. by DunbarTheInept · · Score: 1

      I've never used that program. Explain the relevant problem.

      --

      Don't label something "offtopic" unless you know the topic well enough to tell what's on topic.

    12. Re:"All popular software will have holes"... yeah. by sconeu · · Score: 1

      It's a typing program. Because of sloppy coding, it requires access as Admin. My guess is that it's either modifying HKLM or the program directory.

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    13. Re:"All popular software will have holes"... yeah. by DunbarTheInept · · Score: 1

      Then that's the program's fault, not the OS. I could just as easily write a UNIX program that only runs if you are root because it tries to, say, open a TCP/IP port number below 1024.

      --

      Don't label something "offtopic" unless you know the topic well enough to tell what's on topic.

    14. Re:"All popular software will have holes"... yeah. by sconeu · · Score: 1

      Oh, I agree. But if Windows had the equivalent of sudo or setuid, I could actually let her run it.

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    15. Re:"All popular software will have holes"... yeah. by sconeu · · Score: 1

      And I think you're missing my point.

      What would be really useful for Windows is a way for a user or program to temporarily elevate their privilige level (as RunAs currently does), BUT WITHOUT HAVING TO MAKE THE ADMIN PASSWORD PUBLIC!!!!

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    16. Re:"All popular software will have holes"... yeah. by DunbarTheInept · · Score: 1

      But that feature is only useful in situations where it *shouldn't be useful*. A typing tutor shouldn't need anything other than generic user privileges. That it needs more is a design bug in the typing tutor, pure and simple. A unix program like that would never catch on. It would be considered broken by the general user public. Sudo isn't for running user programs. It's for running admin things, like printer admin tools, or webserver restarts, where you might want some user to have privlege to do something admin-like, but only that one thing. That sort of need is accomplished in Windows by using the different levels of privilege.

      The need to run a user program, like a typing tutor, as admin, is a need that neither unix nor windows should have.

      --

      Don't label something "offtopic" unless you know the topic well enough to tell what's on topic.

    17. Re:"All popular software will have holes"... yeah. by sconeu · · Score: 1

      OK, here.

      Before I bought a router, I had to run PPPoE software. And it had to be started per user, not as an NT service. (Earlier version of EnterNet 300). And because it installed something in the TCP/IP stack, it legitimately had to run as admin.

      I had multiple users on my machine (it was a home box), and I had to come in and do RunAs whenever the kids or the wife wanted to go online.

      With setuid or sudo, I could have set it up so they could connect on TCP/IP.

      Happy now?

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
  55. Prevalent Platform Fallacy by SoupIsGood+Food · · Score: 3, Insightful

    Y'know, on the face of it, assuming Microsoft's gaping secuirty holes in it's default Windows distribution could be attributed to its massive popularity. a twist on the old OSS saw that many eyes make all bugs (or holes big enough to drive a herd of mastadons through) obvious. This is usually a canned reply by Windows Partisians to Linux/Mac/Etc. Partisians when they gloat about the latest OE bug or self-installing spyware package.

    But it doesn't hold much water when you look at the wider world, where Microsoft doesn't dominate.

    Oracle and MySQL dwarf SQL Server's installed base, yet it's the Microsoft product that's caused the most headaches to IT security teams over the years. Ditto Apache vs. IIS... Apache is everywhere, source code is available and documented, and it is nowhere near as hackable as IIS, assuming admins of equal ability managing either system.

    I think it's just that Microsoft's monopoly position has extinguished any sense of urgency in meeting it's customer's actual needs.

    SoupIsGood Food

  56. Focus on features by steveha · · Score: 4, Interesting

    The article says that IE is exploited so often because it is so popular. If Mozilla were as popular as IE, would it be just as often exploited?

    It would not.

    There are several reasons, but the biggest one is that Microsoft added some major features without ever considering the security implications. IE can install software on your system; this means you can use IE to implement Windows Update, which is kind of cool, but it also means that an exploit can use IE to put worms and viruses on your system. Firefox and the other web browsers do not have special permission from the OS to install things. In short, Microsoft spent a great deal of time and effort to tangle IE into the system, and that means that compromising IE compromises the system.

    Microsoft was well served, for years, by a focus on features. Word 2.0 could be Word 1.0 plus a hundred new features; no need to redesign, just paste the features on top. As long as the applications ran on unconnected computers, this wasn't particularly a problem. Then as networking became more important, they still got away with it because a corporate intranet is still a pretty tame environment.

    But now Microsoft software is out in the wild and wooly Internet and it isn't pretty. Features that were harmless or even useful in a private corporate intranet became big problems: apps that auto-execute scripts; the "Windows popup" service; remote execution; file sharing; dozens to hundreds of features, little and big, that were pasted on without any worrying about security.

    Microsoft employs tens of thousands of smart people. They will improve their software, eventually. They need to start designing security in, and they need to give their developers and testers time to get the security really right, rather than trying to patch all the holes after release.

    P.S. I think that another reason the free software is usually better designed falls out from the fact that free software is usually the work of small teams. Microsoft can write big specs and then have large teams go to work on them; if the teams aren't careful, their work can be a tangled mess. The free software projects tend to have clean, modular interfaces; this is partly because so often different pieces are coded up by people who don't even know each other. Also, the free software community values good design and good code, while Microsoft values features developed and shipped on time. (Good design and good code help the features to work and to ship on time, but for Microsoft the shipping is what is important.)

    steveha

    --
    lf(1): it's like ls(1) but sorts filenames by extension, tersely
    1. Re:Focus on features by cpghost · · Score: 1

      Microsoft employs tens of thousands of smart people. They will improve their software, eventually.

      This reminds me of The Mythical Man Month. Perhaps an extension would be: "Adding more programmers to a project makes it less secure."?

      --
      cpghost at Cordula's Web.
    2. Re:Focus on features by mpe · · Score: 1

      I think that another reason the free software is usually better designed falls out from the fact that free software is usually the work of small teams. Microsoft can write big specs and then have large teams go to work on them; if the teams aren't careful, their work can be a tangled mess.

      Assuming they don't set out to write a "tangled mess" deliberatly.

      The free software projects tend to have clean, modular interfaces; this is partly because so often different pieces are coded up by people who don't even know each other.

      Modular code also makes it relativly easy to subsitute modules. So long as the bits which interface are the same it will work.

    3. Re:Focus on features by steveha · · Score: 1

      No. But I'll go along with "Pasting more features on a project willy-nilly makes it less secure."

      My comment about the smart people was just to point out that Microsoft, as a company, isn't stupid. They are in a security mess now, not because they are stupid, but because pasting features on projects worked for years.

      steveha

      --
      lf(1): it's like ls(1) but sorts filenames by extension, tersely
  57. Re:The problem with the "king of the hill" scenari by man_of_mr_e · · Score: 1

    Actually, yes. Look at them:

    http://www.netcraft.com/Survey/index-200109.html

    While this survey is from 2001, the number of hosts on apache and IIS are not too different from what they are today. The important part of the survey though, is the section titled: Operating Systems used by Computers running public Internet Web Sites, June 2001. Windows runs > 50% of the web servers.

    People always misinterpret the Netcraft numbers. They list HOSTNAMES, not servers. Since Apache is used far more often on multi-site hosting servers, it has a higher percentage, but not a larger market share.

  58. Hummm, exuse me. by Anonymous Coward · · Score: 1, Informative

    You state that IIS runs on more servers than does Apache according to a netcraft study. But you do not provide a link. Any particular reason?

    Here is a link that shows that Apache far outstrips IIS. As to sheer number of servers vs hosts, well, that comes down to MS requiring a number of machines to do the work of one *nix machine. And yet, sites that use multiple Windows box, typically serve one web site and only count as a single crack even though all boxes were cracked.

    1. Re:Hummm, exuse me. by man_of_mr_e · · Score: 1

      Your link does not show that. What it shows is that Apache hosts more sites than IIS, not that there are more Apache servers.

      This survey is from June 2001, and shows physical server counts and what OS they run:

      http://www.netcraft.com/Survey/index-200109.html

      Look under the section titled Operating Systems used by Computers running public Internet Web Sites, June 2001

      While it's 3 years old, the regular survey numbers are not that different from what they are today, so it's probably still relatively accurate.

      Granted, this shows servers running Windows, and Apache does run on Windows, but at the time this survey was taken Apache on Windows was not a solid product and was not used much. Pretty much everything is either IIS or an IIS derivitive.

    2. Re:Hummm, exuse me. by Anonymous Coward · · Score: 0

      For a start that data is a good three years out of date; an eternity on the Internet. Second your graph only shows that Linux isn't running 50% of the hosts out there, but it does not show that Apache is not running on those other non-Linux systems. The only group which is not likely to be running Apache is in fact the "Other non-Unix", which weighs in at all of 2.4%

  59. Too generalised for my taste! by Meetch · · Score: 2, Informative
    I found this article a bit wishy-washy. Yes, a couple of good points are made, but the application depends on more than just the development model. IE is but one application, and it seems to be concentrated on a bit much - you can run Firefox on Windows too! Remember when Netscape went open source? It's been pretty much re-written since then, as it should have been. Does anybody know if IE has ever had a ground-up rebuild since the Win95? From what I understand, the answer is no, though someone may correct me here.

    A far far better and more informative read IMHO is The Cathedral and The Bazaar. Beware, it's on the long side.

    This gives an interesting insight into the open source model through taking over an open source project. It presents lessons learnt, and corresponding cardinal rules when running such a project. It also outlines quite effectively why open source is a viable means to develop quality software, despite the author's initial reservations. In C or C++ even.

    1. Re:Too generalised for my taste! by EddWo · · Score: 1

      AFAIK the last time the IE engine was rewritten was the Trident engine for IE5.
      But there have been so many security patches since then I wouldn't be surprised if the code had become quite messy.
      The main problem seems to be that they are paranoid about breaking any compatibility, especially the non-standard IE extensions that have internal Corperate systems have become heavily reliant upon.

      --
      "Taligent is still pure vapor. Maybe they'll be the last who jumps up on Openstep... "
    2. Re:Too generalised for my taste! by Meetch · · Score: 1
      I guess the whole Mozilla project could afford the (temporary but oh so long) incompatabilities it suffered during the rewrite. There was one huge advantage though:

      They adhere to standards, not trying to keep up with custom hacks to support the whims of the OS. I remember authoring with CSS, having to be very careful not to use certain tags that did exactly what I wanted in one browser, but looked crap in another - compatibility was paramount, and forced me to stick with a rather poor subset of the rich definitions.

      The gecko engine is an excellent piece of work - it's great that Netscape can now slap on a different look, add a dictionary, and release it with no need to mess around with the internals. That must have been a bane for Netscape while they had it closed. The changes from the days of Netscape 4.x are a great demonstration of open source achieving its goals and improving the code base. Security bugs are inevitable but infrequent, and the browser seems to keep on getting smaller and faster, yet more feature rich with every release!

      Microsoft will never achieve that with closed model, no matter how brilliant their programmers are, because they aren't exposing their source to general criticism, and better ideas in the community. I went to Uni with one of the developers at Redmond. He has a brilliant mind, but knowing him, in the end he'll just write according to the other peoples' expectations, no matter how flawed that may be.

  60. C# was created because of business politics by Lonewolf666 · · Score: 0, Redundant

    The main reason was that Microsoft and Sun didn't get along with each other on Java development. This ended with the termination of Microsoft's Java licence by Sun, a lawsuit and a settlement that said Microsoft has to leave the Java market.
    The next move by Microsoft was to introduce C# as an alternative to Java. If it also solves the buffer overflow problem (I don't know C#), that is a beneficial side effect.

    --
    C - the footgun of programming languages
    1. Re:C# was created because of business politics by BarryNorton · · Score: 0, Troll
      If it also solves the buffer overflow problem (I don't know C#), that is a beneficial side effect.
      Which is to ignore why Microsoft were interested in a 'new' language (ok, no parametric polymorphism, no inductive datatypes, no higher-order functions etc. etc., but, oooh, array bounds checking!) like Java in the first place... You didn't really think much about your answer, did you?... (Congratulations for feeling qualified to rehash the same old rubbish about lawsuits without even knowing or thinking about the technology...)
    2. Re:C# was created because of business politics by Lonewolf666 · · Score: 1

      And YOU did not follow the news about Sun vs. Microsoft with regard to Java, did you?... (Congratulations for feeling qualified to ignore the well-documented dispute between Sun and Microsoft just because you like the technology...).
      Look, I don't claim that C# is a bad language. But if you think that technology has driven THAT decision at Microsoft, you seem to believe in really strange coincidences.

      --
      C - the footgun of programming languages
    3. Re:C# was created because of business politics by BarryNorton · · Score: 2, Informative

      As it goes I did - I used Visual J++ before it was even released, back in the day, and supported Microsoft's adaptations (the COM-binding ones at least) to the technology and was sad about Sun's position, which I followed closely.

      Now that we've cleared that up (and F*** YOU, ignorant moderator), can I state again that BEFORE the legal dispute (which has nothing to do with this thread) there were reasons Microsoft was interested in Java over Visual C++ (which I used to develop) that continue to this day, sadly in a wholly divergent language rather than a variant implementation.

    4. Re:C# was created because of business politics by Lonewolf666 · · Score: 1

      there were reasons Microsoft was interested in Java over Visual C++ (which I used to develop) that continue to this day, sadly in a wholly divergent language rather than a variant implementation.

      OK, I can agree on the technical side of your argument. I do, however, still believe that C# would not have happened without the legal difficulties.
      Which were not too surprising, considering that both companies had substantial interests at stake that were not easily reconciled.
      Microsoft wanted to allow the use of existing APIs, which was understandable, given the large installation base of Windows. Unfortunately, that meant undermining the "write once, run everywhere" strength of Java.
      Sun felt threatened and fought back, which was also understandable: once a majority of Java developers would have used the Microsoft-extensions to Java, the promise of portability would have been moot in practice.
      I conclude that Microsoft would have been happy to use Java with their usual "embrace and extend" strategy, but they stepped on Sun's toes too hard in the process.

      --
      C - the footgun of programming languages
    5. Re:C# was created because of business politics by BarryNorton · · Score: 2, Insightful
      I agree that C# wouldn't have happened without the legal problems either... but your original post seemed to contradict that the reason for Microsoft to introduce another language (by which I mean either Java or C#) to their development environment was language features like these.

      We actually seem to agree that Java 'would have done just as well', and this is the route they started down, but I didn't want you to (seem to) deny the point being made (which is much more valid, in this context, than all the old boring and over-stated Slashdot rubbish about monopoly and posturing and satanism).

    6. Re:C# was created because of business politics by OwnedByTwoCats · · Score: 2, Interesting

      C# would not have happened without the legal difficulties of Java. Without the legal difficulties, Microsoft would either _own_ Java, or have _destroyed_ Java. Embrace, Extend, Extinguish.

  61. MonoCulture by ccalvert · · Score: 2, Interesting

    Jeff argues that monocultures are inevitable. This is not true. There are mechanisms in place in this country for breaking up monopolies. These techniquest have been used for nearly 100 years, since the presidency of Theodore Rosevelt. Using them in the past has brought great benefit to both consumers and businesses. In particular, one could break up Microsoft by splitting the application group from the OS group. One could furthermore split the browser out of the OS. Much of Jeff's argument depends on the false premise that monocultures in the computer world are inevitable, and can't be avoided. Take this point out, and the article has a very different flavor.

  62. There's no such thing as C/C++ by Anonymous Coward · · Score: 1, Insightful

    "C and C++, are really the same language at the core, where these sorts of bugs happen."

    That really tells you the author doesn't understand C++. Of course, that suggests the conclusion is flaky.

    The problem he alludes to is that it is possible to compile C with a C++ compiler (with very little exceptions, e.g. int class; won't work). That means your buggy C program probably will compile as well. Most C runtime bugs aren't caught suddenly at C++ compile time.

    However, the two languages are distinct. C++ string processing isn't done with char pointers, but with a class. In C, you'd use strcat() to append to a string. That can overflow. In C++, you use string += , which automatically grows the left-hand side.

    The new version of MSVC++ deprecates these C string functions. This clearly shows you don't need them.

    1. Re:There's no such thing as C/C++ by 12357bd · · Score: 1

      However, the two languages are distinct. C++ string processing isn't done with char pointers, but with a class.

      That's not enough to proclame both are that different, ie: strcat/strcpy/etc funcs where translated to some asm inlining in some VC6 compilations, i am not sure that corresponding c++ compilated class doesn't do the same.

      In the end, no matter the language, data have an address and a size, pointers are not a problem, are part of the description.

      --
      What's in a sig?
    2. Re:There's no such thing as C/C++ by gatkinso · · Score: 1

      To use some OOP jargon... with a few execptions like you pointed out, a C source code module "is a" C++ source code module.

      --
      I am very small, utmostly microscopic.
  63. Putting the Cart before the Horse by cowbutt · · Score: 1
    IMHO, the root cause of the problem with Microsoft's coders is arrogance.

    First of all, they seem to be very susceptible to 'Not Invented Here' (NIH) which leads to them re-inventing solutions to problems that have long been solved by UNIX and in the academic community (and usually better, too).

    Secondly, they have a lot of smart designers and programmers - the problem is that they know this and are arrogant to assume that they can therefore develop better and more perfect software than anything that's gone before. This leads to over-complex designs that are too hard to implement in robust ways.

    Depressing though it is, it really does seem as though 'worse is better' is one of the most reliable ways of getting robust software (even if it just gives up and aborts without even attempting the job asked of it, sometimes).

    --

  64. Monoculture to blame? Don't think so! by zmollusc · · Score: 2, Informative

    I have been using M$ products from dos 3.3 to the present, and only in the last few years have I connected to the internerd. If the problem with M$ software was really all down to its ubiquity as a target for all the malware then you would expect that standalone pc's running M$ OS and apps would work fine. Not so. It has always been bug-filled, poorly designed and badly executed. Even the wordprocessing which has been through umpteen generations in still far from a quality product.

    --
    They whose government reduces their essential liberties for temporary security, receive neither liberty nor security.
  65. Of course it's flawed by Anonymous Coward · · Score: 0

    It's yet another paid-for-by-Microsoft article. What do you expect?

    It's a bunch of handwaving trying to mask the inherently crap quality of MS products. Spread enough lies and they become the truth.

  66. Monoculture and C? by jandersen · · Score: 4, Insightful

    Aren't we simplifying things just a leetle bit here? Yes, monoculture is not good, because it creates the basis for a scenario of total failure, and C in the hands of the more witless sort of programmer can certainly be lethal (although, ANY language in the hands of a stupid programmer is a bad idea. Just look at the host of Visual Basic crap).

    However, as far as I can see, by far the largest problem on the internet is the way Microsoft has built powerful programming capabilities into a number of their products, and the way things just happen automatically by default. Perhaps it is getting better, but only slowly. To illustrate: I work in an office where most users have Windows on their desktops, but I use Linux. We have had on average something like 3 or 4 major alerts about email worms per month in the last year, and it has affected everybody else except me. Is this because Windows is a monoculture and programmed in C? Or is it because Microsoft stupidly decided to build in functionality that supports these worms?

    The truth is that no matter how many buffer overflows there may be in Linux, BSD etc, we are not likely to ever have problems with email worms - unless some idiot puts the necessary functionality in place.

    1. Re:Monoculture and C? by edremy · · Score: 1

      The truth is that no matter how many buffer overflows there may be in Linux, BSD etc, we are not likely to ever have problems with email worms - unless some idiot puts the necessary functionality in place.

      Sadly, the necessary functionality is in place for some of it- the idiot user. There're several email worms on Windows that ship the paylod in an encrypted zip, with instructions telling the user: "Unpack this, enter the password XXYYZZ, then run virus.exe." They spread quite well.

      The only reason you haven't seen these for Linux is that most current Linux users would toss any message that said "Extract this attachment, type 'chmod 777 virus' then './virus'. Oh yeah, if you have root access do an 'su root' first." But let Linux have 90% of the marketplace and you'll have hordes of users who will do exactly that.

      --
      "Seven Deadly Sins? I thought it was a to-do list!"
    2. Re:Monoculture and C? by mpe · · Score: 1

      However, as far as I can see, by far the largest problem on the internet is the way Microsoft has built powerful programming capabilities into a number of their products, and the way things just happen automatically by default.

      Even though the majority of people may have no use at all for various of these "features". Resulting in many people never even having heard of certain things in Windows, until they are used for malware...

  67. Apache: the minority product? by jarsyl · · Score: 2, Interesting
    I'm afraid Mr. Jeff Duntemann is using some bad data in TFA, which reads:
    Individual consumers and individual corporate shops can switch to a minority product, like the Mac (for consumers) and open-source tools like Linux, Apache, Evolution, and Mozilla for the corporate enterprise.
    Agreed, all of those are minority products- except for Apache, which currently claims 67.77% of the market share over 21.25% for Microsoft, their closest competitor. But we already knew that here. Dare I say- Netcraft confirms it?
  68. Same old mistake by Mr+Europe · · Score: 1

    In the story we can see the same common misunderstanding: "If Linux will be big, it will suffer same vulnerabilities as MS". MS has really succeeded in teaching the world that!

    Well Apache is big already and yet has clearly better security-level than the comparing MS-product. There must be something different in the process of either making software or fixing the holes!

  69. Guaranteed Bugs by TwicK80 · · Score: 1

    C/C++ causes security problems.
    .NET framework probably written in C/C++

    Therefore all .NET code guaranteed to have security problems.

  70. Not C#, integration by marcovje · · Score: 5, Insightful

    While I really deeply respect J. D. (he wrote my first Pascal book, that pretty much put me on the structured programming track), I don't agree, and not with nyda either.

    The bigger security problems of Microsoft software are three fold:
    - indeed bufferoverflows are a C program, but most other OSes have this too.
    - Microsoft is under hacker fire. True, but so is e.g. Apache, and that project has a much better trackrecord
    - which brings me to the actual point: the main software development problem of Microsoft is the deep integration of systems, and the total unmanagable chaos as a result. Everything is integrated with everything.

    P.s. C has a quite small and straightforward runtime, and this IMHO has a mitigating effect on C software development. The runtime is very predicatable, compared to e.g. JVM, CLR, and the various scripting languages

    1. Re:Not C#, integration by Edie+O'Teditor · · Score: 1, Interesting
      the main software development problem of Microsoft is the deep integration of systems,
      I can see why they do it - it's difficult to have the "rich user experience" without it - but it raises the question of how much of that is really useful anyway, and how much is just chrome and gee-whizz.
      and the total unmanagable chaos as a result. Everything is integrated with everything.
      That is exactly the problem as I see it; the line between apps and the OS (you can throw the UI in for good measure) is both discontinuous and blurred.
      --
      If X is the new Y, and Y is "X is the new Y", solve for X.
    2. Re:Not C#, integration by Anonymous Coward · · Score: 0

      "I can see why they do it - it's difficult to have the "rich user experience" without it - but it raises the question of how much of that is really useful anyway, and how much is just chrome and gee-whizz."

      On the other hand, the alternative to integration is duplication. If the functionality is desired, then it has to come from somewhere.

      Duplicating code, or reinventing the wheel, across myriad applications raises its own nasty problems.

      I suspect the problem isn't so much integration per se, but the way in which it is done in Windows.

  71. Buffer overflows by 12357bd · · Score: 4, Insightful

    The only 'logical' way to eliminate buffer overflows was already know 30+ years ago: Don't make data areas executable!, that simple!

    Now if after 30+ years, computer industry still is unable/uninterested to fix that simple problem, That's the real problem!

    Stop blamming the tools (languages/etc) or the people (programmers/admins/etc), is the system stupid.

    --
    What's in a sig?
    1. Re:Buffer overflows by KaledZeCamelII · · Score: 1

      > The only 'logical' way to eliminate buffer overflows was already know 30+ years ago: Don't make data areas executable!, that simple! You mean : Don't make program areas writeable !

  72. Or in Germany... by notamac · · Score: 1

    The farmer blames his swimming pants.

  73. Better Compilers by Detritus · · Score: 3, Interesting

    Better compilers have a role to play. There was a great deal of work done on Ada compilers to be more intelligent about generating code for error checks. This greatly reduces the speed penalty for safe code.

    --
    Mea navis aericumbens anguillis abundat
    1. Re:Better Compilers by budgenator · · Score: 1

      Back in the day when Dr. Dobbs had theoretical articals about computer science and Byte had had construction articals that involve chip sockets and wire-wrapping; Unix and Ada seemed to me to be technologies that would be important in the future. Well now I'm using Linux and with it Ada compilers are common-place, what happened to Ada. If memory serves me correctly Ada either solved, or was well on it's way to solving a lot of the problems we are working on today such as
      reliable code, threading, and even multiple process programs.

      --
      Apocalypse Cancelled, Sorry, No Ticket Refunds
    2. Re:Better Compilers by russh347 · · Score: 1

      I have a copy of a cherished memo written by a colonel in the Marine Corp. The title of the memo is "Ada Compilers Don't Work". The Colonel wrote this memo because on two projects he was in charge of, Ada was incapable of providing the required performance. I worked on one of those projects and the worst part of the codebase was the part that dealt with the inadequacies of Ada threading. It's been several years since I worked in for a DoD contractor, but the last time I talked to my former employer, the directive to use Ada for everything had been rescinded. The DoD simply got more bang for its buck by following what was commercially viable.

  74. The Real Reasons.... by pandrijeczko · · Score: 4, Interesting
    1. Microsoft's Arrogance - Microsoft are not happy just to make and supply operating systems. They want to supply everything. This means that they have such a wide product range and so much recycling of buggy old code that the emphasis they can place on a particular subset of products becomes more and more diluted over time - because they have to devote so much time to bug fixing and to prettifying/unifying their products to a single look and feel.

    2. Microsoft's Marketing - Yes, Microsoft are now a victim of their own lies as a result of convincing the public at large that their products are easy to use & maintain and that PCs never go wrong.
    As an example, I just built a PC for a friend of mine who has never really worried about computers until it became apparent that her son needed Internet access to do some of his school homework. The sheer amount of information overload I had to give her was just frightening - update and run rhe virus checker regularly, update Windows regularly, update spyware programs regularly, don't use insecure passwords, don't duplicate passwords across different applications, etc. I ended up typing out 3 pages of hints and tips for her in the end.

    3. User ignorance and greed - This follows on from 2. because far too many people have fallen for the Microsoft hype and have no clear understanding of how to keep themselves secure when on the Internet. Add to this that everyone wants something for nothing and the result is a whole heap of ignoramuses file-sharing all manner of nasty programs purely because they want their free music.

    I don't care what anyone says but this will never happen with Linux. Linux will never be a mono-culture because the fact is that installing and using Linux automatically creates a learning curve meaning that anyone who uses it immediately starts becoming a more knowledgeable computer user. Sure, it takes a long time to become an expert but when you do, it is relatively easy to maintain a system to only run the services you need and to keep those updated. That's why viruses will never spread through a Linux user base because no two Linux machines are every entirely alike and because Linux users don't suffer from the same ignorance that plagues the Windows community.

    I, for one, welcome it. I do not want inexperienced users flocking to use Linux purely because of the cool factor. The fact is that moving from Windows to Linux is like changing from being a child to an adult - the first step is to accept that you are responsible for your actions, not anyone else.

    --
    Gentoo Linux - another day, another USE flag.
  75. herewegous againous by kd4evr · · Score: 2, Insightful

    as every time with M$'n'bugz story, I want to repeat my thesis:

    M$ continually misleads and milks the dumb users that it created.

    the worst side effect M$ has spawned over the years, is the
    propagation of computer semi- or illiterate users, that are
    lead into the illusion of a bulletproof environment that will
    do-for-them-what-they-want.

    It starts with ignoring any available textbooks, throwing away manuals, thrashing installation guides along with the packaging even before even trying the 'plug-and-pray' ritual, moving on to the belief that anything can be resolved by clicking 'yes' or 'no' to
    any set of questions asked by the system. Naturally, this is nerdy behaivour, too.

    When something goes wrong, its "fix my computer, you incompetent ..."
    phrase for the post-sales, support, sysadmin or any nearest computer-literate person all over again. Here is the difference: a nerd fixes things hands-on, our joe-illiterate-user, on the other hand, blames the nearest nerd!

    It's the spoiled brats who defend the main part of M$ market share and most its earnings - since M$ has lead them to believe it can
    deliver them an omnipotent tool without the need to learn, maintain or comprehend anything.

    M$ deliver now, fix later-or-never politics
    that is in clear contrast to the beliefs of its last faithful users,
    nicely complements the situation above to create the ultimate "business" model that is beyond any parasitic capabilities.
    The only solution offered is buying newer products and paying for support into infinity...

    sorry for tipos - blame the M$ IE I just used ;-)

  76. Welcome to Obvious Airlines, first stop /. by tod_miller · · Score: 0

    Wow, what a genius article.

    The problems are not the fact that C/C++ can overflow faster than a toilet at a "bulemics anonymous all you can eat buffet" - but that M$ do not invest the time to make functional (hah) code secure, well tested, and usable (with right features) because they *know* that by the tiume this gets an issue, they will be flogging us the getCurrentYear() + (Math.random()*2) version.

    Thier bad programming works in thier favour.

    Now, C/C++ are pants for making sure you cannot pwn teh w0rld easily. M$ just doen't help things.

    Now Jaaaavaaaaa on the other hand *overlooking bad implementations of MIDP with a rush to market on antiquainted handsets* has a nice little bytecode security thingy TM(C)(R).

    Unless you use a non-official JVM which may not bother with such things. .Net sucks, after using it solid for 6-8 months, I say that with conviction.

    Java is fairly damn l33t, after using it for 4 years solid.

    Yes, it has problems (name one problem it has that affected me, and you win an ascii cigar!)

    --
    #hostfile 0.0.0.0 primidi.com 0.0.0.0 www.primidi.com 0.0.0.0 radio.weblogs.com
    1. Re:Welcome to Obvious Airlines, first stop /. by Anonymous Coward · · Score: 0

      > Now, C/C++ are pants for making sure you cannot pwn teh w0rld easily. M$ just doen't help things.

      It's incredible, really, that even now there are people who actually write like this without any trace of irony.

  77. She clings to me like cellophane by Anonymous Coward · · Score: 0

    Fake plastic submarine.

  78. The biggest problem is just pain stupidity! by acz · · Score: 2, Informative

    buffer overflows are only a small part of the problem!!! Microsoft came up with some lame ass BOF protection in their service pack 2 and their propaganda dept. is trying to convince us they solved something!

    Today there are still format strings, integer overflows and the BIGGEST part of the problem is default passwords, false advertising, no liability, poor application security, security product vendors, SQL injections and just plain stupidity!

    Just take a look at the abstract of my speech at syscan '04 (it's at the bottom of the program page.)

    Information Security in Banking: The illusion of Safety by Anthony Zboralski

    This presentation will focus on ways to defeat a banks security byways of deception, taking advantage of specific subtleties in human behavior and the bank's network of trust. This session will include three real-life case studies:

    Penetration testing major Asian banks; the speaker will show why most security mechanisms can give a false of safety and demonstrate how an attacker can ensure rapid ownership of the most up to date, patched and secure systems without using a single 0 day exploits.

    Auditing the security of core banking systems. The speaker will give real examples of insider hacking and fraud (erasure of loan files, manipulation of interest rate and foreign exchange data, vendor tempering with production environment, ATM backdoors, bypassing AS/400 security, etc.

    Finally, the speaker will present the results of his Jakarta/RI Wireless Security Survey 2003 and 2004 including disturbing screenshots of ATM transactions and multi-million dollar wire transfers which broadcasted in clear text over wireless networks without the banks knowledge.

  79. Has NOTHING to do with language by Hammer · · Score: 5, Insightful
    How many of you can honestly say "I have never, ever ignored a return code"?
    How may of you can honestly say "I have never, ever created an interface without possibility to change expected behaviour"?
    How may of you can honestly say "I have never, ever made a mistake while coding or designing program logic and flow"?

    If you answered "I can" to all three you are lying!

    That is the essence of secure software. We all make mistakes, including seasoned, paranoid veterans as myself. Some of us less others more, noone make NO mistakes. The more complex a system is the greater the risk of a fatal mistake...

    The only way to make secure software is;
    1. good design practice.
    2. good coding practice.
    3. good testing practice.
    4. a healthy dose of paranoia in your good practices.
    5. teamwork with peer review.
    6. a common realization that noone is perfect.
    7. stop spreading blame and start fixing the problem.

    1. Re:Has NOTHING to do with language by Anonymous Coward · · Score: 0

      8. build in safeguards in to make common bugs less likely

      I once read a book that recommended not only fixing bugs but finding ways to prevent them in the future (learn from your bugs).

      One safeguard could be to forbid direct use of stdlib or stdio.. or use a language that has more safeguards built in!

    2. Re:Has NOTHING to do with language by hkroger · · Score: 2, Funny
      How many of you can honestly say "I have never, ever ignored a return code"?
      How may of you can honestly say "I have never, ever created an interface without possibility to change expected behaviour"?
      How may of you can honestly say "I have never, ever made a mistake while coding or designing program logic and flow"?

      If you answered "I can" to all three you are lying!
      ... or you have never done any programming?
    3. Re:Has NOTHING to do with language by Hammer · · Score: 2, Insightful

      I wholehartedly agree about finding ways to prevent bugs in the future. However, I strongly suggest that this is done mostly by how you work not what tool you use.
      Secure software is created by good design and good practice. Tools tends to create complacency and over-reliance on the tool (that tool may or may not be good enough...)
      You can safely hammer a nail with an axe if you are careful and pay attention and easily smash your hand to pieces with a good new hammer if you are careless.

      In conclusion, yes you may improve your software with good tools but only if you are alreeady doing things "The Right Way"

    4. Re:Has NOTHING to do with language by 16K+Ram+Pack · · Score: 1
      I agree 100% that those things are all the causes of errors and all should be done.

      However, the tools used can also make a difference. I used to work on a 4GL which was designed around forms interfacing with a database. The 4GL had certain behaviours by default that meant that the testing of certain things just didn't need to be done (main one being testing of rollbacks - if you got an error, the changes had been rolled back).

      If coders don't have to code in every rollback, but that the language just does it, there's an error gone (and also time not spent on testing it that can be used to test something more related to business logic).

      A lot of code is written for businesses in languages that often don't suit what businesses basically need to do - input, validate and display data. Coders should be able to focus on delivering client requirements and the language/compiler should do a lot of the donkey work.

    5. Re:Has NOTHING to do with language by Anonymous Coward · · Score: 0

      Lots of people have never written a program. I'd bet that even lots of slashdotters can say yes to all three.

    6. Re:Has NOTHING to do with language by Anonymous Coward · · Score: 0

      It has a lot to do with the language. It also has a lot to do with the API and it has a lot to do with the programmer and the attitude.

      I've been working on IBM mainframe systems since the late 70's, in addition I've also worked with C and Unix (or Unix like systems) since the early 80's. The major difference I've noticed is at a core level of how the underlying "design" and API. In the Unix API world, the assumption is that the program that is invoking the API will handle any and all errors by default. In the mainframe world, the assumption is that the program that is invoking the API will not handle any errors and if an error occurs the program will be terminated.

      For example. Lets see what happens when a program needs to ask the operating system for some memory, and how an error is handled.

      Under Unix, you do a malloc, which returns either an address -or- NULL if there was some sort of error. First there is the from the OS that the application will handle the error. malloc simply returns something regardless of the success or failure of the operation.

      Do a "man malloc" under linux and pay close attention to the "NOTES" and "BUGS" section.

      Under z/OS, you do a getmain, which returns the address of your data. If the programmer uses the default values for the API, and there is an error, the program terminates. The programmer must make explicit use of non-default values to the API in order to "prevent" a termination if there is an error.

      You can continue this type of comparision all down the board, I/O to the file system (how does the API handle file not found conditions, a full file system, short reads, etc.). Process control, etc.

      And since Windows has been semi-influenced by the Unix API, it carries over to there as well.

    7. Re:Has NOTHING to do with language by Sneakabout · · Score: 1, Funny

      I can say all those three things! I don't write code, you insensitive clod!

      --
      Sneakabout is a mysterious figure, having done too much mathematics.
    8. Re:Has NOTHING to do with language by pigwin32 · · Score: 1

      That is just wrong, secure software is created by good design, good practice, and good tools. Your analogy sucks, even if you're careful and pay attention you can still lose a finger banging a nail in with an axe. With a little but of luck you'll hit an artery and improve the gene pool in the process.

  80. Great moments in Freudism by Anonymous Coward · · Score: 0

    This guy wants an ASCII cigar. Where's Trollkore when you need him?

    1. Re:Great moments in Freudism by tod_miller · · Score: 2, Insightful

      JUst to note, that the article does bring up some fairly interesting bio-diversity and software diversity issues, but fails to realise that the worlds most #1 used internet server and and smtp libraries are far less buggy and exploited than thier M$ counterparts, so the whole article tends to fall apart.

      it smacks of an article written to be published on /.

      SDtimes indeed.

      --
      #hostfile 0.0.0.0 primidi.com 0.0.0.0 www.primidi.com 0.0.0.0 radio.weblogs.com
  81. Buffer overflow by Alex+Belits · · Score: 3, Insightful

    If anything at all was done in a manner similar to how software is developed -- with critical parts of the system handled by people with no education or experience, under constant stress, with specifications changing faster than they are implemented -- it will be a constant, never ending disaster. A C or C++ programmer working in decent conditions is not any more prone to write code with buffer overflow than, say, an engineer designing a vehicle is prone to make another Ford Pinto. The problem is, no one would dare to place and engineer working on a car into working conditions that are considered acceptable for a software developer.

    --
    Contrary to the popular belief, there indeed is no God.
    1. Re:Buffer overflow by MagicBox · · Score: 1

      I agree to an extent with the fact that C/C++ (and other languages) do allow incredible mistakes to be made. It is true as an earlier poster wrote, that if you compared writing code to *driving a car*, it is you who holds the steering wheel. But he fails to mention that even though you are the driver, the car will limit you to certain things (how fast you can go for example..there's a built in limit). I would say that there's no limit to what C/C++ can do, but there is also no limit to how they allow certain things to be done. I do agree that better checking tools should be made available

      Which brings me to the Microsoft's point. Three things are well known about Microsoft's software: 1) The most used software in the world (highly visible as a result)
      2) Created for users, therefore very user friendly (although I am not sure what they are doing with these new versions of Windows in that department!!!)
      3)and third: Was never meant to be *secure*, therefore it has more holes than a block of swiss cheese

      I'll discuss point 3 a bit as I see it as the most important one at the moment.

      Now I know that geeks (as I am one) like to blame the programmers, or the programming culture at MS for the security holes. There's two things I rule out at Microsoft:
      1) Their programmers are not able to write good software
      2) Their Programming culture (deliver, deliver, deliver!!!) forces the software writers/testers etc.....to produce low quality software. Microsoft has always been, is and will be notorious for hiring top of line programmers, engineers and scientists. I have also read in more than one ocassion (sorry I do not have any links) that the Quality assurance process at MS is one of the best in the world. I do remember a few years back, that only for the *START* button they had a team of 12 programmers working on it. The Team manager was saying that all they concentrate on is the start button...that's their job. So that tells you something about their rigorous Programming and QA they put into the product (this was even before Bill Gate's famous memo)

      I see the problem somewhere else however (and I am not the only one to think that way). They do say that certain diseases are passed down generation to generation through the blood. So say if someone in your family had cancer, chances are you might get it. But if your parents had it, then you are almost certain te potentially develop some type of cancer, at some point in your life. Many people start taking preventive measures early on when that is the case.

      Windows unfortunately suffers from a type of software disease I'd like to call: Inherited Mutated Genes (or code). In a way Windows has become its own organism. So as you go and add features, or take them away, or change things you change the organism and the symptoms are unexpected. Its DNA has become too large and huge to be easily controlled and messed around with. Windows was never meant to be secure. When Windows 3.1 was around, the word security and Windows were never mentioned in relation to each other, unless UNIX was brought up. In fact it isn't until Windows 2000 that security had been some sort of priority for Microsoft. And when I see the same errors n Windows XP as I saw 10 years ago in Windows, it tells me that Inherited Mutated Genes are in full force.

      --

      The phaomnneil pweor of the hmuan mnid. Fcuknig amzanig eh!
    2. Re:Buffer overflow by lsmeg · · Score: 1

      Or another way to put it: rot at the core spreads outward.

      --
      It's OK! I'm a limo driver!
  82. libsafe by Anonymous Coward · · Score: 0

    The problem however is that, well, no language or library ever can force you to stop making mistakes.

    What about libsafe ?

  83. Software Monoculture? Huh by Ragingguppy · · Score: 3, Insightful

    Interesting theory. I wonder how they came up with it. I happen to strongly disagree. This sounds more like microsoft trying to justify the poor job they've done in configuration management and quality assurance. Not an issue of software development tools.

    Yes, although C and C++ has the capabilities to create such issues such as buffer overflow. Every good programmer I know understands the implications of using such functions and avoids it. If Microsoft programmers don't understand it then maybe microsoft should hire better programmers. In terms of the problems that exist in windows I don't believe this to be the case. And since I work in the tech support field I think I can call myself an authority on the subject. All the problems that I've ever seen in windows can not only be reproduced through testing they come up time and time again. They span multiple versions of windows and are never fixed despite the fact that microsoft knows about them. They've even created small patches to fix the problems when they crop up but have never worked to prevent the problems from occuring again.

    This is why I don't buy your argument on the software Monoculture. One problem I see almost every day is a problem known by its error message "Operation was attempted on something that was not a socket.:" This problem has been around since microsoft created Windows NT and effects Windows 2000 and Windows XP also. Microsoft in all this time has not fixed the problem. They know about it. I mean I've personally sent customers to microsofts technical support department to have the problem repaired. Microsoft has an article on support.microsoft.com on how to fix the problem. If they can fix it then why don't they fix it so that it doesn't happen again? I'll tell you why. Because they can't be bothered. Every time someone calls Microsofts tech support for this problem its $30 and thats a major source of revenue.

    The prevous problem is not the only problem I've seen on this issue. Take for instance the problem with spyware recently. Spyware is installed on peoples computers through security vulnerabilities in the Internet explorer browser. They know the exact security hole that causes the problem. Its the feature that allows you to place an Icon in the address bar with your website URL. They just recently published service pack two. You know what their solution was? They put a popup stopper into Intenet Explorer a solution that creates more problems then it fixes.

    Lets take another problem and this one is the most damning of all. This problem has manifested itself in every version of windows since Windows 95. And It has been a problem since then. I mean you will run into this issue if you are running Windows 95, 98, ME, NT, 2000, and Windows XP. Microsoft knows about it. They even created a little function in windows to fix the problem in windows XP. Its having to reinstall the TCP / IP stack. Although fixing the problem has gotten easier in Windows XP. They have a nice menu item when you right click on Local Area Connection in the connection screen of the control panel. However, you still have to do it. Why haven't they fixed that. Its because they get paid $30 every time someone calls about this problem.

    These aren't buffer overflow problems. They constitute for 90% of the problems I deal with every single day. They are problems that span multiple versions of Windows and have never been fixed. This argument is completely wrong I can't believe people are buying into it.

    1. Re:Software Monoculture? Huh by loquitus · · Score: 5, Insightful

      I agree, Raging Guppy. I have worked with C and C++ software in Linux, OS/2, and Windows environments for the longest time. I can appreciate the fact the author is trying to push... that C/C++, by their nature, allow the possibility for memory corruption and overruns that can be potential security breaches. I will remind you that Linux servers are used extensively and just as much as Microsoft servers in many cases, if not more. These servers are not vulnerable to the problsm that exist on the Microsoft platform. Microsoft has had YEARS to straighten out IE, but has failed to... in fact, the software gets worse as time goes on. It seems analogous to an old canoe with holes that keep popping up because of rotting wood... for how long can you keep patching it till all you have are patches keeping it together? While writing this, I got 3 IE popups come out of nowhere! I am not even using IE, nor have I ever, in the past 1 year. I use firefox, exclusively. Why is this firefox program already super-ceding my wildest (albeit lowered) expectations of IE? Why is Microsoft not improving on things that have existed as problems over the course of 3 or more different OS revisions? These are but many of the myriad of unanswered questions that Microsoft executives always avoid answering somehow.

    2. Re:Software Monoculture? Huh by dmaxwell · · Score: 1

      The pop-ups out of nowhere are probably because some spyware got installed somehow. It sounds like it's time to run Spybot. I would have recommended you run Ad-Aware as well but they got in bed with a spyware provider.

  84. C++ is underrated by MORB · · Score: 3, Insightful

    Using container libraries costs extra time and effort

    No, it doesn't. The first times, when you don't know how to do it, perhaps, but after that, using them is much faster and easier than developing ad-hoc solutions everywhere.

    and it is less efficient than error checking that is built into the compiler, for example.

    And less efficient than error checking built into the compiler ? Why ? It's error checking done by the compiler, only the error checks aren't hardcoded in the compiler, but implemented by the standard library.

    Also, using container libraries is not something that the C/C++ compilers help enforce; that is, if some module doesn't use it, nobody ever gets warned about it.

    It's because of backwards compatibility with C. If you program in C++, you're supposed to use the standard library containers. The thing is, without the backward compatibility with C, C++ wouldn't have been quite as successful, anyway.

    We need better tools to help people avoid it, and plain C/C++ apparently isn't enough for real-world programmers not to make these mistakes.

    It's enough, only if properly used. There's no need for new tools. What's the point of creating new tools when the old one are rarely ever used properly, anyway ? I also though that C++ sucked until I learned to use it properly.

    1. Re:C++ is underrated by Anonymous Coward · · Score: 0

      "There's no need for new tools. What's the point of creating new tools when the old one are rarely ever used properly, anyway ?"

      It's a good thing the rest of humanity isn't a blinkered knowall like you, otherwise we'd still be sitting in muddy holes picking fleas of each-others' arses. "We don't need bows. Spears are more than sufficient if people would just learn to throw them properly"

    2. Re:C++ is underrated by brpr · · Score: 1

      And less efficient than error checking built into the compiler ? Why ? It's error checking done by the compiler, only the error checks aren't hardcoded in the compiler, but implemented by the standard library.

      Because the compiler can somtimes optimise away range checking if it can prove that a section of code is safe.

      It's because of backwards compatibility with C. If you program in C++, you're supposed to use the standard library containers. The thing is, without the backward compatibility with C, C++ wouldn't have been quite as successful, anyway.

      Exactly, backwards compatibility with C is a major source of security bugs.

      It's enough, only if properly used. There's no need for new tools. What's the point of creating new tools when the old one are rarely ever used properly, anyway ? I also though that C++ sucked until I learned to use it properly.

      Ah, another arrogant C++ programmer who thinks the only reason there are bugs in C++ programs is "improper" usage of the language. If a tool is rarely used properly, this is often a sign that the tool sucks, or at least that it's too hard to use properly. In the case of C++, I'd say it's sometimes practically impossible to use properly. Why not use a better tool?

      --
      Freedom is not increased by mere diminuation of government. Anarchy is freedom for the strong and slavery for the weak.
    3. Re:C++ is underrated by MORB · · Score: 1

      Exactly, backwards compatibility with C is a major source of security bugs. Yes, but if C++ wasn't backward compatible with C, most of the stuff today would still be in C. Or would be in another language which would have been backward compatible with C. Ah, another arrogant C++ programmer who thinks the only reason there are bugs in C++ programs is "improper" usage of the language. If a tool is rarely used properly, this is often a sign that the tool sucks, or at least that it's too hard to use properly. Or only that proper usage of the tool just isn't widely enough documented... In the case of C++, I'd say it's sometimes practically impossible to use properly. Why not use a better tool? Just for the same reason that people won't just rewrite their existing code in java, or c#, or whatever else you consider a better tool. Besides, what would constitute a better tool is highly debatable. A lot of the allegedly better tools enforce the usage of stuff (like garbage collectors) that are not suited for everything using C or C++ today.

    4. Re:C++ is underrated by Anonymous Coward · · Score: 0

      And sorry for the broken layout.

    5. Re:C++ is underrated by geg81 · · Score: 1

      And less efficient than error checking built into the compiler ? Why ? It's error checking done by the compiler, only the error checks aren't hardcoded in the compiler, but implemented by the standard library.

      Let me give an example. A good compiler in a language with array bounds checks knows enough about array bounds checking in order to eliminate it a lot of the time. But if you implement arrays as library classes, it is much harder (and possibly impossible) for the compiler to eliminate such checks.

      If you program in C++, you're supposed to use the standard library containers.

      The C++ standard library containers aren't safe either.

      I also though that C++ sucked until I learned to use it properly.

      I don't think C++ sucks at all--I like programming in it. What I don't like is dealing with other people's C++ code because it is usually full of stupid and unnecessary bugs.

      It's enough, only if properly used. There's no need for new tools.

      So, what do you propose? People are writing software. People are using these tools improperly every day. There are thousands of books, seminars, classes, courses, code reviews, and management strategies and they are still using these tools improperly. Obviously, education isn't going to fix the problem and people aren't going to change. So, whatever improvements we are going to get will have to come from elsewhere.

      What's the point of creating new tools when the old one are rarely ever used properly, anyway ?

      The point is to create tools that make it less likely that imperfect, flawed, real-world programmers shoot themselves (or others) in the foot. The point is to create tools that are designed in such a way that programmers are more likely to use them properly.

    6. Re:C++ is underrated by brpr · · Score: 1

      Yes, but if C++ wasn't backward compatible with C, most of the stuff today would still be in C. Or would be in another language which would have been backward compatible with C.

      Not necessarily. The effort spent writing C++ would have been more profitably spent integrating C with higher level (but still compiled) languages. This is not a criticism of C++ implementors, it's obviously up to them how they spend their time.

      Or only that proper usage of the tool just isn't widely enough documented...

      Oh come on ;) Every man and his dog is iterating the "C++ is a very powerful tool if only you know how to use it properly" meme. There is no lack of documentation here, quite the opposite.

      Just for the same reason that people won't just rewrite their existing code in java, or c#, or whatever else you consider a better tool.

      Sure, I didn't suggest rewriting existing C/C++ programs. That's usually a bad idea.

      Besides, what would constitute a better tool is highly debatable.

      Naturally, but that doesn't mean that there isn't a better tool. It's debatable what's a better tool for hunting than a spear (is it gun X, gun Y, etc.?), but that doesn't mean that no better tool exists.

      A lot of the allegedly better tools enforce the usage of stuff (like garbage collectors) that are not suited for everything using C or C++ today.

      GC is almost always a good thing given a decently optimized implementation (i.e., we're not talking Perl5/Python/Tcl here, more like OCaml, Lisp, etc.) The overhead is small and tends to be less than that of reference counting smart pointers and their ilk. Reference counting is not particularly efficient, especially when implemented manually.

      Generally, a lot of time these days is spent implemeting high-level languages on top of C++ using its metaprogramming facilities. This is broadly a good thing, but these HLLs on top of C++ tend to be less well implemented and less efficient than real HLLs. Safe code is usually either going to be fast and very hard to understand, or slow(er) and easy to understand.

      --
      Freedom is not increased by mere diminuation of government. Anarchy is freedom for the strong and slavery for the weak.
    7. Re:C++ is underrated by MORB · · Score: 1

      Not necessarily. The effort spent writing C++ would have been more profitably spent integrating C with higher level (but still compiled) languages. This is not a criticism of C++ implementors, it's obviously up to them how they spend their time.

      Well, for one, at the time C++ was designed, I doubt there were many (if at all) higher level, compiled languages around. And if C was integrated with such a language, wouldn't that language have suffered from the same backward compatibility problems that C++ has ?

      GC is almost always a good thing given a decently optimized implementation (i.e., we're not talking Perl5/Python/Tcl here, more like OCaml, Lisp, etc.) The overhead is small and tends to be less than that of reference counting smart pointers and their ilk. Reference counting is not particularly efficient, especially when implemented manually.

      The advantage of garbage collection over reference counting is something I never understood.
      Yes, there are overhead to reference counting, but on the other hand, I understand that garbage collection has to find out whether objects are still used or not at a time where there isn't any informations around to help this, thus it has to walk through all objects in memory to check which are to be deleted.

      Granted, it frees speed critical code from wasting time deleting objects, but what about non-memory resources ? If a garbage collector is run only when memory pressure increase, how do you manage other kind of resources like files, sockets, mutexes and so on ?

      You can have terminate functions in your objects to make them free these kind of resources, but doesn't it defeat the whole purpose of garbage collection, which is to automatize resource management ?

    8. Re:C++ is underrated by brpr · · Score: 1

      Well, for one, at the time C++ was designed, I doubt there were many (if at all) higher level, compiled languages around. And if C was integrated with such a language, wouldn't that language have suffered from the same backward compatibility problems that C++ has ?

      Completely and utterly wrong. Lisp compilers had been around for a decades, and statically-typed functional languages with type inference (e.g. Miranda, ML) were just starting to come onto the scene. They don't suffer from backwards compatibility problems (although, as I said, they could do with a lot more work on integration, as opposed to compatibility, with C).

      The advantage of garbage collection over reference counting is something I never understood. Yes, there are overhead to reference counting, but on the other hand, I understand that garbage collection has to find out whether objects are still used or not at a time where there isn't any informations around to help this, thus it has to walk through all objects in memory to check which are to be deleted.

      Looks like you don't understand GC, then. You're describing an extremely simple mark/sweep algorithm. This is not how modern generational GCs work: they incrementally free garbage, starting with garbage which is easy to find and quick to deallocate (roughly speaking -- there are lots of different algorithms). If reference counting was more efficient than other algorithms, GCs for fast compiled languages would use reference counting (it's certainly possible, many scripting languages use reference counting GC). Also bear in mind the space overhead of reference counts, which is significant for small objects.

      You can have terminate functions in your objects to make them free these kind of resources, but doesn't it defeat the whole purpose of garbage collection, which is to automatize resource management ?

      Resource aquisition/release idioms don't have to be parasitic on constructor/destructor idioms. Lisp, for example, has an elegant solution to this kind of problem with its unwind-protect macro. I agree that some GC'd language come up short here (e.g. Java, where you have to release resources explicitly in a finally block).

      --
      Freedom is not increased by mere diminuation of government. Anarchy is freedom for the strong and slavery for the weak.
    9. Re:C++ is underrated by Anonymous Coward · · Score: 0

      The problem with your analogy is that a bow is an improvement over a properly-used spear. In the programming language discussion, it goes like this:

      C++ has buffer overflow problems!
      but C++ has tools to prevent those problems!
      but nobody uses those tools properly!
      What's the point of creating new tools when the old ones are rarely ever used properly, anyway?

    10. Re:C++ is underrated by epine · · Score: 1


      If a tool is rarely used properly, this is often a sign that the tool sucks, or at least that it's too hard to use properly.


      Adding buffer overflow checks to a programming language does not turn an incorrect program into a correct program. It turns an incorrect program into an incorrect program with less of a license to kill.

      At the same time, there are many programmers out there who never make a bounds mistake in any language.

      When I program in a bounds checked language, I don't sigh inwardly to myself "oh, I can program much faster now". I continue to put exactly as much work into the program as required to make my C code correct.

    11. Re:C++ is underrated by brpr · · Score: 1

      Adding buffer overflow checks to a programming language does not turn an incorrect program into a correct program. It turns an incorrect program into an incorrect program with less of a license to kill.

      Which is a good thing, right?

      At the same time, there are many programmers out there who never make a bounds mistake in any language.

      That must be why there are so many C/C++ network programs which have never had any buffer overrun bugs. Come on, this is one of the most common security bugs in C/C++ programs. Some programmers rarely make bounds mistakes would be more accurate.

      When I program in a bounds checked language, I don't sigh inwardly to myself "oh, I can program much faster now". I continue to put exactly as much work into the program as required to make my C code correct.

      That's great. The point is that if you do make a mistake: a) it's easier to find where the out-of-bounds access occured, and b) there's a lot fewer opporunities for exploits.

      Bounds checking (either compile-time or runtime) is not a pancea, obviously, but it's still a good thing.

      --
      Freedom is not increased by mere diminuation of government. Anarchy is freedom for the strong and slavery for the weak.
  85. Microsoft software is shipped before it's finished by Futurepower(R) · · Score: 1


    The real problem is that Microsoft doesn't let its programmers finish what they write. They are moved on to other projects, or the software is shipped before it is ready. This is just one example: Can Microsoft squash 63,000 bugs in Windows 2000?

    In my experience, Windows XP has been the Windows ME of the Windows 2000 family.

    Now, with Service Pack 2, Windows XP is beginning to look shippable.

    A very good social skill to have is to be able to recognize when you are being abused. (This is not a reference to Bush supporters.) The pattern has been this: There begins to be a discussion about some problem created by Microsoft lack of idealism. Then people begin fighting among themselves, and the original subject is forgotten.

  86. What it all boils down too... by Blackbird_Highway · · Score: 1

    What this article boils down to is this: All software is exactly the same, so you may as well use Microsoft software. All software is written in C/C++, so you may as well use Microsoft software. What this bullshit actually means is: Microsoft is really scared shitless!!! .

    --
    By the perception of illusion, we experience reality
    1. Re:What it all boils down too... by Quill_28 · · Score: 1

      >> Microsoft is really scared shitless!!!

      You think this is good?

      I always thought you wanted the giant to remain sleeping as long as possible.

  87. History is important too by cpghost · · Score: 2, Insightful

    The truth is that no matter how many buffer overflows there may be in Linux, BSD etc, we are not likely to ever have problems with email worms - unless some idiot puts the necessary functionality in place.

    Yes, exactly! Unix had a great head start compared to Windows. It was developed with a multiuser environment in mind. Legions of students have been banging on VAX machines, just to become root; both locally and remote. This led to a high awareness to security issues back then, when the system was being designed and stress-tested.

    OTOH, Windows evolved form single-user CP/M, then DOS and acquired networked capabilities way too late in the development process. Adding security as an afterthought is extremely complicated. Especially when you want to (or have to) retain backward compatibility with tons of legacy software.

    In short: Unix had to prevail in a hard environment when it was being developed. It remained (mostly) secure afterwards. Windows didn't have to prevail against attacks in its early days, and it never acquired the necessary level of "immunity" later.

    --
    cpghost at Cordula's Web.
    1. Re:History is important too by dmaxwell · · Score: 1

      Prior to 1988 or so, I don't think Unix was much better than Windows is now. It was primarily used in corporate and academic environments where a certain level of user clue and maturity could be counted on. It was the Morris worm that caused everyone to re-think UNIX security. However that still gives the UNIX world at least a 12 year head start in thinking about these issues.

    2. Re:History is important too by _Sprocket_ · · Score: 1

      Two quick point:

      1) Unix's concepts of security were bolted on well after the fact. The interesting thing is that it worked because of the modular mindset found within Unix and its developers.

      2) Unix has had its time in the crucible. It was at one time THE holder of resources an attacker would covet (storage space, bandwidth, interesting domains, etc.). It was also largely wide open to a well-educated (or well-scripted) attacker. Then the Internet became a much less-friendly place. Unix took its lumps. Admins began to wake up to the new reality and things began to improve. During this time, many of the tenants of Information Security were formed. It's a shame Microsoft didn't learn from this process.

  88. Browser Wars? by Anonymous Coward · · Score: 0
    During the browser wars, Microsofts one single aim was add more and more features to IE. Security, if at all, didn't matter a lot. What was important was to get another release as soon as possible

    Wow, we must be remembering two different browser wars. I recall MS winning over Netscape because it was a buggy piece of shit, and IE was able to run for longer than ten minutes without crashing all your open browser windows. Nutscrape also had incredible difficulty printing an html page.

    Anyway, its nice to see Slashdot drag out the myth of 'software monoculture' at least once a week. They say it like it is a proven concept, like gravity, when it is actually only a problem to pseudo-intellectual pseudo-nerds on Slashdot, who spend all day blaming their burnt toast and bad hair on Microsoft.

  89. There are no lessons... by hachete · · Score: 1

    ...just further lockin.

    I just can't see what relevance this has to anything these days. It's painfully obvious that organisations just don't care. Or the message isn't getting through. I give you this as an example:

    http://www.theregister.co.uk/2004/11/08/nhs_ms_d ea l_analysis/

    The NHS is about to become the biggest single monoculture of all time. And yet, in all that happy fluffery of content ministers, there's little consideration of security. One unsecure laptop let loose in that environment and it all falls down - life-vital equipment, records and the PPT diagram for next years rolling lockin.

    In other words, end-users buy software that's buggy if they think they're getting a good deal, and that doesn't always include risk-management. As a result, we (and I use that term advisedly) in the commercial world become bug-writers. OTOH, in this market-place, OSS, or code which could reasonably called more secure and I believe that most OSS code is, doesn't seem to have much of a niche. This USP is ignorable when standardisation is all that's called for.

    h.

    --
    Patriotism is a virtue of the vicious
  90. Buffer overflow = incompetent programmer by BRSloth · · Score: 2, Insightful

    ...he notes that the problem is largely with C/C++ and mostly because of the buffer overflow problems.

    Oh, please! Every good programmer know how to handle memory allocations because *he knows how the machine works*! If we have so many buffer overflow problems today is because the great majority of the programmers out there don't understand/care about something that is the base of their work.

    Think this way: you are a mechanic that builds internal combustion motors. But you don't understand how internal combustion motors works. So, will you build a good or a bad motor?

    (And yes, you can build other types of motors if you don't understand/care how internal combustion motors works - and it is like using a different language).

  91. On OpenVMS implementation languages by pwhysall · · Score: 2, Informative

    From the FAQ:

    "In no particular order, OpenVMS components are implemented using Bliss, Macro, Ada, PLI, VAX and DEC C, Fortran, UIL, VAX and Alpha SDL, Pascal, MDL, DEC C++, DCL, Message, and Document. And this is certainly not a complete list. However, the rumor is NOT true that an attempt was made to write pieces of OpenVMS in every supported language so that the Run-Time Libraries could not be unbundled. (APL, BASIC, COBOL and RPG are just some of the languages NOT represented!)"

    --
    Peter
    1. Re:On OpenVMS implementation languages by Anonymous Coward · · Score: 0

      Urgh. That certainly gives some perspective on the magnitude of work required to port OpenVMS to the Itanic. Do the OpenVMS people have to port all those compilers (except maybe fortran, ada and C/C++) on their own?

    2. Re:On OpenVMS implementation languages by Sivar · · Score: 1

      Er, oh yeah. Thanks for pointing that out. I knew that, so I don't know what I was smoking when I mentioned OpenVMS in my example of C software.
      Someone please mod this up +1 informative.

      --
      Computer Science is no more about computers than astronomy is about telescopes. --E. W. Dijkstra
  92. Expert opinions by erroneus · · Score: 1

    I'm not as expert as the larger part of the people commenting here but I'll toss my ideas in a bit largely gathering from what I have learned over the past few years.

    I don't think it's entirely fair to compare a relatively simple service to an entire operating system. What I mean here is saying stuff like "look at Apache... it fares far better than..." Okay, it holds the largest share of web servers but when you consider that the points of access are so very limited, it's a lot easier to secure access to it.

    Microsoft seems to have a culture that doesn't care about anything but the result and the path taken to get the result is almost inconsequential. We see this through the ill-will it spreads throughout the business community with its nazi-like BSA. We see this through its illegal business practices (and I will say illegal because it has been ruled as such and I haven't seen any deviation from their tactics in the slightest). And speaking from almost direct experience with looking at their "expert-written code" someone very close to me who is by no means an expert coder had the opportunity to correct many aspects of their Soloman and connected projects.

    Microsoft is also suffering from backward-compatibility pains. They established long ago a policy that requires backward compatibility. This means they have to not only correct the problems of their code in the past, but also maintain the quirky results of poor coding in the past so that applications exploiting the bad code can continue to run as expected. This is partly due to their "keep'm upgrading" drive since people wouldn't buy upgrades if it broke their software when they did. (Goes back to overly aggressive market drive that someone else mentioned)

    With Microsoft, the notion that "you get what you pay for" should apply where it needn't be applied to Linux and the software that runs on it. We should expect more from a "professional" product than we do from one built by a collection of amateurs and ProAms. (I'm not knocking the writers and maintainers of Linux -- just pointing out where expectations should be coming from.) And yet we find the opposite is true. We find that we expect to see reliable experience with Linux and a faulty one with Microsoft. This may not be YOUR personal view, but it's the view of too many professionals out there who use and maintain the machines running both OSes.

    Is it sufficient to say that "Microsoft sucks" or do I need to lay it out as I have above? They operate with little to no conscience at the business level and at the development level -- it shows in everything they do.

  93. User Stupidity is #1 by rudy_wayne · · Score: 2, Insightful

    The argument of "Apache is widely used and is more secure than IIS, so you can't claim that Windows is attacked more simply because it's more widely used" is somewhat true, but misses a crucial point. Server software is not (usually) subjected to the same level of user stupiduty as desktop software.

    Many of the 'security' problems in Windows are not just the result of sloppy programming by Microsoft. When you combine Microsoft's lack of attention to security with the stupidity of the average user, *THAT* is where the real problems start.

    I have a few friends who have bought their first computers over that past couple of years and I would set them up with a firewall, tell them to buy an AV program and set up Mozilla for web browsing and e-mail, and tell them not to use IE. And within a few months I would be getting calls from them -- their computer is slow, it's crashing, etc....

    And when I would investigate, I would find that their computers were full of garbage because they clicked on every piece of crapware that they came across. And their inbox is flooded with spam because they give their email address to every program and website that asks for it.

  94. You need LESS involvement, not more by gelfling · · Score: 2, Insightful

    Here's what I mean. I have a bunch of machines at home that my kids use. They are automated up the wazoo to the extent that is possible. Real time scanners for viruses, spyware, popup blocking, firewalls, cookie scrubbers, the works. And they all work more or less to the extent they're supposed to but they require the person in the chair to take action when they shouldn't.

    Why for example is it a GOOD idea for AVAST's real time scanner to tell me it found a virus and then not doing anything about it? It knows it's there, kill the damn thing. Don't give me a message popup from the system tray telling me you found it. My kids ignore it and I for one don't really want to know. And don't bother writing a log either - just email it to me once a month or something.

    So the problem is that while we have these neato tools, for some odd reason the authors feel required to cripple their own tools so that we KNOW what they are doing? How stupid is that?

    1. Re:You need LESS involvement, not more by Doppleganger · · Score: 3, Interesting

      Why for example is it a GOOD idea for AVAST's real time scanner to tell me it found a virus and then not doing anything about it? It knows it's there, kill the damn thing. Don't give me a message popup from the system tray telling me you found it.

      Two words for you: False positives.

      It's bad enough when an AV scanner accidently triggers and displays a message about a valid program. It would really drive people nuts if it kept immediately deleting valid programs as soon as they were installed...

    2. Re:You need LESS involvement, not more by gelfling · · Score: 1

      Fair enough but we have smart enough tools and Avast is but one example where it compiles a database of correct objects in case something has to be restored to a prior state. This way the tool should be able to find the infection, delete it or quarantine it, restore or fix the infected object from the prior state database and continue. If for whatever reason the object can't be repaired or restored then it should be deleted all the same. If that means an app doesn't work then that is the price you have to pay. Either that or the entire notion that virus infections are the greatest horror in the history of the world is overblown and we should simply get used to being infected to some degree.

  95. Outlook & IE as virus propagators by jaclu · · Score: 1

    Problem with OS is not so much that apps are less prone to exploits, its more to do with worm-propagation, its practically harder to infect as linux system, since there is no clear path of entry where bad-apps can expect to be run by a user. Outlook/IE has a large install base, "everybody" knows how to send those progs things that auto-run, so there is a easy way into the target system.

    To be real effective in spreading to linux/BSD systems, the hole needs to be in some listening daemon, like mail/dns/ntp.

    I was hacked myself some 10 years ago with a dns-exploit, luckily it was by a friend, he just hacked into my system and changed /etc/motd to "looser you could be dead now"

    Even then I guess that what really helped him was that my smtp server at the time happily anounced what distro and what CPU I was using.

    With windows you generally know all the dependant libs/dlls, with NIX you have to take an educated guess, like designing your worm to be effective against a given release of RedHat running i386, and that either has applied no patches or all patches up to but not including the last one.

  96. Spider Jerusalem on Monoculture by Colonel+Cholling · · Score: 1

    "This is the future. This is what we built. This is what we wanted. It must have been. Because we all had the fucking choice, didn't we? It is only our money that allows commercial culture to flower. If we didn't want to live like this, we could have changed it any time, by not fucking paying for it.

    "So let's celebrate by all going out and buying the same burger."

    --

    I am Sartre of the Borg. Existence is futile.
  97. Okay okay, I Read the F Article... by erroneus · · Score: 3, Interesting

    ...and here's what I have to say about it:

    The writer's attitude about software is simply all wrong and too tollerant.

    Statements like "all software has bugs" is utterly ridiculous! There is software out there whose claim to fame is being bug-free/exploit free and continually strive to keep it that way. (Think Qmail and the same group's DNS solution.) Further, if it's possible that a program that can acquire a user's input and then print it all over the screen (think back to the says of BASIC: INPUT "Enter your name", A$ ...) or anything as trivial as that can be without bugs, adding complexity doesn't mean adding bugs along with it. It has been shown time and time again that many exploit possibilities are visible in the source code simply because the writers are using unsafe coding practices (think gets();). With those facts in mind, it is conceptually possible to write bug-free, exploit-resistant code. The fact that the author of the article states otherwise doesn't make it true. The fact that the author states otherwise is an attempt to convince the reading public that we should expect and accept bugs rather than strive to a loftier goal. (There will be dirt in the world, so let's all live in filth happily... there will be disease in the world, so forget about prevention.)

    And I don't think that blaming the programming language is the right answer either. C/C++ are not inherently insecure languages. Can secure and safe code be written in these languages? Hell yeah. That would be like saying the French are rude because they speak French. Ridiculous. What is the author's intent in writing this article? I have to wonder...

    "...software monoculture isn't good but it isn't bad... it's just the way it is so accept it. It's the programming language's fault not the company or the people who use it..." Can these messages possibly be true?

  98. It's NOT mostly buffer overflows! by argent · · Score: 5, Insightful

    he notes that the problem is largely with C/C++ and mostly because of the buffer overflow problems.

    Most of the security problems that really turn into a bear with Windows aren't buffer overflows. They're layering problems. Windows doesn't have a strong distinction between different layers, it doesn't really have any internal security boundaries. It's got a complex privilege model that's wide open to privilege boosting, and applications have to be granted far too many privileges to do their normal operations... and because privileges can't be associated with applications that means a user has to be given all the privileges ANY application he uses will ever need. On top of that, "security zones" mean that if you can trick some component (the HTML control, of course) into thinking you're in the right zone it'll grant you full "local user" privileges and let you run any damn executable or script you want.

    On the server side, there's all these spooky connections between application services and network services, so that you can't keep the system from leaving listening ports into important services open, and you can't firewall them off unless you want to shut down native network support completely.

    THIS is the problem with Windows security. It's not just that it's a monoculture, it's a culture with security flaws baked into the APIs that can't be fixed without breaking applications.

  99. Software Monoculture? by Phoe6 · · Score: 1
    Monoculture is the result of genuine needs. Technological diversity may be good, but it costs, in dollars and in effort.
    Well, I remember reading a comment on this by Bill joy
    Nature deals with breakdowns in a complex system with evolution, and a very important part of evolution is the extinction of particular species. It's a sort of backtracking mechanism that corrects an evolutionary mistake. The Internet is an ecology, so if you build a species on it that is vulnerable to a certain pathogen, it can very well undergo extinction. By the way, the species that go extinct tend to have limited genetic diversity. -Bill Joy
    --
    Senthil
  100. Re:Popularity not the problem. by Arker · · Score: 2, Insightful

    I think the problem isn't a lack of good programmers, that's for sure. MS has the best programmers money can buy (are YOU for sale?) But their programmers have to work within the framework set down by management and marketing, and that's where some big problems get set in. The programmers cannot solve the basic problems - all they can do is try to work around them.

    Many of the problems with MS products boil down to design-architecture issues that the programmers absolutely have no say over, that are decided for legal or marketing reasons. The programmers aren't the ones that decide to come up with a new, more bloated and more obfuscated set of file formats every release of office. The programmers aren't the ones that decided IE had to be split up into libraries and 'integrated' with the shell to create a legal defense. The programmers probably didn't have much to say about the general tack of MS over the years towards more and more 'integration' of code - which makes it practically impossible to do a good security audit.

    They do their best to work within those decisions, and they make herculean efforts at times, I'm sure. But you can only patch a fundamentally wrongheaded design so far.

    --
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-
    Friends don't let friends enable ecmascript.
  101. Simple cure for buffer overflows by mwood · · Score: 1

    Transfer to floor sweeping any coder who is caught allocating I/O buffers off the stack. Haven't they figured that out *yet*?

  102. System architecture matters more than code by Shirotae · · Score: 4, Insightful

    People who build fault-tolerant systems start with the assumption that things will go wrong, and that includes software bugs and malicious injected code. Rather than trying to make faults never happen, an impossible task in practice, the system is designed to survive in the presence of faults, and minimise the damage they do. One of the key lessons from that work is that you create real boundaries around things, and prevent the faults crossing those boundaries. All Unix-like systems tend to have at least some kind of boundaries that are enforced, and it is relatively easy to tighten them up so that when things go bad, the damage does not spread too far or too fast.

    These hard boundaries are also interfaces where you have to be explicit about how the pieces fit together, and so it is easy to substitute one implementation for another, and from a different supplier. Well defined boundaries make it hard to tweak the API to dislodge inconvenient competitors. Making everything deeply intertwined makes it hard for anyone to interface to your system without your permission, but those vital barriers to the propagation of faults go away.

    We are never going to eliminate all faults, but there is a lot that can be done to reduce the damage they cause by using the right underlying system architecture and attitude to the overall system design. Robust design seems to require a significant degree of openness, and I think that this is where Windows is lacking.

    1. Re:System architecture matters more than code by miu · · Score: 1
      One of the key lessons from that work is that you create real boundaries around things, and prevent the faults crossing those boundaries. All Unix-like systems tend to have at least some kind of boundaries that are enforced, and it is relatively easy to tighten them up so that when things go bad, the damage does not spread too far or too fast.

      Unix and Windows both have boundaries to try and limit damage - and they both fail in real world conditions. Windows fails because the security model combined with legacy components is too complicated for programmers and users - some critical element will require privileged access in a way that is not easily understandable. Unix fails in the same way but for the opposite reason - it is simple to understand but has an easy target, get root and win.

      I don't think we will see real designed in security until it becomes invisible to programmers - it is not as simple as 'fgets' and 'strlcat/strncat' rather than 'gets' and 'strcat'. Managed code systems are a huge step in the right direction, but until everything those systems rely on are themselves reliable you have only shoved the point of failure back a level.

      Really the only containment system that could not be subverted would be a system that does not trust the user or the programmer - probably a good idea for business systems but something I would never accept on my personal machines.

      --

      [Set Cain on fire and steal his lute.]
    2. Re:System architecture matters more than code by Anonymous Coward · · Score: 0

      Very well said.

      Modularity is a principle that applies well to all domains of engineering. Small surprise, then, that we might get problems when the modularity principle is systematically violated in a software engineering project.

      Why does this happen? What would drive anyone to purposely build a monolithic product of this complexity? The answer can only be in order to capture market share by (a) excluding competition and (b) locking customers as deeply as possible into the product.

    3. Re:System architecture matters more than code by Shirotae · · Score: 1

      Try using a system with Mandatory Access Control. Not necessarily with the Multi-Level Security information flow model, but certainly with privilege separation and compartmentalisation. It is a very interesting experience to have UID 0 (having an acount named 'root' is not significant), but have less capability than an ordinary user. It is also fairly typical to not have a root user at all on that kind of system.

      I am aware of several systems of that kind that are based on Unix, one of the BSDs has some of that sort of machinery, and there are some things you can add to Linux to go a long way in that direction. Writing applications to run well on that kind of system is not particularly difficult but it requires some thought, and that is why the experience tends to be painful.

      As far as I am aware, those sort of facilities have never been added to Windows. I did read a report once that said it was possible, but my impression was that there were a lot of fundamental conflicts in the design that would make it a very difficult task.

      There a plenty of technical measures that could be used to make systems much more secure, but doing it requires that the decision makers both have a clue and think ahead, and I am not expecting that to happen any time soon for widely deployed commercial systems. I would not be surprised to see a few hobbyists fooling around with high security features in either Linux of one of the BSDs creating systems that are far more intrinsically robust that the commercial offerings.

  103. The problem is the "prettiest girl" syndrome by Anonymous Coward · · Score: 0

    The prettiest girl in school is always the one who is the most singled out and attacked by her peers. If you want to point out the 2nd prettiest girl to Microsoft, it is RedHat. In case you haven't noticed, they take the most flak from the same people who whine about Microsoft.

  104. Re:Not C#, it's monopoly by Anonymous Coward · · Score: 0

    The real Microsoft motivation, behind the apparent motivation, is maintaing their monopoly position!

    How can an outsider write compatible software, when everything is tightly integrated with everything else? It's just an impossible task! One not only must emulate ALL of those tightly integrated pieces, one has to faithly emulate many of the bugs too!

    Recent news releases manifestly demonstrate that Microsoft themselves can't handle the software maintenance costs of the amount of integration that they have chosen! So, by definition, their products can't be emulated by anybody, even themselves!

    That, by the way, also explains the need for their incessant releases!!!

  105. Regarding the "Popularity" arguemnt by Anonymous Coward · · Score: 0, Interesting

    Some say Windows has so many security vulnerabilities due to its popularity in the market.

    Others say bollocks to this and wheel out their poster-child, Apache, to refute this.

    I say that it is a combination of three things, in this order:

    1. Hatred of MS by so many programmers, network administrators, script kiddies, etc.

    This is #1. Don't fool yourself into thinking otherwise. There are people who literally spend all their free time searching for ways to damage MS's software and/or reputation. (I know a few of them personally, as I'm sure you do.) There are companies who's biggest aspiration is to be the subject of an AP story regarding some new MS flaw that they discovered. Did you know there are even websites out there that are totally consumed with hating MS? They insert editorial comments in every MS story, good or bad, and don't treat security vulnerabilites or similar bad news about other platforms the same way.

    2. Popularity.

    I can show you a dozen programs that are trivially compromised. No one cares to though; because no one is using those programs. Rant about it if you will, but we all know that Popularity plays an important role here. e.g. Script kiddies want to control the most systems of the other kiddies on IRC. Most of the other kiddies are using Windows. You do the math.

    3. MS not valuing security above features and/or rapid upgrades.

    Arguably, this naive outlook has now changed with MS's security initiatives, the success of XP SP2, etc.

    I beleive that all 3 of these things work in tandem to produce the sorry state of MS software security that we have today. (improving though, ever so slowly).

  106. Windows != IIS by MS · · Score: 1
    The question was IIS vs Apache, not Windows vs Unix

    While the server-OS market share in 2001 was about 50% Windows, that simply tells us, that in no way the IIS-share could have been more than 50%, as IIS does not run on any other OS besides MS-Windows.

    FYI a number of httpd-servers which are not made by Microsoft run on Windows, like: IBM Dominio Go, IBM-Websphere HTTPD (based on Apache), Netscape-Server, NCSA, CERN and many others.

    On the same Netcraft page further down, we read: "Linux has gained 1% and Windows 0.3%, at the cost of the other operating systems. In fact the 0.3% Windows gain is largely a technical improvement, due to Unknown dropping 0.6% because of improvements in Netcraft operating system detection. The trend is of Linux steadily increasing".

    There was no point in time, where IIS had a bigger market share than Apache, neither counting by hostnames, nor active sites, nor by ip-adresses.

    BTW: I'm webmaster of a wellknown european e-commerce site running IBM WebSphere on MS-Windows, and soon we'll migrate to Linux (for security, performance and TCO reasons!).

    :-)

    1. Re:Windows != IIS by man_of_mr_e · · Score: 1

      Oh come off it. We know that nearly all web sites running on Windows are running IIS or an IIS derivative (ie, personal web server, etc...). Sure, Domino and a number of others also run on Windows, but their market share is miniscule (as the survey itself shows).

      For nearly all intents and purposes, Windows = IIS.

      But, and this is key, none of your arguments really adress the point I waas making, which is that the argument that popularity = Target is invalid because Apache has the largest market share. IIS is the single most populous web server out there on physical machines. That makes it the largest target, especially considering you can count on all those machines running on x86 for buffer overflow exploits.

    2. Re:Windows != IIS by MS · · Score: 1
      You should also know, that in 2001 most PCs were sold with Windows2000 and IIS preinstalled and activated. People buying a PC for personal use were unknowingly running a webserver!

      This bad-practise by Microsoft to artificially increase the "market-share" of IIS came finally to a halt, after the various worms (Code Red in August 2001 and Nimda in September 2001 - you remember?!?) infected those servers, and people were instructed to patch or shut down their servers.

      Those numbers were not about the amount of deployed webservers, but about "unknowingly" preinstalled IISes. This is also, why those home-PCs do not show up in serious webserver-counts. Home-PCs are often not associated with a hostname, but simply do only respond to a (dynamically associated) IP-address. No serious survey should count webservers by ip-address! That's also why Netcraft as well as Securityspace regularly count the amount of hostnames, not IP-addresses.

      ms

    3. Re:Windows != IIS by man_of_mr_e · · Score: 1

      Actually, no.

      First, IIS is not installed on Windows 2000 Pro machines by default. It's only installed on Windows 2000 Server machines, and that's largely because much of the server documentation is stored accessed on the local web server.

      Second, Netcraft doesn't count random machines with servers on them, it onl counts machines that have registered DNS hostnames, which the vast majority of systems will not have. If you've got a hostname running at www.domain.com, and a server at that IP, then chances are you know it's there.

  107. Monoculture by shohaml · · Score: 1
    As many indicated here, it is very hard (if not impossible) to write programs with absolutely no security holes. The easiest solution is to allow for diversity, thus minimizing potential damage:
    "The fewer distinct organisms at work within this ecosystem, the easier it is for a bug--any bug--to become a threat to the health of the whole. "
    If: "fewer distinct organisms" ==> "easy threats on whole"
    than: "no easy threats on whole" ==> "more (no fewer) distinct organisms".
    (Logic 101)

    In order to allow for diversity, you need to support open standards. If people are free to choose which applications they use for their email, web-browsing, and document writing (etc.), they would probably choose to use many different utilities. For instance: if my organization uses POP3, I am not relying on any particular server/client to use it. In the *NIX world the open standards paradigm is governing... but is it so in the MS world? Forcing everyone to accept your "Total Domination" by using proprietary protocols/formats has its price. Maybe it is time to start playing ball with others?
  108. Re:The problem with the "king of the hill" scenari by EddWo · · Score: 1

    We are always hearing about this Apache thing as to disprove attacks being focused on the biggest targets. "Why is IIS attacked more when apache runs virtually all of the internet?", hardly anyone seems to question this assertion.

    People keep saying how their apache server logs are filled with code red and nimbda probes as evidence of how many IIS servers are being broken into.

    Code Red and nimbda are really old worms, the exploits they attacked were patched years ago. The fact that the traces still show up in logs is evidence that there are a lot of unpatched IIS5 machines out there, machines that havn't been patched in the last two years. If a similar number of Apache servers were being left unpatched for that length of time how would they be faring?

    Why are these old machines still around to keep spewing this stuff? Because IIS5 was installed and active by defualt on new Windows 2000 server installations and the admins never figured out they were even running it let alone that it was highly insecure out of the box and should be locked down and kept up to date with patches. Anyone running Apache is most likely doing so deliberately and is at least trying to keep it up to date and locked down.

    Is IIS being broken into on a daily basis?, probably, but so is Apache as hacks on various high profile open source projects have shown.
    Is a patched and up to date IIS6 server being broken into more often than the most recent Apache? I don't know, but somehow I doubt it.

    IIS6 and Server2003 are some of the first products to benifit from Microsofts focus on security.
    So far there have been very few updates required for IIS6, and it is disabled and configured in a locked down state out of the box.

    The Grandparent has shown that attempted attacks on both IIS and Apache are roughly equal in scale, how many of those are successful with competant admins is rarely discussed.

    If you stop counting the exploits of unmaintained and possibly unknown IIS5 boxes as examples of problems endemic to all versions of IIS you would probably find that there is not such a clear devide between them.

    Also the Netcraft server usage figures are probably misleading. They count the number of servers hosting sites with different domain names.

    A lot of sites run on shared hosting services running apache which probably means there are fewer actual apache servers than the count of domains would tend to indicate. Also a lot of IIS servers are being used for corperate intranet applications which are not supposed to be externally acessible and without a domain name, these servers are not counted by netcraft at all.

    The few IIS servers that are (deliberately) on the public internet tend to be serving up large internet applications for businesses and so present a much larger target to potential hackers than the vast number of shared hosting accounts with a few php scripts running someones blog or homepage running on apache.

    --
    "Taligent is still pure vapor. Maybe they'll be the last who jumps up on Openstep... "
  109. .NET by morningstar8 · · Score: 1

    Given that all the .NET languages boil down to the same compiled runtime "language", and given that C++ is a .NET language, could somebody explain how problems endemic to C/C++ are kept from spreading to all languages in the .NET family?

    I plead ignorance on .NET. I'm much more familiar with Java and prior generations of Microsoft languages.

    1. Re:.NET by fitten · · Score: 1

      C#.NET is very similar to Java. If you know one, you can pick up the other relatively easy. Since C# was created after Java, the claim is that the C# creators learned from some of Java's mistakes and inefficiencies and corrected them in C#. So, C# (and .NET) claim to combat these problems of C/C++ in the same ways (to some degree, not using stack based strings and buffers and having strings and buffers that grow/shrink on demand and automagically rather than having fixed sizes).

      In addition to creating C#, Microsoft modified some of their other languages to run using the same VM (CLR) as C#. VB was changed a lot to make it look a lot like C# in structure. Then there is managed C++ which has some benefits from the VM environments such as garbage collection.

      There are a number of other languages both from Microsoft and from other third parties that have been modified to run using the CLR -- Java#, Delphi (Pascal variant), and a few others, for example.

    2. Re:.NET by fullpunk · · Score: 1
      Given that all the .NET languages boil down to the same compiled runtime "language", and given that C++ is a .NET language, could somebody explain how problems endemic to C/C++ are kept from spreading to all languages in the .NET family?
      C++ dotnet allow you to mix standard (which is not safe) and dotNET C++. "Pure" dotNET c++ is not ANSI conformant (no multiple inheritance, no template support, ...).
  110. Lots of webbish people / scripters here by dusanv · · Score: 1

    I am surprised you got modded funny. Scripters in my firm certainly think C++ is obscure, arcane and is the cause of all exploits, not bad programmers and bad programming techniques.

    1. Re:Lots of webbish people / scripters here by delta_avi_delta · · Score: 1

      Scripters? I rest my case :D

      Seriously though, while possibly the cause of exploits - obscure? Almost every programmer I know, knows C++. There is no viable alternative in many cases.

  111. It's Intel's fault by wayne606 · · Score: 2, Insightful

    Buffer overruns are a problem because you can put executable code on the stack or the heap. Most other CPU architectures have an execute bit for pages that let you make the text area read-only and executable and everything else read-write and non-executable. The I86 archetecture does not have this - if it did then this type of attacks would be impossible.

  112. Factor? by wombatmobile · · Score: 1

    .

    it costs up to ten times as much to fix an error by the time it hits the market as it would to catch it during the design

    Are you sure about that factor?

    What if there are 100,000,000 users?

  113. How I write 'perfect' software.... by iamcf13 · · Score: 1

    1. Keep the code as simple as possible.
    2. Use the UNIX model of software development: One function, one task.
    3. Write as much code as possible with rules 1. and 2. in mind.

    Even then, subtle bugs may crop up due to subtle errors in program design, error checking, processing instructions, etc. For example, I had some code that was using 0 as input in error. Debugging the code led me to conclude that my data structures were not large enough. Changing a single symbolic constant fixed that problem. I re-ran the code with the 'fix' and had no further problems.

    These are program bugs worth finding and fixing--not more obvious stuff like division by zero errors, or errors in user input validation.

  114. Solution by Anonymous Coward · · Score: 0

    Henceforth, everything shall be written in Forth.

  115. Corporate culture by etresoft · · Score: 1
    I think corporate culture explains these buffer overflow bugs more than anything else. All programmers will make mistakes, no matter what language they code in or whether they work for Microsoft or help with Open Source. If an Open Source programmer finds bug, he or she can just fix it. This isn't always possible in corporations. That explains the difference between Firefox (Camino in my case) and IE more than relative programming skill or language used.

    I'll use my own experience as an examples. I once found such a bug and had to fight to get it fixed. The reason I had to fight was because it hadn't done any damage yet. I'm sure my experience would be the same in many large corporations. A bug won't get fixed until after it has caused damage or been publicly exposed as a risk.

    And sadly, I can't really blame those who didn't want that particular bug fixed. They knew the politics involved. In order to get the buffer overflow bug fixed, they would probably have to take many code changes that may not have been safe. I'm sure this story is familiar to anyone who as ever upgraded software.

    The solution? Simple. Good coding practices. Good review practices. Good testing. Good management.

    Throw in a talking bunny rabbit and you'll have a good fairy tale.

  116. The painfully obvious solution by BrakesForElves · · Score: 1

    We could eliminate the entire virus/worm propagation problem by making a few hundred different builds of each release of programs like IE, IIS, and Windows, with each build having an added, random-sized dummy variable in each system call. The existence of a random-sized placebo variable on the stack would make each build's buffer overflows occur at different addresses. Bingo, no more homogenous population of buffer overflows!

    Shucks, maybe I should have patented that idea before letting it out...

    --
    About the word "if": If bullfrogs had wings, they wouldn't bounce around on their little green butts.
  117. but Bill is chief architect by scotty777 · · Score: 1
    Microsoft employs tens of thousands of smart people. They will improve their software, eventually.

    With Bill Gates as Chief Architect, I doubt that their products will improve much. His track record as a designer is terrible. Contrast him with Steve Jobs; Steve has a great aesthetic sense as witnessed with the Apple II, Lisa, Mac, Mac desktop, Next Step, iPod, etc.

    1. Re:but Bill is chief architect by steveha · · Score: 1

      As a Chief Architect, Bill Gates ought to be making strategic decisions about technology, and his design sense will matter little.

      Steve Jobs, as CEO, does have input into the design process, but it is not fair to credit him with all of Apple's design successes. Apple as a company values design, and hires many designers; I guess it's fair to credit Steve Jobs with helping to create a company that values design.

      But Steve Jobs can be a little too obsessed with aesthetics. He actually fought against putting a hard disk in a Macintosh computer, because he felt that it was more important that a Mac be silent than that it have a hard drive. He insisted that the NeXT "cube" computer be exactly 12"x12"x12", a size that had no functional significance.

      steveha

      --
      lf(1): it's like ls(1) but sorts filenames by extension, tersely
    2. Re:but Bill is chief architect by scotty777 · · Score: 1
      If the Chief Architect doesn't take responsibility for design flaws, he's a terrible leader, at the very least. Aside from that, he should be held responsible by the rest of us.

      Bill's incompetence and Steve's brilliance flow from their sense of the aesthetics. Elegance is not an accident. And without elegance, a software design is impossible to fully understand. When such software is built, modified, or used, results will be unpredictable. (rhymes with "bug" and "insecure")

    3. Re:but Bill is chief architect by Anonymous Coward · · Score: 0

      billg cares what the code looks like.

      steve jobs cares how the box looks. "oh cool, pretty box".

      neither one is my hero, but your praise of jobs is just weird.

    4. Re:but Bill is chief architect by scotty777 · · Score: 1
      Steve cares about the user experience, part of which is hardware. The part of the user experience where he really shines is the GUI, and the Man Machine Interface (MMI). Technophobes love his products, because: [1] they are easy to learn [2]they are easy to use [3] they are suited to the task.

      I love cars that look nice, are easy to drive, and get me where I want to go, don't you? If the mechanic has only paid attention to the technology, and gives me a pain in the ass driving experience, then I give him failing marks. Bill's preocupation with code should be a big "yellow flag", not a cause for praise.

      For all his focus on sales and marketing, he has forgotten the prime rules of business: understand the customer, and serve the customer.

      MS, BG, etc. have an ostensible company mission: a computer on every desk, in every home. The problem is, they're misguided mechanics for the most part, and the ones who aren't are still guided by the "archictural vision" of their cheif mechanic: Mr. Bill.

      Hopeing that a pure geek/businessman will build me a great computing environment is like hopeing to get Michelangelo's David from a quarryman

  118. "Software Monoculture?" by rah1420 · · Score: 1

    Isn't that simply a ten dollar word for inbreeding?

    --
    Mit der Dummheit kämpfen Götter selbst vergebens.
  119. Wouldn't it be nice by marquis111 · · Score: 1

    Interesting article about the team that writes software for the Space Shuttles for NASA. Their approach is not a viable business model, but their devotion to quality is admirable.

    http://www.fastcompany.com/online/06/writestuff. ht ml

  120. baloney by scotty777 · · Score: 1
    java bytecode is data for the JavaVM

    lists are code for LISP

    scripts are data for scripting languages

    We all use vonNeuman architecture machines these days. The machines which separated data and code were called "Harverd Architecture" and were abandoned long ago.

    1. Re:baloney by 12357bd · · Score: 1

      It's not a fundamental/logical distinction (data vs code), it's just a practical one. We already have specific hardware/microcode to help to work virtual memory systems (page faults/tbls/etc).
      In the same vein let's add some help to define non-executable address ranges. The system designers will surely use-it, and exploit writers will have a harder time to try to crak our programs.
      Hell, it's really weird that a program that reads some data ends excuting foreign code! Let-it crash and burn his data, that's fine, but execute the entered data? Shouldn't have the system something to say about a data area becoming code?

      --
      What's in a sig?
    2. Re:baloney by Anonymous Coward · · Score: 0
      You're only looking at the narrow class vulnerabilities: buffer overflows. Non-executable address ranges don't matter if the code and data live together on the heap. Otherwise all scripting engines will need to tell the OS to look at every perl process, every javascript engine, every quake script to identify what's code and what's data -- but you realistically can't.


      Hell, it's really weird that a program that reads some data ends excuting foreign code!

      Yes, it's weird, but it happens all too frequently. SQL injection attacks are a perfect example of this. No amount of buffer length checking will protect you from an SQL injection attack. SQL is another example of where data is code.
    3. Re:baloney by voodoo1man · · Score: 1
      We all use vonNeuman [sic] architecture machines these days. The machines which separated data and code were called "Harverd [sic] Architecture" and were abandoned long ago.
      Not quite. All modern processors have separate instruction and data caches. Although x86 still allows you to cross the boundary, this is done at considerable expense because of the cache misses. The difference in access patterns between code and data are such that the Harvard Architecture is actually a very big win in performance.

      The problem with the examples you listed is that you're confusing representation and evaluation. While bytecodes and text strings are data representing programs, they aren't actually programs themselves - the VM/interpreter is. Translate your representation to machine code, stuff it in memory, and there is your code.

      Performance reasons aside, the stuff going on now with non-executable stacks and pages and whatnot with x86 is pretty stupid. Most people don't notice because most apps are programmed in C (which is the cause for all of these measures in the first place!), but when you need to do non-trivial things with stack manipulation and code generation this gets in the way (it also doesn't work very nice memory-wise on the x86 because you either get 4kb or obscenely humongous 2meg pages with nothing inbetween).

      --

      In the great CONS chain of life, you can either be the CAR or be in the CDR.

  121. very true; also... by scotty777 · · Score: 1
    The MS UI for configuration of systems makes it quite impossible to see whether we have really found all the little things that need to be set, even when we clearly understand our configuration objectives.

    In short, their architectural problems stem from poor cohesiveness, and excessive coupling.

  122. DSP slowdown? by tepples · · Score: 1

    Loading assemblies with unverifiable code is a privilege

    If normal users are not given the "Execute Unmanaged Code" privilege in a .NET environment, then how can normal users run video games? Or is the CLI efficient enough to implement digital signal processing and realtime garbage collection such as that required in video games as fast as unmanaged code?

  123. C/C++ is **NOT** to blame for the problem by stoicio · · Score: 1

    Buffer overflows are not caused by C/C++. They are caused by lousy programming techniques and lousy programmers. Any language can be brought to its knees by crappy programming.

  124. Executable stacks by cpghost · · Score: 1

    Didn't OpenBSD put the stack in memory pages that had the execution bit turned off?

    Anyway: buffer overruns are not the only possible way to attack a system. Format string vulns are just as easy to explore; even though they are less widely known.

    You may want to have a look at The Shellcoder's Handbook, by Koziol et. al. for the gory details. BTW, it's an excellent book!

    --
    cpghost at Cordula's Web.
    1. Re:Executable stacks by wayne606 · · Score: 1

      With format strings you are still writing into executable memory (data and stack). I guess there are still vulnerabilities that don't require you to execute the overwritten data (modify a flag saying whether the user is allowed to do certain privileged operations?) but I bet these are much harder.

      Anyway, the subject of this thread is software monoculture - isn't our current hardware monoculture (which makes buffer overrun attacks possible) equally dangerous?

  125. Fort made of twigs by Zareste · · Score: 1

    he claims that it's the popularity and market share of Microsoft's products that are responsible

    People have been hacking Windows with absolutely no problem from day one. Nice try.

    --
    I am NOT a number! I am a - oh wait, I'm number 761710. Look! 761710!
  126. This is well understood to be bullshit by Ars-Fartsica · · Score: 1, Interesting
    Do people really believe you can design away bugs? I mean, this seemed to be popular in academic circles in the 80s and 90s but I don't think anyone really believes that UML, Z, etc or any other "big design methodology" will eliminate bugs. Hence the rise of extremely iterative models in their place.

    Its interesting to see that people still cling to the dead idea that you can design perfection up front if you spend enough time doing it, even though there is very little evidence to support this and mountains of evidence against it.

    1. Re:This is well understood to be bullshit by AuMatar · · Score: 1

      You miss the point. No design will not eliminate all bugs. Design will minimize their number, however. If you're out doing seat of your pants coding (or XP, as the newbs like to call it), you're going to have a lot more system level bugs. You're also going to be unable to design features like security, which really need to be worked in at all levels of the code.

      Remember, there's a reason big design was thought up int he first palce- because the previous idea of no design was even worse. As usual, the optimum result is somewhere in the middle. Design up front, but don't get bogged down in minutae of details and leave it flexible in case you missed something that comes up in implementation.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    2. Re:This is well understood to be bullshit by peewee69 · · Score: 1

      But the monoculture argument still applies even when you are able to reduce the number of security-related bugs. It is not the defect _density_ of the application that counts. If a _single_ security-related bug is found in a networked application in widespread use, then it can be exploited by a worm that will spread through the population like wildfire.

      Unless you can eliminate _all_ security-related bugs from your application, then it is still potentially vulnerable, especially if it is connected via the internet to other copies of itself containing the same _single_ bug.

      The vulnerability here arises not because of the number of _bugs_, or security vulnerabilities, but because of the number of _interconnections_ with other applications sharing the same bug(s). In a monoculture, worms and viruses can still spread if the number of bugs is small, provided that the number of networked applications sharing these bugs is high.

  127. C/C++ by wombatmobile · · Score: 1

    .

    If C/C++ is the culprit for all these problems in software, then what is to blame for all these problems outside of software?

    English?

  128. that the problem is largely with C/C++... by Anonymous Coward · · Score: 0
    Ok, and then bridges collapse because everyone uses concrete and steel. Bizzzt! you loose.

    Everyone writes lousy software, only some learn more from their mistakes than others. If they are not writing secure code then they should go get some training on what 'secure code' is, because you can write it in almost any language, or not. The tool is not the problem, if you just don't understand what you are doing! Sorry, I don't take "excuses" when it comes to writing bad code, you either do a good job or you should find another profession, um, like washing Windows(tm) (I just love to watch the sparks and steam afterwards). The world will be a much better place with cleaner Windows(tm)!

  129. Blaming the tool. by achacha · · Score: 3, Insightful

    This paper is almost complete rubbish. The bias against C/C++ is absurd. Why not blame the hammer for carpenters' injuries?

    From my experience in the software industry, the biggest problem I have encountered is that management assumes that developers are unable to design any software. Instead they have business, marketing and sales people write up requirements (english majors who usually do not understand logic flow or coding). The requirements contain cases which totally break consistency and flow, creating possibilities for an error. Having worked at companies of various size, the larger the corporation the more non engineers control the design.

    Another major issue is that the difference between good and average programmer is huge. Mixing of good and average programmers usually results in code that will have bugs. Average programmers don't always understand what good programmers do with their code and their additions often break the consistency of the code. This is a hard qualitative idea to explain, but I am sure many have been faced with it at one point in their life or another.

    And on the final note: those that are not good at what they do always blame the tools for their problems.

    1. Re:Blaming the tool. by ruyon · · Score: 1

      Wouldn't it be better if not-so-good coders could avoid buffer overrun easily? I agree with you 100% but, I think tools can be on blame sometimes.

  130. Agreed, you are smart if you know you are dumb by Ars-Fartsica · · Score: 1
    I know that sounds like an odd way to put it, but the top-down academic methods like specification and modelling seem to make so many assumptions about human insight at the design stage...assumptions proven wrong time and again...its amazing people still cling to the dead idea.

    How many times have I logged in to /. to find someone from a .edu account tell me my software would be better if I wasn't such an idiot and used to modelling technique developed by their research group, composed of individuals who have never written code outside of a class assignment. Gee, don't you think that if UML made the world's problems go away we'd all be using it?

    Sure design and specification is useful, no one is saying you should just start hacking out a major product, but come on, bugs are going to happen and they are going to be things you didn't think of when you are toying around with your specification tool.

  131. Abt C by Anonymous Coward · · Score: 0

    I had three big problems with the actual article: (1) C is not C++, there are subtle differences; (2) the problem isn't the C runtime libraries; and (3) C++ programmers have several techniques that avoid buffer overflows (using vectors instead of arrays, for instance). The C spec (like the C++ spec) simply says how libraries are supposed to behave, not how they are supposed to be implemented. In fact, the C++ spec permits a garbage collector.

  132. Just one quote covers it all by samberdoo · · Score: 1

    "Garbage in-Garbage out." Miniscule Soft has a lot of garbage code. "A poor workman blames his tools." The Thane has many drones who are poorly trained. Two quotes, yes two. No one expects the spanish inquisition.

  133. My God! You're right! by Anonymous Coward · · Score: 0

    With this new information we should be able to eradicate all software bugs within a month. Thanks for your insight!

  134. Re:C/C++ is **NOT** to blame for the problem by cpghost · · Score: 1

    I'm a huge C fan, using it since nearly two decades in many application domains. I love C and know how to handle it. However C is not really well suited to less experienced application programmers. You can shoot yourself in the foot quite easily; not just once, but many times!

    Anyone who considers writing non-system level software should really think hard if C or C++ is the best solution. Often a Python, Ruby or Perl program would do just as well, with the added advantage of being more rapidly developed, and more secure w.r.t. buffer overruns. If speed is a bottleneck, go ahead, and write parts of it in C. Of course, big stuff like, say, toolkits, libraries, high performance servers etc... should still be written in a compiled language (C or C++ would be just fine).

    --
    cpghost at Cordula's Web.
  135. absolute size, not percentage by bob_jenkins · · Score: 1

    The critical thing for attacks isn't the percentage of the population, but rather the size of the population. The fact that some platform (Microsoft, C/C++) has reached the critical size where there's a lively body of hackers writing viruses and worms for it means it'll take a smaller population for other platforms to get attacked, because a lot of the attitudes and techniques are portable.

  136. C standard library is to blame! by janpf · · Score: 0

    Let me point my finger and blame something too :) The real problem with C/C++ are the standard libraries and string (char *) type! If the standard C string type and functions had length control/check, most of the buffer overflow problems would have been avoided. Of course, there are some resource/speed costs in this solution, but the default should be having everything checked automagically. Let the few that need the extra speed spend extra time programming/using external libraries. C++ string is quite safe in regard to buffer overflow, but many still use C libraries -- at least the C string libraries should be made unavailable by default for C++ programs. Damn, I can't even do in g++: string str("foo.bar"); ifstream file( str ); -- I have to convert str to char *! As many pointed out, buffer overflows are not the only security problem out there. ps.: have you ever checked the return code of a printf ?

  137. Yet another oversimplified analogy by Anonymous Coward · · Score: 0

    'Notice how the only discussions shifting the blame of Microsoft's appalling computer security record involve extremely vague and inappropriate analogies?

    What this article basically boils down to is the argument of "Windows appears to be less secure than other operating systems because it is the most popular, and therefore has the highest number of security threats."

    A document published recently, "Security Report: Windows vs Linux" by Nicholas Petreley, contains an excellent counter-argument to this, based on evidence rather than theories.

    Another problem with this article is that it compares organisms to computers, and doesn't even include computer users in the analogy. Unlike organisms, malicious computer code can be programmed to adapt to flaws in other operating systems, or, from the scope of the analogy, adapt to infect other types of organisms. In addition, Windows includes an automatic update feature, so in theory, Windows could even update itself and patch the flaw before a significant amount of damage is done. Furthermore, computer users will always have the power to protect their computer.

    But as we all know, this never happens. Some of the reasons for this are:

    • Similar security flaws rarely exist in other operating systems, and when they do, only exist for an insignificant period of time
    • Microsoft often take an unacceptable period of time to release a patch for security-related bugs
    • Microsoft encourage a wool-over-eyes culture of computer users, who don't understand why it is important to keep their computer secure or how to do it
  138. Big difference: infection rate. by khasim · · Score: 1
    Unfortunatly, this is not a zero sum game. Both arguments have some truth to them. There is no doubt that Microsoft have a terrible record on security, and that they have implemented many features which are simply unsafe (active X anyone).
    It seems that one has a lot of truth in it (Microsoft write insecure code) and the other has only a tiny bit (popularity means the bugs are found).

    Microsoft's security model and its implementation mean that Microsoft products are easier to crack. Just look at your ActiveX remark.

    Here's a nice page about getting rid of some adware crap and how Microsoft makes it so difficult to do: (http://www.kayodeok.co.uk/weblog/200410/02/cws.ht ml)

    After all, if Windows was as secure as, say, Mac OS, and there were 100 virus writers working on Mac OS and 10 on Windows, you would expect 10 times as many viruses to be writen for Mac Os.
    That's where the infection rate comes in. It doesn't matter how many are written, it matters how well the spread.

    There could be 10,000 viruses, worms and trojans written for Linux, but if they can't spread from machine to machine (due to Linux's security model), then they aren't a problem.

    Of course Windows is insecure and badly written, which makes the situation worse.
    To me, that is what causes the problem. Again, if there are 10,000 viruses, worms and trojans, but they can't spread, there isn't a problem.

    But if Mac OS or Linux had the market share Windows has, more viruses and exploits would exist. Far fewer than for windows, but still more than presently do.
    I'm sure more would exist. The question is, whether they would spread. If there is a 1,000x increase in the number of Linux viruses, does that mean a 1,000x increase in the number of infected machines?

    Microsoft's #1 problem is their security model and the implementation thereof.

    With Microsoft, you have to continually update your anti-virus signatures.

    Why? A virus is a failure of the security model. Why are we patching a DETECTION system when Microsoft should be repairing the implementation.

    The reason is that Microsoft cannot repair their implementation. Their security model is fatally flawed. All they can do is blame the end-user for not keeping a 3rd-party RE-ACTIVE detection system up-to-date.

    Why hasn't the OS been evolved to be more resistant to these problems?
  139. Not True! by markdj · · Score: 1

    While there IS a buffer overflow problem with C, the real reason is Microsoft's ubiquity coupled with the ability to plugin third party executables and applications. BY allowing plugins to browsers, and office apps we leave the door open to malicious mischief if we don't know the originator of the plugin. By being ubiquitous, we make the spread of one malicious program that much easier. Users like being able to add to IE, Outlook, Excel, etc., and they like the fact that they don't have to test a wide variety of browsers and e-mail clients. Ubiquity is the ONLY reason Linux and Apple don't have widely distributed viruses and worms.

  140. the problem is with C++? by Anonymous Coward · · Score: 0

    >he notes that the problem is largely with C/C++
    >and mostly because of the buffer overflow
    >problems.

    I note "..that the highway death problem is largely with cars, and mostly because of the speeding problems."

    If you use such a comparison, you can easily see the flaw in the statement.

    The problem isn't with C++ it's the idiots writing the code with unchecked buffers.

    Likewise, the car isn't the problem, it's the idiot driver.

    C++, like a car, will only do what you tell it to. It can't think for you.

    l8,
    AC

  141. Re:Popularity not the problem. by Hognoxious · · Score: 1
    But you can only patch a fundamentally wrongheaded design so far.
    I'd mod you insightful if I could. There's a saying (I think it comes from Kissinger or JFK) that you can't talk your way out of a problem you behaved yourself into.

    s/talk/code/ and s/behaved/designed/.

    --
    Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  142. "XP ready" or "Xbox ready"? by tepples · · Score: 1

    They have not provided a reverse compatible, but sandboxed environment for programs not specifically flagged as being XP ready (whatever that means).

    Windows XP provides this. Press Win+L, switch to your most limited user account that you have created for purposes of testing unknown programs, and then run the program. When you're done, Win+L to switch back to your normal account and read the logs to see where the program threw permission violations.

    Code not such flagged should be quarantined and restricted by the OS.

    Microsoft already does this on its Xbox console. The unmodded Xbox won't run anything that's not specifically signed by Microsoft as being Xbox ready (whatever that means -- a licensed developer should know Microsoft's lot check guidelines in more detail).

  143. Misses the big point by The+Cisco+Kid · · Score: 2, Interesting

    He assumes that if everyone runs away from IE (or MS in general), that they will all be running to the same thing, and create another monoculture.

    The idea is to NOT have a monoculture. To have an environment where there are *many* competing platforms and applications, and (becuase they all comply with certain published standards for file and network data formats) any individual (person or business) can choose from among many alternatives, and still be able to communicate with and send and receive data to/from individuals who chose something else.

    *Eliminate* the monoculture. The solution is not for MS to fix its bugs. The solution is for MS to not have a monopoly (wether they jump or are pushed)

    MS biggest fear is that once they are a monopoly, they will lose *all* market share (and to be honest, IMNSHO, rightfully so, their stuff is crap). MS is desperately afraid of having to compete on the technical merits of their products. Its something they never had to do before.

    1. Re:Misses the big point by Anonymous Coward · · Score: 0

      But the author makes a very coherent argument as to why everybody will run to the same thing- see the quote below. You, on the other hand, do not present any specific counter-arguments to these points. Simply saying that "the idea is not to have a monoculture", does not make this goal achievable in practice.

      "Software monoculture happens for a lot of reasons, only a few of them due to Microsoft's sales and marketing practices. In the home market, nontechnical people see safety in numbers: They want to be part of a crowd so that when something goes wrong, help will be nearby, among family, friends, or a local user group.

      In corporate IT, monoculture happens because IT doesn't want to support diversity in a software ecosystem. Supporting multiple technologies costs way more than supporting only one, so IT prefers to pick a technology and force its use everywhere. Both of these issues are the result of free choices made for valid reasons. Monoculture is the result of genuine needs. Technological diversity may be good, but it costs, in dollars and in effort."

  144. Extended Metaphor by Anonymous Coward · · Score: 0

    In the article the author says, "When IE catches a cold, the networked world gets pneumonia". This is where the argument breaks down for me. If you extend the metaphor. When IE catches a cold, Microsoft responds like a country covering up a SARS epidemic. Microsoft may have hundreds of qualified programmers, but there are thousands on the internet ,that could help fix the problem in an open source atomosphere. Instead, they have a go it alone strategy, for fear of losing market dominance. I do not beleive we are affected by a monoculture, but more affected by not being able to participate in it.

  145. ActiveEcch by tepples · · Score: 1

    Most of the Mozilla security issues I've seen are high-level issues (XUL, tabbed browsing, shell://).

    The presence of ActiveX is a high-level issue, no?

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

      No, ActiveX is a design problem.

  146. Read the parent post again by GunFodder · · Score: 3, Informative

    The parent post is NOT saying that you can "design away bugs". In fact, the parent specifically says that bugs cannot be eliminated. The idea is to contain bugs and malicious code so that they can do a minimum of damage.

    I can download a malicious or buggy Java applet through a web page. The amount of damage it can do is minimal since it has to ask permission to access my system and it runs in a user-level managed environment.

    If I download a malicious or buggy Windows executable and run it then I am basically screwed. By default Windows provides no containment for native code. An application can erase my hard drive or crash my OS.

    1. Re:Read the parent post again by peewee69 · · Score: 1

      But what if your Java Virtual Machine implementation contained a bug that meant that under certain circumstances it failed to deny system access to an untrusted Java applet? If such a bug were discovered in the JVM of a popular browser, it would very quickly be exploited. Since you cannot prove that any particular JVM contains _no_ bugs, you cannot preclude the possibility of this happening. The monoculture argument does _not_ rely on assumptions relating to the defect-density or quality of the dominant software application, since even high-quality software will still contain some security-related bugs, and when these bugs are eventually discovered, they will be exploited if the application is in wide-spread use.

  147. Rebuttal by SuperKendall · · Score: 1

    The point being that when you don't know what you'll eventually have to build, no amount of intelligence, forethought, or design will solve that problem. You build what you know you need, and flow along with changing requirements.

    I don't think this is true at all. I think there are many cases where clever people can think ahead quite a bit and get a system in place to handle future unanticipated needs - because those needs typically fall into a known domain, where needs are not always completey unknown.

    Why would a couple buy a house with four bedrooms for only two people? Because they might have kids. They don't know if the kids will like sports of computer games or what have you, but they provide a space with room to grow. And yes sometimes they have to move as that space is not enough, but the benefits of optimizing a purchase for future needs are readily apparent - and so it is with software where software that has a little breathing room in features to make changes later can be more productive than building only what you need at the moment.

    The blessing and curse of software development is that everything you are doing is necessarily new in some way. If someone has done it before, why would you be writing it again? That combined with the push to solve the difficult problems in software rather than hardware (because software is *easy* to change!?) means each project is an exploration.

    Why would you do it again... that's the million dollar question. But many people do. Even within the same company I have seen many simultanious projects spring forth, all doing the same thing.

    But the clever can benefit from this, but looking over ground that has been pre-trod and incorperating ideas from these software forefathers into new designs.

    And to the extent that the exploration is into more and more unknown territory, you need the steps of iterative and "agile" processes to get yourself a good feedback loop into your problem domain.

    But sometimes it's better to go up a hill and take a look around to see what the problem domain really is and what it might be like, rather than taking things ones step at a time.

    There are really not that many new problems being solved in software development, especially in corperations. I would almost say that an interesting methodology would be to start out saying "we are not using original ideas from any member. Instead the whole project will be composed of ideas taken from other projects. If you have an idea you must find an example of the idea in use before incorperation". Then design becomes a research effort.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  148. The difference is that you ARE an admin by SuperKendall · · Score: 1

    Under NT you ARE an administrativer user, full time, when you are allowed to be one. And generally you have to be to run a lot of programs.

    Compare to something like OS X or Linux where having admin access means you have the ability to use sudo with a known password - which you have to give before doing something to the system.

    I know that's a simplification with how admin users in Linux and OS X work, but the point holds.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  149. That's right... by CODiNE · · Score: 1

    and pintos only blew up because they were popular.

    --
    Cwm, fjord-bank glyphs vext quiz
  150. buffer overflow problems? by nusratt · · Score: 1

    "he notes that the problem is largely with C/C++ and mostly because of the buffer overflow problems"

    More accurately, brain-underflow problems.
    Can someone show me a buffer-overflow problem that couldn't have been anticipated and avoided by a responsible, diligent, professional developer?
    Yes, it's tedious, especially when having to use repeated reads for asynchronous input in TCP, but it CAN be done, if you can be bothered.

  151. Wget banning has become more sophisticated by tepples · · Score: 1

    User-agent: isn't the only way to detect Wget. If a browser is getting more than n files per minute, if it's waiting a constant time between getting files, if it's not getting images at all, or if it's waiting a comparatively long time between getting an HTML page and getting its images, then it might not be an interactive graphical web user agent. If it's not coming from an IP block known to harbor Google, MSN, or Yahoo! spiders, then it might be an allegedly malicious spider such as a spammer's e-mail address harvester.

  152. Whoa buddy, what are you on? by micromuncher · · Score: 1

    People have focused mainly on the C/C++ library issue Jeff Duntemann notes, but there are some JUST PLAIN WRONG premises set up by ol' Jeff.

    First, that monoculture is a result of best of breed... Hey Jeff! Did you hear about the anti-trust case? When the browser is integrated into the desktop and shipped with every major hardware vendor's box, its not really best of breed is it. It's not really a choice. You use what you are given, and what the vendor/corporate IS/whatever tells you they will support.

    Then you have the funny comment about Writing Solid Code. This book isn't on my desk. Yeah its given to every new hire at Microsoft so they can fit into the culture... but lets talk about that culture where you say they have "some of the best programmers in the world." I've been recruited by Microsoft twice. Suffices to say, I didn't sign up. I like to be empowered to do what I do best... and Microsoft does NOT promote that. Software development processes are the pervue of the individual project leads. Most leads at Microsoft are lifers who are SO involved in the culture, that any advancement in software engineering or best practices for software development are as foreign topics as igloos to pygmies. On the various projects I almost worked on, all of them had the same process. First, get marketing/management to set some deliverable deadline. Second, get 50 or so developers coding under a lead. (What about design?) Third, 2/3 of the way through, at 100 testers that end up coding to meet the deadline. Last, meet the deadline, or go back into the pool...

    How the bejeezuz do you expect anything quality to come out of that process?

    I also asked about code re-use when I was there... Surprise surprise, did you know that its actually not mandated that any software reuse any code? In particular, standard library code! A nameless project had no less than 8 different hash table implementations that all did effectively the same thing!

    There are some old jokes that come to mind...

    At Microsoft, quality is job 1.1.

    If Bill Gates had a dollar for every time windows crashed... no wait, he does.

    Microsoft: Innvoation through Assimilation.

    and from my Microsoft mug circa 1986...

    Microsoft: One company does it all.

    --
    /\/\icro/\/\uncher
  153. Fixing the buffer overflow problem for good. by Ninja+Programmer · · Score: 1
    • If it were that simple, than there should be no buffer overflows in modern C/C++ programs. But it apparently isn't that simple, for several reasons. Using container libraries costs extra time and effort, and it is less efficient than error checking that is built into the compiler, for example. Also, using container libraries is not something that the C/C++ compilers help enforce; that is, if some module doesn't use it, nobody ever gets warned about it.
    False on ALL counts! Allow me to introduce you to the Better String Library for C and C++. This library handles strings and growable block buffers in general.
    • Because of its superior API (closer to higher level languages, and a superset of what C/C++ has to offer) it is Easier to use than the C/C++ alternatives. (The functions do more and do things that other languages have done with strings for a long time.)
    • Because of its superior architecture (length delimited) and implementation (uses the fastest corners of the state of the art in C/C++ compiler technology) it is Faster than the C/C++ alternatives. (I've got the benchmark numbers to prove it)
    • It comes with the optional bsafe module that creates link overrides to the standard C library functions where buffer overflows occurr most often and which are redundant to functionality in the Better String Library. I.e., deprecation of bad C library routines can be Enforced.
    • And, of course, the API is completely buffer overflow safe.
    This library has been thoroughly tested, its portable, its open source , and is currently used in projects such as Myriad and the Small Language. I assert that moving away from C/C++ in an attempt to escape buffer overflows is not only misguided, but unnecessary if you use the the Better String Library. The whole "using C/C++ inevitably leads to buffer overflows" idea gets thrown out the window if you are using it. I would encourage any C/C++ programmer to try it out before concluding that you need to move away from C/C++.
    1. Re:Fixing the buffer overflow problem for good. by geg81 · · Score: 1

      I assert that moving away from C/C++ in an attempt to escape buffer overflows is not only misguided, but unnecessary if you use the the Better String Library.

      Your better string library only deals with strings, but buffer overflows occur in many different data types. And C/C++ make it easy to make a large number of other mistakes that lead to safety and/or security problems. And even within your better string library, you still require programmers to be rather careful.

      The whole "using C/C++ inevitably leads to buffer overflows" idea gets thrown out the window if you are using it.

      C/C++ does not lead inevitably to buffer overflows. In fact, there are many programming styles one can adopt in C/C++ that avoid buffer overflows and other common errors altogether. Your better string library doesn't even get close to what is possible with careful, high-quality coding in C/C++.

      However, the problem with C/C++ is not what it can't do, it's all the stuff that it can do. Your code may be OK and my code may be OK, but 99% of the code out there isn't.

    2. Re:Fixing the buffer overflow problem for good. by Ninja+Programmer · · Score: 1
      • Your better string library only deals with strings, but buffer overflows occur in many different data types. And C/C++ make it easy to make a large number of other mistakes that lead to safety and/or security problems.
      Two points: 1) The Better String Library expands the definition of strings to include any continguous binary sequence (including embedded '\0's). It uses this fact to implement a more powerful and abstract file stream as well, for example (it works with binary files, and has an infinite "ungetc()"). 2) Research by David Wagner (a well known cryptographer) and others have determined that string buffer overflows are the vast majority of all buffer overflow related problems -- in fact the functions in the bsafe module in the Better String Library correspond exactly to the functions most likely to be involved in a buffer overflow problem.

      • And even within your better string library, you still require programmers to be rather careful.
      Uhh ... well in C/C++ you always have be somewhat careful because of silly things like dereferencing a pointer before its initialized. But other than that using the Better String Library takes care of so much of the details automatically. The programmer's carefulness can be redirected to higher level concerns, and more typical concerns of the core C/C++ programming language. Let me be clear -- the Better String Library takes the pressure OFF the programmer with regards to string manipulation. So while I would never recommend that a programmer decrease their vigilance, the Better String Library can only increase their safety.
      • Your better string library doesn't even get close to what is possible with careful, high-quality coding in C/C++.
      Excuse me? can you cite something specific? I am not aware of any string library that is safer than the Better String Library.
    3. Re:Fixing the buffer overflow problem for good. by Anonymous Coward · · Score: 0

      Uhh ... well in C/C++ you always have be somewhat careful because of silly things like dereferencing a pointer before its initialized.

      Yes, and that is what still makes C/C++ a dangerous choice.

      Excuse me? can you cite something specific? I am not aware of any string library that is safer than the Better String Library.

      Gosh, you do have a one-track mind. Your string library doesn't address resource management issues, uninitialized pointers, and many other problems that occur in real-life C and C++ programs every day.

      Research by David Wagner (a well known cryptographer) and others have determined that string buffer overflows are the vast majority of all buffer overflow related problems

      Why should we settle for only the "vast majority of all buffer overflow related problems" when 40 year old technology can catch not only all the remaining buffer overflow problems but also most of the problems that the string library doesn't even addresses?

    4. Re:Fixing the buffer overflow problem for good. by Anonymous Coward · · Score: 0
      • Gosh, you do have a one-track mind. Your string library doesn't address resource management issues, uninitialized pointers, and many other problems that occur in real-life C and C++ programs every day.
      Ok, but doing leak protection in C/C++ while still being portable and thread safe is not so easy. Nevertheless technology such as the Boehm garbage collector exist which solves the memory leak problem for C/C++ in general. As to uninitialized pointers, its impossible to deal with them pervasively in C/C++, just as it is in Pascal or Ada (because freeing a pointer does not simultaneously remove any references to it), however, my library does come with a bstrDeclare() macro which reduces these problems as much as is possible.
      • Why should we settle for only the "vast majority of all buffer overflow related problems" when 40 year old technology can catch not only all the remaining buffer overflow problems but also most of the problems that the string library doesn't even addresses?
      Why does x86 dominate the desktop computing world instead of RISC? Because its faster and has an extremely large legacy software base as well as having the greatest number of tools for it. And its the same thing with C/C++. There is no solution 40 years old or otherwise which is simultaneously as fast as, or with the kind of support, or with the population of knowledgeable programmers as in the C/C++ community. My question that I'll throw back to you is, why abandon C/C++ when it is possible to solve its worst problems with a simple library?
    5. Re:Fixing the buffer overflow problem for good. by Anonymous Coward · · Score: 0

      Why does x86 dominate the desktop computing world instead of RISC? Because its faster and has an extremely large legacy software base as well as having the greatest number of tools for it

      Since almost all programming is done in HLLs these days, almost all that matters when it comes to processors is cost/performance. The only user-visible consequences of limitations of the x86 design are the difficulty of virtualization, but that doesn't matter.

      My question that I'll throw back to you is, why abandon C/C++ when it is possible to solve its worst problems with a simple library?

      I disagree that it is possible to "solve its worst problems". You can adopt careful programming styles and avoid most problems yourself, but most developers won't be able to do that consistently. Getting people to be more careful programmers is harder, in the end, than switching them over to something like Java, Eiffel, Oberon, C#, ObjectPascal, whatever, because getting them to use a safer and better-designed language guides them automatically towards not making the mistakes they are inclied to make.

      There is no solution 40 years old or otherwise which is simultaneously as fast as, or with the kind of support, or with the population of knowledgeable programmers as in the C/C++ community.

      C/C++ performance is overrated and easily matched or surpassed by other languages. As for knowledgeable programmers, if you have any problem switching to another language, you simply aren't "knowledgeable" to begin with.

      I dispute that available tools for C/C++ are the best; Java tools are already far better--it's just so much easier to develop tools for Java. C# is catching up fast. And many of the tools that there are for C/C++ are there to make up for its built-in deficiencies.

    6. Re:Fixing the buffer overflow problem for good. by Anonymous Coward · · Score: 0
      • Since almost all programming is done in HLLs these days, almost all that matters when it comes to processors is cost/performance. The only user-visible consequences of limitations of the x86 design are the difficulty of virtualization, but that doesn't matter.
      You are insane. Cyrix is dead because they offered the best cost/performance. Transmeta will follow them to the grave with their excellent cost/performance ratio. Alpha just went the other direction and also achieved excellent cost/performance. Designing a microprocessor optimized for cost/performance gets you killed. Backward compatibility is by *far* the highest concern. After that is stability and raw performance (which explains Cyrix and Transmeta). That's why Cyrix and Transmeta outlasted MIPS, and Sparc and Alpha were kept on lifesupport by businesses that had *other* things to sell. You would have to have been asleep for the past 15 years not to realize this.

      • I disagree that it is possible to "solve its worst problems". You can adopt careful programming styles and avoid most problems yourself, but most developers won't be able to do that consistently.
      That's just an assertion that you can't back up and which doesn't address my main argument that using a good library will solve most of these problems for you.

      • C/C++ performance is overrated and easily matched or surpassed by other languages.
      I have yet to see a credible example of this (except for Fortran where C99's restrict erases that advantage, so going forward its not an exception). Especially in the case of the Better String Library, I would defy you to find any solution anywhere that was within 50% of its performance on any of its inner loop function. Again an assertion that I am sure you cannot back up with any facts.
    7. Re:Fixing the buffer overflow problem for good. by Anonymous Coward · · Score: 0

      Alpha just went the other direction and also achieved excellent cost/performance.

      Alpha's cost/performance at the system level was awful, and so were those of most other non-x86 chips. It wasn't a question of design, it was a question of volume.

      Designing a microprocessor optimized for cost/performance gets you killed. Backward compatibility is by *far* the highest concern.

      Everybody builds chips optimized for cost/performance, since backwards compatibility simply has no significant influence on cost/performance anymore. The x86 instruction set on a modern processor is merely a wart on a whale.

      Intel just made a stunning demonstration of this with Itanium: their "improved" instruction set actually ended up making the processor far worse than what AMD easily achieved with a backwards-compatible instruction set.

      That's just an assertion that you can't back up and which doesn't address my main argument that using a good library will solve most of these problems for you.

      As I keep saying: I can write excellent C++ code that doesn't suffer from buffer overflows. So can lots of other people. The problem is that there are even more people who write lousy code no matter what you tell them. Better programming languages are there to protect us all from their lousy code.

      Especially in the case of the Better String Library, I would defy you to find any solution anywhere that was within 50% of its performance on any of its inner loop function. Again an assertion that I am sure you cannot back up with any facts.

      Your argument is self-defeating. If your "better string library" really gives people such amazing performance by calling it from C, then you can achieve the same performance by calling it from other languages.

      I have yet to see a credible example of this (except for Fortran where C99's restrict erases that advantage, so going forward its not an exception).

      Well, I'm so sorry that half a century of programming language evolution have passed you by, but that is really not something I can address.

    8. Re:Fixing the buffer overflow problem for good. by Anonymous Coward · · Score: 0
      • Alpha's cost/performance at the system level was awful, and so were those of most other non-x86 chips. It wasn't a question of design, it was a question of volume.
      When the Alpha first shipped, this was not the case. They simply delivered unbelievable performance, which meant they had a good cost/performance ratio. Its only at the end of the its life that the Alpha seemed to be a poor investment from a cost/performance point of view. Your Itanium example is non-sequitor to this discussion since it both has a terrible cost/performance ratio and unacceptable backwards compatibility. Itanium was more useful as marketing subterfuge (SGI discontinued MIPS with the intent of switching to Itanium, HP stopped production of PA-RISC as part of the deal of getting design access to Itanium, and DEC was simply too weak to keep supporting Alpha) than as a piece of technology (where the Power5 beats it at SpecFP, and Athlons beat it at SpecInt).

      No, I am talking about things like Arm/StrongArm. They are cheap, low power, etc. But they can only survive in special embedded environments. They cannot make it as a gamebox processor because they don't have enough raw performance.

      • As I keep saying: I can write excellent C++ code that doesn't suffer from buffer overflows. So can lots of other people. The problem is that there are even more people who write lousy code no matter what you tell them. Better programming languages are there to protect us all from their lousy code.
      But it is you who are not paying attention. If you use the Better String Library, it compells you to use its abstraction of strings/binary buffers. The API exposes very tightly controlled, but nevertheless very flexible functionality. Pretty much all the stupid things you see amateur programmers do when they try to program with raw arrays goes away. The nice functionality you see in other safe programming library have been duplicated in the Better String Library, so users will not find themselves "rolling their own" solutions for functionality (which is the real source of bugs) any more than they would if they were using another language.

      • Your argument is self-defeating. If your "better string library" really gives people such amazing performance by calling it from C, then you can achieve the same performance by calling it from other languages.
      First of all, there is no if about it. Go see the Benchmark Results for yourself. Second of all -- what higher level languages can do and what they actually do are two different things. No benchmark I have ever seen has shown any other language outperform C in string manipulation -- nevertheless I had no trouble implementing a library that beats all the standard C/C++ string libraries. Being a language designer or implementer is not the same thing as being a performance expert.

      • Well, I'm so sorry that half a century of programming language evolution have passed you by, but that is really not something I can address.
      Nowhere in this "evolution" have I seen an emphasis on performance -- at least not in the way that I define performance. For example, Java kills itself because of its non-optional unicode support, Pascal and Ada lack a comprehensive string API, Lisp always pays the run time type tag check penalty, Perl and Python are interpreted. Further evidence of other language's complete deference to C in performance is that so many modern programming languages use standard ANSI C backends (i.e., they compile to C). So if I beat the standard C/C++ library (which I do), yet all those languages predate the creation of the Better String Library, then how are they supposed to match its performance?
  154. the problem isn't bad coding by Anonymous Coward · · Score: 0

    The problem is bad architecture from the start. Its good user friendly ideas slapped onto a terribly insecure type of system.

  155. I think the "Features" play a big part. by Agent0013 · · Score: 1

    The programming bugs and OS security holes are a big part of the problem. But what about the so-called "features" that Microsoft desides to implement. Or rather how they deside to implement them. I am refering to the Outlook script execution that leads to so many worms spreading through the internet and the Active X "feature" in IE that lets so many spyware/adware programs find their way into a computer. Even the Word script execution that led to the Word viruses a while ago.

    If any of these "features" was indeed found necessary, (I'm not so sure that they all are) then they should have been implemented in a way that did not lead to so many security holes.

    The programming language choses is of little importance when the actual design provides for the security holes.

    --

    -- ssoorrrryy,, dduupplleexx sswwiittcchh oonn.. -Quote found on actual fortune cookie.
  156. comment on sig by kyliaar · · Score: 1

    Mr. Spock was the character from Star Trek.

    Dr. Spock is the author of books about raising kids.

  157. IE & Firefox Issue by Anonymous Coward · · Score: 0

    I don't have the time to read through every post here, so if somebody has mentioned my point already, I apologize.

    It seems to me that author of the article is stating that because both IE and Firefox are written in C/C++ that they have the same vulnerabilities. If this were the case, wouldn't Firefox be susceptible to the same attacks as IE?

  158. My reply to letters@bzmedia.com by AnythingButMicrosoft · · Score: 1

    Subj: Letters to the Editor Re: The Lessons of Software Monoculture http://www.sdtimes.com/opinions/guestview_113.htm I believe your article lost a lot of credibility with the line "What we have to understand is that our current problems with Internet Explorer have less to do with bugs than with success." So many make this mistake, it is easy to fall for the FUD that comes out of Microsoft. If this were true, then why is it nearly all of the severe and remotely exploitable web server hacks happen to Microsoft's IIS? Apache runs nearly 70% of Internet web servers, while Microsoft is a minor player at 21%. http://news.netcraft.com/archives/web_server_surve y.html While Apache users did have to deal with the Slapper worm some time ago, the high-profile IIS attacks are endless. Worms and other attacks against IIS have been blamed for a regional power outage, rendering ATM's across the country useless, and taking out entire airline operation centers to name a few. "But then what happens if Mozilla or the Mac get too popular?" you say? Apache is 'too popular' now, and has been for some time. But I don't see Apache in the headlines over...and over...and over...regarding vulnerabilities. Yes, nearly every piece of software has it flaws. But only Microsoft can stake a claim of costing society billions of dollars. (With IIS flaws alone) Sendmail delivers the majority of the Internet e-mail. There are competing e-mail solutions from GroupWise, Notes, on down to Eudora and a plethora of other POP3 clients. But why is it every e-mail virus is referred to as a Microsoft Outlook virus? Have you ever heard of a GroupWise virus? Any worm attacking Mozilla Mail? Word Perfect used to be the King of office suites, before that it was WordStar. There are still numerous alternatives to MS Office out there, with Open Office being the media's darling at the moment. But have you heard of anything called an "X" Document Macro Virus where "X" has equalled anything other than Microsoft Office? Microsoft macro viruses were infecting PCs long before MS totally dominated the office software sector. In light of this, do you _really_ believe the "Microsoft is such a big target, that's why they suffer from all the bugs" FUD?

  159. Jeff Duntemann is full of shit. by MerkX · · Score: 1

    This guy is nothing but a mouthpiece for Microsoft C#. The real problem with C/C++ is it has libraries developed by comities. The industry is polluted with poor programmers in general because no-can-do professors insist on using Java to teach under graduate computer science.

    Recall that most of the security bugs and buffer overruns in applications come from the standard runtime library (CRT) and NOT the native NT or Win32 APIs. Dinkumware and/or Microsoft could have done a much better job wrapping the CRT around Win32 here. And while I'm speaking out, the STL implementation that Plauger built is an absolute abomination (i.e. horse shit).

    Microsoft did not need to "invent" another language (Microsoft C#) - they needed to innovate a better runtime library, period!

    Perhaps Jeff's blame on the C/C++ language itself should be directed elsewhere.

    --
    -MerkX
  160. I personally think it is a growth problem by blat001 · · Score: 1

    I reckon this is in relation to a growth problem. Bugs start because code that was designed to do one thing is used for a variety of other things. Causing a component/function/method that was orginal designed to do something little ends up being a core function. E.g I wrote a function to check if a directory was a sub directory of another directory. (For a very small app that I was using on my desktop only) so there was very little error checking on the directory names. Now a little later on another nameless drone (developer) need to check if a directory was a sub directory so they copied the function from my code and started using it on a production system. Before you know it that code is being hacked by evil doers... Not really my fault is it ?

  161. Re:Popularity not the problem. by peewee69 · · Score: 1

    Formal methods, although useful, are not a silver bullet for producing bug free code. They may help to reduce bugs, but they cannot eliminate bugs completely. To quote Frederick Brooks from "No Silver Bullet: Essence and Accidents of Software Engineering" "Much of the effort in modern programming goes into testing and the repair of bugs. Is there perhaps a silver bullet to be found by eliminating the errors at the source, in the system-design phase? Can both productivity and product reliability be radically enhanced by following the profoundly different strategy of proving designs correct before the immense effort is poured into implementing and testing them? I do not believe we will find productivity magic here. Program verification is a very powerful concept, and it will be very important for such things as secure operating-system kernels. The technology does not promise, however, to save labor. Verifications are so much work that only a few substantial programs have ever been verified. Program verification does not mean error-proof programs. There is no magic here, either. Mathematical proofs also can be faulty. So whereas verification might reduce the program-testing load, it cannot eliminate it. More seriously, even perfect program verification can only establish that a program meets its specification. The hardest part of the software task is arriving at a complete and consistent specification, and much of the essence of building a program is in fact the debugging of the specification. "

  162. C Standard Library more pervasive than MS products by Anonymous Coward · · Score: 0

    Hmmm.. That's an interesting statement. The standard is more pervasive, yes. But any single implementation? No. Apart from Microsoft's ;)

  163. Some philosophical mumbo jumbo by John+Allsup · · Score: 1

    A monoculture is heavily structured on fixed rules.

    These rules may be used to the detriment of said monoculture. (In mathematics, the concept applied here is called diagonalisation.)

    The complexity issues in working around any flaw in the basic programming of the system, no matter how minor, will quickly balloon out of control.

    The only way to properly address these issues is to work from scratch, being very careful not to make wrong moves that cannot easily be undone.

    --
    John_Chalisque
  164. Re:C/C++ is **NOT** to blame for the problem by stoicio · · Score: 1

    The problem with a lot of programmers is they take something like stdio and think that's how it should be done. ie: FILE *file=NULL; char buffer[256]; file=fopen(filename,mode); if(file!=NULL) { fread(buffer,256,1,file); /*or worse fgets(buffer,256,file)*/ fclose(file); } First of all the buffer isn't dynamic and not wrapped or protected in any way. Second, if I read over the end of the buffer without remembering the allocation size I'm screwed. The buffer is never zeroed, so I don't know what's in it to start with. For a lot of programmers this is the normal technique. No structured data, lots of global variables, no planning, no modularity, no modular testing, no error checking, no code documentation. Spagetti! Let's hope they're not working on anything that's mission critical, like medical life support equipment.

  165. Level-headed article by LANjackal · · Score: 1

    For once there's a level-headed view of the current security problem that isn't written by another Linuxhead mouthing off. Phew.