Slashdot Mirror


Comparison of Java and .NET security

prostoalex writes "The Computer Science Department at the University of Virginia has published a comparative study of security in Java and .NET in Portable Document Format. DevMktg blog on MSDN summarizes the findings saying that due to careful design process, .NET presents security advantages over Java platform in several areas." From the article: "Where Java evolved from an initial platform with limited security capabilities, .NET incorporated more security capability into its original design. With age and new features, much of the legacy code of Java still remains for backwards compatibility including the possibility of a null SecurityManager, and the absolute trust of classes on the bootclasspath. Hence, in several areas .NET has security advantages over Java because of its simpler and cleaner design."

26 of 461 comments (clear)

  1. Had to switch from Java to .NET by TheShadowHawk · · Score: 3, Interesting

    Since starting in my new job, I had to switch from Java to .Net... so this is a little bit of good news. I guess....

    I still miss the Eclipse IDE though... Visual Studio blows chunks in comparison. :(

    --
    Friends don't let Friends use Internet Explorer.
    1. Re:Had to switch from Java to .NET by ars+matica · · Score: 2, Interesting

      Yes, and present to me how many VS users you know that have made a conscious switch to Eclipse?

    2. Re:Had to switch from Java to .NET by IWorkForMorons · · Score: 4, Interesting

      He doesn't know me...but I'm one...

      I have quite a number of years experience with VS6, more specifically VB6. Recently I started a job that, while not a programming role, allows me the time and flexibility to create programs to do my job how I want to code them. At first, since this an MS shop, I grabbed the .NET "Learning Edition" or whatever they're calling it nowadays. I understood that I wouldn't be able to create executables, but I could send my code to systems and get them to do it. After using the IDE for a couple of days, I found it so convoluted that I just gave up. Then I downloaded Eclipse with the Visual Class editor. Nice, simple, and it reminds me of the VB6 IDE. Only cleaner. Now I will say that I've had some problems with the Visual Class editor not rendering properly, but that hasn't stopped me from coding. In 2 weeks of coding on and off, I've created my first program and have been using it to do my job. Granted, it's not complex. Just does a database search and grabs data. But I still prefer the Ecplise IDE, even without the Visual Class editor working properly, over the VS.NET IDE. And I don't need to jump through MS' hoops just to get an executable. I'm distributing the program to the rest of the team next week after the boss tests it, and other departments are getting interested in it too. And with any luck, I'll get out of this support position and into a nice well-paid programming job at the same time.

    3. Re:Had to switch from Java to .NET by zootm · · Score: 2, Interesting

      As a contrary opinion, I've used both and found them both good in different areas. And I've certainly not found any difference in reliance on "Wizards" between the two packages.

      I've found that, in general, VS.NET is a little better integrated with its languages, whereas Eclipse has far superior refactoring support and integration with build processes (as you mention). 2005 is going some way to fixing this.

      They're both fantastic IDEs though. I'd recommend either (although the only C# plugin I've found for Eclipse is very, very basic so far, which is a real shame).

  2. Difference in ages by Anonymous Coward · · Score: 4, Interesting

    In the first page of the study they document the difference of age of .net and java. Java has been out for over 9 years, .net, 2-3. Let's see how .net is doing in number of vulnerabilities in 9 years.

    1. Re:Difference in ages by eCecuguru · · Score: 2, Interesting

      I agree with you, but also think the anoncow is right. The chart is misleading, indicating that java has oh so many cumulative holes. If we looked at Apache like that, it would be less secure than IIS. Also, was this strictly applets? Or was it all things ever written in Java? That's a lot of variations, platforms, etc, which although the fact that a java app will run differently on my mac versus my windows box is itself potentially unsecure, the fact that it has that capability beats the current functionality of .net. Which, IMO, brings this down to, the more functionality, the less secure it's going to be. Java has more functionality, it's inevitible it will be less secure.

    2. Re:Difference in ages by boa13 · · Score: 5, Interesting

      That's a lot of variations, platforms, etc,

      Actually, 10 of the 45 vulnerabilities that the authors chose to use in the chart were (or are?) in Microsoft JVM.

      I think including them in the chart is misleading at best.

  3. Totally bogus by Anonymous Coward · · Score: 4, Interesting

    Security in Java is multi layered and complex, you cannot possibly cover all its faces. ".Net" managed code is very rare and all .NET applications I know of (that are real applications) use native code thus removing any sense of security.
    Java has had years of full source code visibility (not open source) and had several holes plugged by the community, .NET has no such thing.
    Saying that .NET is more secure is just about the stupidest thing someone can say... Its like saying Windows is more secure than Linux since its newer than UNIX and Linux is based on UNIX.

  4. Age vs Usage by ErrorBase · · Score: 2, Interesting

    I've seen the crossplatform remarks already, but no one asked the question yet about how widespread implementations are. I currently see much more .Net implementations in Intranet environments, and java when the client is less known. my guess is that those more local implementations are much less scrutinized. opposed to the much more open and directly accesible implementations in java.

  5. Re:hardly objective by leakingmemory · · Score: 2, Interesting

    "The most widely publicized security issue in .NET was W32.Donut, a virus that took control of the excecutable before the .NET runtime had control. Since the vulnerability occurs before the .NET runtime takes control, we consider this a problem with the way the operating system transfers control to .NET, not with the .NET platform"

    Isn't the whole point with a VM that the executable will never be directly exposed to system resources? Why doesn't the same thing happen to JVM? As far as I can see, this reveals that the .NET system is having issues controling it's applications, which to me is a major security flaw.

  6. Re:.NET? Is this thing still around? by Anonymous Coward · · Score: 1, Interesting

    "Operator overloading, multiple inheritance? Are you crazy?"

    Operator overloading is great, as long as it is done in a sane fashion. If you define a class that can be added and subtracted, it helps greatly to be able to use '+' and '-' to do so. Multiple inheritance, otoh, is indeed a can of worms.

    "C++ sucks for that very reason when it comes to a production environment"

    I guess that accounts for why it never was a commercial success ;)

  7. Yeay! Security plus portability minus cost... by freeplatypus · · Score: 5, Interesting

    .NET
    price: free, You only need to have Windows 2003 Business Server for serious work
    secure: rtfa in few years to make sure
    portable: it runs on many systems, like Windows and ... Windows ... but not all of them.
    speed: well actually speedy on Windows machine
    IDE: brilliant Visual Studio, unfortunatelly no plugins

    Java
    price: free, well it is free
    secure: most likely as secure as Your application
    portable: well actually, even my SonyEricsson cell runs it :)
    speed: a bit clumsy, but hey, almost all >1GHz desktop PC can run Java application in very responsive manner (Eclipse, Netbeans, Azureus, etc.)
    IDE: Eclipse and/or Netbeans ROCKS!

    This reply seems biased, but well, almost every opinion will be biased.

  8. NASA World Wind uses .NET by Anonymous Coward · · Score: 2, Interesting

    As a side note NASA World Wind uses .NET:

    http://worldwind.arc.nasa.gov/

    It's similar to Google Earth, except that its 180MB and once you download it it tells you you need to upgrade your version of .NET, and another dialog pops up saying Direct X needs to be upgraded too. At this point, I decided not to continue. I don't fancy reading one of MS's EULAs, don't care to download one of their hulking tarballs, don't want Direct X changed in case it breaks something.

    Piece of shit Nasa, .NET is just a wrapper for Windows on the local machine, why didn't you just make native code you f**** idiots.

  9. Who needs programming language security? by Ulrich+Hobelmann · · Score: 2, Interesting

    Whatever that would be. Use an operating system that gives you memory protection, and even better: capabilities (rights to read/write files and other things), and you can run ANY program, written in ANY language, without the programs even being ABLE to do any harm.

    Oh, that would be too much of progress, wouldn't it?

  10. Re:Brr... by Anonymous Coward · · Score: 2, Interesting

    Well, I use .NET to build web apps which run on our corporate intranet. These are HR, purchasing, scheduling and budgeting apps that run a medium-sized film production company. We have a mix of clients (600+) - Linux, OSX and Windows - in roughly equal numbers that access these applications. Ironically, I picked .NET simply becaue we had the hardware and license resources available after consolidating a lot of W2K3 servers into a few Netapp filers. The browser we use is Firefox because it's the only one that really works in a uniform fashion across all platforms in a way you can predict and work with.

    So, my apps run on a bunch of Windows boxes behind the scenes, but ultimately using .NET has not meant lock-in to MS products, it's actually allowed us to use the best tools for the jobs in hand; .NET for the back-end code, Firefox as a browser, and any OS you need for your particular job. Has it locked us in to MS products? No.

    I'd agree with you about Mono though, it reminds me of many hair-losing moments I had a few years ago converting someone's classic ASP code to run on that Chilisoft approximation. Bits worked, bits didn't, and this is what I'd expect from Mono. YMMV though.

  11. I'm monopenxourcist on AMD64 recently,3 against 1. by Anonymous Coward · · Score: 1, Interesting
    mono-1.1.8.3.tar.gz +
    ikvm-0.14.tar.gz +
    eclipse-JDT-SDK-3.2M1.zip

    IS BETTER AND MORE SECURE than

    jdk-6_0-ea-bin-b49-linux-amd64-25_aug_2005.bin

    ;)

    By + + + J.C. Pizarro + + + ATH OK.

  12. Re:They looked at Java and improved it! by zootm · · Score: 2, Interesting

    Easier exception handling.

    Now, I'll grant it's easier (since you don't have to!), but in systems where reliability is a requirement the lack of checked exceptions can be a bit of a hassle, too easy to overlook and requiring good documentation (which, on the other hand, is a good thing).

    Transparency with the whole string class/primitive issue.

    Java does have autoboxing as of 5.0, but I know that's not really what you're on about. Being able to switch on strings and so on is handy though. Their special handling of strings seems a little "non-OO", but it eases development and is mighty handy.

    Really easy to create and catch events.

    Yes. Yes. Yes. Delegates are a fantastic construct.

  13. My take on the first 'graph' used by tod_miller · · Score: 4, Interesting

    Wow, look at their nice graph will you. Their first graph shows 'vunerabilities found' in Java VM's... nothing mentioned about patches... and 0 in .net...

    Now look at this: In this paper we explore the more optimistic hypothesis that .NET's design is fundamentally more secure than Java's

    So they have a bent from the start to discredit Java. Onto my point:

    Java is 10 years old. There are groups of people looking at Java VM code and multiple versions of VM's, all of which are bunged in here. These 'vunerabilities' are not even reflections on the fundemental paradigm of the Java security model.

    This article is FUD, and bad FUD to counter Goslings stand against the 'untrusted code' model of the .Net.

    No, quoting JNI is not relevant in that argument because JNI still works within the seucrity model, yet it allows native code to be interfaced with, that is a seperate issue, and akin to making a network call, and running code on another server.

    They then mark up 9 security vunerabilities listed with Microsoft 'but because the way they classify them they do not count for this paper' (paper is the new word, because papers sound academic, not like paid research).

    There are many possible explanations for the .NET platform's apparent lack of security vulnerabilities.
    One possibility is that .NET is a less desirable platform for attackers to compromise than Java so it has
    not received the scrutiny necessary to reveal vulnerabilities. This is unlikely, however, since the .NET
    framework is now provided as a Windows update. Since Windows has over 90% of the desktop market
    with a large number of machines using .NET, the .NET platform presents an attractive target.


    Well, yes, windows runs on 90% of desktops, I would say .net runs on 15% of that figure.

    From the available information, the one implementation that did have many of its own
    unique vulnerabilities was Microsoft's Java implementation,


    They even try and discredit sources that go against their ideas. 'from the available information' or is the a way of saying 'this might be worse than we imply'.

    I didn't want to dig deeper, I found the single statement copied into a marketting guys website (fuck the word blog) rather twatish of the guy.

    This is FUD, yet the people this is aimed at are those who will read the '.Net found to be more secure than Java!!!!111OMGLOL!!' on [insert one of the many microsoft run 'news' farms that are used to infect propoganda into the media].

    pteeesh.

    To confirm you're not a script,
    please type the word in this image: binomial

    random letters - if you are visually impaired, please email us at pater@slashdot.org

    --
    #hostfile 0.0.0.0 primidi.com 0.0.0.0 www.primidi.com 0.0.0.0 radio.weblogs.com
  14. Re:Brr... by rjshields · · Score: 2, Interesting
    In what way? In the way that for some bizarre reason I can't port to another platform in the future if I want to?
    Take the code and try to compile and run it on Linux. Go on.
    In the way that they are telling me what I can and can't do in the future?
    I'm merely stating the obvious that seems to have escaped your attention.
    I think you may be confusing lock-in with making a choice.
    I don't think so.
    In that way, whatever platform and development language I choose, I will always be 'locked in' according to people who use other products.
    No you won't.
    It's a stupid point to make.
    No it's not.
    I don't do what I do based on fitting the problem around the solution, I find a solution for a problem.
    This is revolutionary.
    .NET fits in with what I need to do infinitely better than any of the other languages you mention.
    Not just slightly better but infinitely better.
    And this isn't a choice I make based on products being made by specific companies or it being open source, or the cool geek technology buzzword of the month. Ultimately, it's not a choice I make by being a blinkered techie that has no understanding of the peripheral business aspects.
    Bully for you. I bet you're really proud of yourself.
    Incidentally, I'd compare .NET to J2EE, rather than Java
    As I suspect you're not interesting in comparing anything but in making statements like ".NET is infintely better" which makes you look like a complete fool, incidentally.
    and maybe point you towards Pythont for .NET and Perl .NET, both of which allow you to write in both languages for the .NET CLR.
    Why the fuck would I want to run Python or Perl under the CLR? I have no desire to be locked in like you, thanks very much.
    --
    In this world nothing is certain but death, taxes and flawed car analogies.
  15. Re:wow, i expect linux-touting crap when i open /. by Baggio · · Score: 2, Interesting

    I couldn't agree more. And I've been around long enough to know, look at my user ID.

    Why is it when you have an unpopular view point, you're considered a troll. Granted the opinion expressed didn't apply to the article directly, so it might be better modded as "off-topic", but it isn't as if there will be a /. article posted about how much it has been going down hill.

    How else is one going to express their viewpoint? /. seriously needs to return to the site of "Stuff that matters." Instead there are 20 articles posted a day and only a few of them are actually worthy of posting. Maybe there should be a recycling bin page you can go to which has all the drivel, leaving just the good stuff on the front... like a newspaper -- the crap should be shuffled to page 2 or more.

    --
    Time flies like an arrow;
    Fruit flies like a bananna
  16. I'm glad the word is getting out by callipygian-showsyst · · Score: 3, Interesting
    saying that due to careful design process, .NET presents security advantages over Java platform in several areas

    Microsoft did an excellet job with .NET. While we all like to make fun of Ballmer jumping up and down and saying "Developers...", Microsoft actually means it.

    Their tools, concepts, and design are *way* ahead of, say Xcode and Objective-C. It's painful for me when I have to do Mac development because everything's so backward.

    I would love it if other companies starting implementing C#/.NET/CLR products based on the ECMA standard (unlike Java, C#/.NET has been accepted by a neutral standards committee)...this would prevent Microsoft from changing the language drastically from release to release.

  17. Re:Except... it ONLY runs on Windows by NatteringNabob · · Score: 2, Interesting

    Java runs on Solaris/SPARC, Solaris/X86, Windows, MacOS, and Linux. As soon as Microsoft starts supplying .NET for those platforms, on similar terms to what Sun offers, then I'll consider using it. In addition, a GPL compatible RFND patent license for every 'invention' required to implement .NET and the framework would give them a step up on Java. Until then, I'll pass, thanks anyway.

  18. not an IDE fan, but... by namekuseijin · · Score: 2, Interesting

    ... i see you never used Borland Delphi.

    Having used many development tools like Emacs, VIM, SciTe, kate, Eclipse, Visual Studio.Net and Delphi, i gotta say Delphi is the best IDE i've used hands down.

    Simplicity and high productivity is the key here.

    You don't have tons of floating dialogues, icons, buttons and drop-downs poluting your interface just for no other reason than to show off and make you feel like your investment was well worth it

    No, just the right form designer, object inspector and class hierarchies, along with the project manager. Less bloat and complexity, more productivity...

    KISS.

    --
    I don't feel like it...
  19. should the language force security? by jonathanduty · · Score: 2, Interesting

    I'm not sure a language forcing security is a good thing. It seems to me writing secure systems is really the responsibility of the development team. Especially since different situations call for different security levels and methodologies.

  20. I hate to play the creditability card, but... by Bill_the_Engineer · · Score: 3, Interesting
    This paper is a paper from a Grad Student, with an endorsement from Dr. David Evans. These papers (despite what the author may think) are not definative and MUST be contrasted with other papers on the subject.

    With all due respect for the author(s), I have the following questions:

    Why the mis-leading chart so early in the paper? I believe a table may have been more appropriate.

    Why not have more peer-reviewed references? I see plenty of references from MSDN, and some from some conferences. But it looks like most of the arguments are being supported by non-peer reviewed sources.

    Why are there a SMALL number of peer-reviewed articles directly related to JAVA?

    Why are the peer-reviewed articles on JAVA so old? And most likely no longer relevant?

    What is the deployment history of .NET vs. Java? Market share? Security incidents (in the wild)?

    Why the microscopic view of JAVA's flaws and the lack of depth in .NET?

    Why isn't the dangers of native code discussed (.NET or JNI)?

    I do however like the information in Table 3... but what practical advantages do the "finer grained" security functions provided by .NET give the programmer or the end-user?

    I think it is a decent paper that maybe was turned in for an assignment. BTW, if the author has asbestos underwear and reads slashdot. Don't forget a short biography at the end of the paper next time. This gives the paper extra creditability.

    Regards, Bill

    --
    These comments are my own and do not necessarily reflect the views or opinions of my employer or colleagues...
  21. Re:In addition by doc+modulo · · Score: 2, Interesting

    Java is mined with software patents. The core of .NET was submitted to an international standards body which won't let any submissions be encumbered by non-freedom-adjusted patents. It would make the standards body irrelevant.

    In other words, Sun could pull the plug on an open-source rival version of Java in the US and Japan if it becomes the dominant programming platform. Microsoft won't be able to pull the patent card on the freedom versions of .NET

    Sun better shape up, they're losing, it's only guys like you that haven't caught on to the trap/mine that's keeping Java on the marketing/hype list #1

    In my humble opinion.

    --
    - -- Truth addict for life.