I've always wondered: if you take the cause of each CVE, look at underlying cause of that & repeat, how many essential root problems would you be left with?
"Can't do math" (off-by-1 errors etc)
"Sanitize your inputs" (escape sequences, parsing etc)
"What are you referencing?" (null pointers, use-after-free etc)
and error handling. Plain error codes bubbling up a call stack, or bypassing that somehow which may violate program structure.
> I've always wondered: if you take the cause of each CVE, look at underlying cause of that & repeat, how many essential root problems would you be left with?
It's almost always memory safety violations. The rest are basically application-level bugs, like not properly checking inputs.
These are bug classes that are handled by reasonable programming languages since decades ago, so can be reduced to failing in choice of tools and risk management practices.
But root cause is a flawed concept, there's almost never one root cause.
time of check/time of use issues _might_ be considered "What are you referencing" but the arrow of time feels so important there that I'd consider it its own class
"sanitize your inputs" means you have to know what the output is ahead of time, and that you'll never output any other way. It also means false positives. It can actually be harmful if done wrong (double escaping, escaping that certain systems don't understand) but there's some basic forms that probably aren't too bad. It's generally pointless, though, since...
"escape your outputs" works for all data and is actually achievable. It means even escaping data that was never an "input" from the outside the system, even developer-created data, which absolutely can (and does) cause problems to ignore.
I've always wondered: if you take the cause of each CVE, look at underlying cause of that & repeat, how many essential root problems would you be left with?
"Can't do math" (off-by-1 errors etc)
"Sanitize your inputs" (escape sequences, parsing etc)
"What are you referencing?" (null pointers, use-after-free etc)
and error handling. Plain error codes bubbling up a call stack, or bypassing that somehow which may violate program structure.
How many of these fundamental issues are there?
> I've always wondered: if you take the cause of each CVE, look at underlying cause of that & repeat, how many essential root problems would you be left with?
It's almost always memory safety violations. The rest are basically application-level bugs, like not properly checking inputs.
These are bug classes that are handled by reasonable programming languages since decades ago, so can be reduced to failing in choice of tools and risk management practices.
But root cause is a flawed concept, there's almost never one root cause.
time of check/time of use issues _might_ be considered "What are you referencing" but the arrow of time feels so important there that I'd consider it its own class
"sanitize your inputs" means you have to know what the output is ahead of time, and that you'll never output any other way. It also means false positives. It can actually be harmful if done wrong (double escaping, escaping that certain systems don't understand) but there's some basic forms that probably aren't too bad. It's generally pointless, though, since...
"escape your outputs" works for all data and is actually achievable. It means even escaping data that was never an "input" from the outside the system, even developer-created data, which absolutely can (and does) cause problems to ignore.