With the recent news that microsoft are releasing the source code for their ASP.NET Web API and web pages 1 I'm wondering,

Does having access to the source code of the underlying libraries a web applicaiton is built upon give a hacker an advantage, i.e. is it less secure than if the hacker didn't have the source?

I'm guessing not, as there are many successful open source web libraries/engines around, but then my question is why is it not an advantage?

1 Note that the source code for ASP.NET MVC has been available since version one.


3 Answers 3


Obviously, there is not one correct answer to this, but here are my thoughts on it:

It is an advantages for an attacker to have the source code. Black-Box testing/attacking is - for obvious reasons - harder. Knowing how things work exactly is always better than guessing how they might work. Also, tools that search the source for possible vulnerabilities, well they require the source ;)

But releasing the source also has advantages (at least in theory). More people will read the source code and bugs relevant to the security of the program will surface faster. This is obviously only an advantages under two conditions: 1. People actually DO read the source code and report issues. 2. The developers fix the issues in a timely manner. Both points are somewhat controversial. People behind the open source idea often suggest that point 1. happens a lot (which I am not that sure of) and practice shows that point 2. is not followed by many developers (however, if the vulnerability was published openly, any user is at least aware of it and can act accordingly).

So to summaries, it is definitely an advantage for an attacker to have the source code, but the more people review the source, the more bugs are hopefully fixed.

  • So in answer to my bolded question, it is an advantage, but not for long providing you keep updating to the latest version of the source (and the crowd actually fix the vulnerabilities). Have I got that about right? Mar 29, 2012 at 13:08
  • @George Basically, yes. Knowing the source makes attacks easier for the attacker, but the developers might decide to publish the source anyway as the security of it improves overall (and thus, the benefits outweight). And keeping to the newest version of anything is always a good idea for the end user.
    – tim
    Mar 29, 2012 at 13:16

The key here is that with closed source code, the onus is on protecting that code - attackers may try to steal the code, reverse engineer it, or just attack it. The internal processes should be designed to identify vulnerabilities and fix them, but the numbers are quite skewed:

  • Attackers: many Defenders: few

With open source code, there is a slightly increased risk that the attackers may identify new vulnerabilities, but importantly you end up with many more potential defenders identifying code vulnerabilities and informing the code writers:

  • Attackers: many Defenders: many

Have a look at this question comparing open and closed source as it may answer all your questions. If it does, we can close this one as a dupe.

  • 1
    Thanks for the link, there are lots of interesting answers (this probably is a dupe in that case). Mar 29, 2012 at 13:05

It is always possible to get the source code to a closed application.

Therefore, by a technicality, all source code is open-source. There is no such thing as "closed source".

It is best to assume that you source code has already been stolen by your adversaries.

  • 1
    "It is always possible to get the source code to a closed application." pls shed some light
    – Karthik
    Apr 2, 2012 at 6:46
  • 1
    I'm assuming he means things such as social manipulation, malware on developer's PCs, getting a job and walking away with the source, security breaches, .NET decompilation or any number of alternative ways that source gets leaked. Apr 3, 2012 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.