While performing software security assessments I have all too often run into developers that are constantly trying to explain away vulnerability findings. They spend way too much time trying to justify the code they have written and explain why it doesn’t need to be changed. All kinds of reasons are given. For example, the access is guarded by a network security device. If an intruder gains access to this we have bigger problems to deal with. While this could be true it is a mode of thinking that can lead to disaster when code is not written to be defensive.
I’d like to challenge developers to lay aside the “it can’t happen” attitude and instead have a “what if it does happen” mindset. Use the energy that it takes to explain away a risk to come up with a solution that will avoid the problem should it arise.
Three questions that a developer can ask themselves and address the answers head on will result in more secure software. They are:
- What would happen?
- What should happen?
- What could happen?
Let’s take a closer look at each of these.
What Would Happen?
What Should Happen?
What Could Happen?
These questions can lead you to thinking more about how to secure your code and less about what is protecting your application outside your code.