1) When a vulnerability has been discovered by a security researcher? 2) While the vendor is working on a patch? 3) Right after the vulnerability has been disclosed and the patch announced?
If you answered 3, you win.
Once the patch has been released, any security researchers or cybercriminals worth their salt can reverse-engineer the patch and find the vulnerability to attack. Which they do -- within days, if not hours, and then, undoubtedly, begin attacking the legions of unpatched systems.
But you're thinking, "The software flaw was always there, and we've been susceptible all along to attack!"
You're just looking at one variable of the risk equation (note: Cost should be factored in for enterprises, but it's not necessary now):
Risk = Threat x Vulnerability
By this equation, when a vulnerability exists in a software application and no one knows about it, there's no risk because there's no threat to its exploitation. But once a vulnerability is discovered and more people know about it, the higher the risk. Too often in this industry, we all focus on Vulnerability and not Threat.
Now, let's assume that shiny new browser you installed -- we'll call it ExplorerFox Opera -- has 100 vulnerabilities the day it's released, but no one knows that they're there. You're risk to attack is now low.
But in a few days criminal hackers find 10 flaws to exploit. Your risk is now high, and attackers begin infecting people with keystroke loggers and spyware. A week later, white-hat security researchers find 10 -- completely different flaws -- and they call the makers of ExplorerFox Opera to have patches made, and within a month or two all of those flaws found by the white hats are patched. How much more secure are you now? You're still at risk from the 10 vulnerabilities being attacked in the underground, and there are 80 flaws still left to be discovered by good and bad guys alike. Who will find them?
But wait, the show goes on: News reports start surfacing of those 10 zero-day flaws being actively exploited, and the makers of ExplorerFox Opera rush out a set of new patches to fix those.
But security researchers find that those patches actually create more vulnerabilities than they fixed ...
If only we built and maintained buildings, cars, airplanes, oil refineries, and nuclear power plants this way.