I just had a look at the current version, the 2024 edition, of the CWE Top 25 Most Dangerous Software Weaknesses. Based on the Common Weakness Enumeration weakness types, this list is updated regularly and reflects the most relevant weaknesses in software. Since 2019 this list is updated annually based on the recently observed vulnerabilities (documented as CVEs) and their mapping to weaknesses (CWE IDs) that resulted in these vulnerabilities.
The current version was published in mid-December 2024, and a look at the top weaknesses shows the same problems as every year. Back in pole position is CWE-79 (cross-site scripting), with CWE-787 (out-of-bounds write) in second place and CWE-89 (SQL injection) taking third place.
We can conclude that
Ok, that’s no surprise, but why is this the case? Are we still using so much legacy code, or is new software still developed, making the same mistakes as always? Don’t we have great programming languages and frameworks that will make it nearly impossible to run into these standard problems? Why are software developers not using these programming languages and frameworks? Probably, it’s a combination of both: A lot of software is still based on code developed 20 or more years ago, and switching to new programming languages and frameworks is not that easy.
Looking at the CWE Top 25 lists from the start in 2009 to the 2024 edition, we can certainly see that all the weaknesses can be broadly grouped into four categories:
Surely, software developers cannot learn about all the 900+ weakness types listed in the CWE database. But the good news is, they don’t need to. Focusing on the above-mentioned main categories and choosing programming languages and frameworks that help tackle these problems, can probably avoid 99 % of all weaknesses typically leading to the top vulnerabilities.
Maybe some nice AI tools can also help clean up the legacy code, which is still the foundation of many modern applications.
Something has to change if we don’t want to see the same CWE Top 25 entries for the next 15 years.