CWE Top 25 2022. Review of changes
Tags: security, news, cybersecurity, codequality
Published: 2022-07-29 15:25:15

The CWE Top 25 list reflects the most serious software security weaknesses\. I invite you to read the updated top list to become aware of the changes happened over the past year\.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fc2dytzxv5kms83mhdn9.png)

We position the PVS\-Studio analyzer not only as a tool for searching bugs in code but also as a tool for static application security testing \(SAST\) tool\. For a better understanding of trends and planning of diagnostic rules, there is nothing better than to look at the latest list of the most relevant security issues\. There are several such lists, for example, [OWASP Top 10](https://owasp.org/Top10/), [SANS Top 25](https://www.softwaretestinghelp.com/sans-top-20-security-vulnerabilities/), and the above\-mentioned [CWE Top 25](https://cwe.mitre.org/top25/)\.

By the way, last year we already wrote about changes in the CWE Top 25 2021 — you can find the article [here](https://pvs-studio.com/en/blog/posts/0869/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)\.

## A bit of theory

To better understand the context, let's brush up on some topics\. To do this, let's skim through the following points: 

* how does CVE differ from CWE;
* why do we need CVSS;
* what are NVD and KEV;
* how the CWE Top 25 2022 is ranked\.

If you feel CWE savvy, you can safely skip this section\. Otherwise, I strongly recommend that you refresh those points before you read the article\. Below is a rather free interpretation of some questions from [CWE FAQ](https://cwe.mitre.org/about/faq.html) and [CVE FAQ](https://cve.mitre.org/about/faqs.html):

**How does a software weakness differ from a software vulnerability?**

Weaknesses are defects, failures and other issues of implementation, design or architecture of the software that may lead to vulnerabilities\.

Vulnerabilities are errors that have already been found by someone\. Attackers may exploit these vulnerabilities to get access to a system or a network, to disrupt services, etc\.

**What is CWE and how is it different from CVE? How does CVSS figure here and where did KEV come from?**

* CWE \(Common Weakness Enumeration\) is a general [list](https://cwe.mitre.org/data/index.html) of security defects\.
* CVE \(Common Vulnerabilities and Exposures\) is a [list](https://cve.mitre.org/data/downloads/index.html) of vulnerabilities found in various software\.
* CVSS \(Common Vulnerability Scoring System\) is a numerical score that indicates the potential severity of a vulnerability \(CVE\)\. It is based on a standardized set of characteristics\.
* KEV \(Known Exploited Vulnerabilities\) is a [catalog](https://www.cisa.gov/known-exploited-vulnerabilities-catalog) of known exploited vulnerabilities\.

**Why do I need to know about CWE?**

Today, developers use CWE as the main tool when discussing the elimination and/or minimizing security defects in the architecture, design, code, and software implementation\. Organizations use CWE as a standard measure for evaluating software security verification tools and as a common baseline standard for identifying, preventing, and minimizing negative consequences\.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2589nsjp641pqk7dm7gq.png)

**What is CWE Top 25?**

CWE Top 25 is a list of the most dangerous and common defects\. These defects are dangerous because someone can easily find and exploit them\. Attackers can use them to disrupt the application's operation, steal data or even completely take over a system\. CWE Top 25 is a significant community resource that can help you get an idea of the currently most common and dangerous security defects\.

**What is an algorithm to compile and rank the CWE Top 25 list?**

The main sources for [this year's](https://cwe.mitre.org/top25/archive/2022/2022_cwe_top25.html) list were:

* data from U\.D National Vulnerability Database \(NVD\) for 2020–2021;
* the Known Exploited Vulnerabilities \(KEV\) catalog that was compiled in November 2021 by Cybersecurity and Infrastructure Security Agency \(CISA\)\.

The CWE team researches handled the obtained data according to the [View\-1003](https://cwe.mitre.org/documents/cwe_usage/guidance.html#view_1003) method to reduce the specificity of records\. For example, CWE\-122 \(Heap\-Based Buffer Overflow\) is converted to basic CWE\-787 \(Out\-of\-Bounds Write\)\. The CWE team also filtered the data and removed from the Top 25 list the following items:

* CVEs if they do not have a CVSS score;
* CVEs whose description is labeled "REJECT";
* CVEs without a mapping to any CWE;
* CVEs that are labeled with "CWE\-Other" or "NVD\-CWE\-noinfo"\.

Next, the team of researchers used their own formula to calculate the ranking order\. This formula takes into account the potential danger of exploit and the frequency, with which a defect \(CWE\) is the main cause of a vulnerability\. The team made the formula that way, so it normalizes the frequency and predicted severity relative to their minimum and maximum values\. To obtain the frequency of mentions, the formula calculates how many times CVE referred to CWE within the NVD\.

*Freq = \{count\(CWE\_X' ∈ NVD\) for each CWE\_X' in NVD\}*

*Fr\(CWE\_X\) = \(count\(CWE\_X ∈ NVD\) \- min\(Freq\)\) / \(max\(Freq\) \- min\(Freq\)\)*

Another important component of the scoring formula is a defect's severity\. The following formula calculates it: 

*Sv\(CWE\_X\) = \(average\_CVSS\_for\_CWE\_X \- min\(CVSS\)\) / \(max\(CVSS\) \- min\(CVSS\)\)*

At the end, the final score is calculated by multiplying the frequency of mention by the severity score\.

*Score\(CWE\_X\) = Fr\(CWE\_X\) \* Sv\(CWE\_X\) \* 100*

In general, the methodology of data analysis has not changed much this year\. But next year, the CWE team is planning more significant changes\. Here are some of them:

* support generation of more specialized lists, such as Top 25 for mobile applications, etc\.;
* consider changing the metrics used to generate the list to minimize some of the bias \(here are more [details](https://cwe.mitre.org/top25/archive/2022/2022_cwe_top25_supplemental.html#methodLimits)\);
* enhance the View\-1003 methodology;
* perform normalization using different views besides View\-1003\.
* if possible, perform more CVE \-\> CWE mappings to reduce the number of one\-off edits to the mapping data\.

You can find more information about the methodology of data preparation and analysis in the [supplemental details](https://cwe.mitre.org/top25/archive/2022/2022_cwe_top25_supplemental.html#methodDetails) pertaining to the CWE Top 25 list\.

**How big is the sampling this year?**

The dataset contained a total of 37,899 CVEs from the previous two calendar years\. 

**Is the Top 25 updated every year?**

Yes, it is updated annually\. For information about previous versions, visit CWE Top 25 [archive](https://cwe.mitre.org/top25/archive/)\.

**Who participates in the development of CWE Top 25?**

The CWE community includes individual researchers and representatives of numerous organizations, the scientific community, and government agencies\. They are all interested in elimination of software defects\. You can get a list of CWE Team members on the "[CWE Community Members](https://cwe.mitre.org/community/members.html)" page\.

Read more about classification on the [cwe\.mitre\.org](https://cwe.mitre.org/) website\.

## The situation today

Below is a table of correspondence between the CWE Top 25 2022 list and the PVS\-Studio diagnostic rules, divided by programming languages\. You can always check the most up\-to\-date table with CWE Top 25 coverage on our [website](https://pvs-studio.com/en/pvs-studio/sast/cwetop25/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)\.

|**\#**|**CWE ID**|**Name**|**Score**|**KEV**|**PVS\-Studio diagnostics**|
|---|---|---|---|---|---|
|1|[CWE\-787](https://cwe.mitre.org/data/definitions/787.html)|Out\-of\-bounds Write|64\.20|62|C\+\+: [V512](https://pvs-studio.com/en/w/v512/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V557](https://pvs-studio.com/en/w/v557/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V582](https://pvs-studio.com/en/w/v582/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V645](https://pvs-studio.com/en/w/v645/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)<br>C\#: [V3106](https://pvs-studio.com/en/w/v3106/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)<br>Java: [V6025](https://pvs-studio.com/en/w/v6025/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)|
|2|[CWE\-79](https://cwe.mitre.org/data/definitions/79.html)|Improper Neutralization of Input During Web Page Generation \('Cross\-site Scripting'\)|45\.97|2|C\#: [V5610](https://pvs-studio.com/en/w/v5610/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)|
|3|[CWE\-89](https://cwe.mitre.org/data/definitions/89.html)|Improper Neutralization of Special Elements used in an SQL Command \('SQL Injection'\)|22,11|7|C\#: [V5608](https://pvs-studio.com/en/w/v5608/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)|
|4|[CWE\-20](https://cwe.mitre.org/data/definitions/20.html)|Improper Input Validation|20,63|20|C\+\+: [V739](https://pvs-studio.com/en/w/v739/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V781](https://pvs-studio.com/en/w/v781/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V1010](https://pvs-studio.com/en/w/v1010/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V1024](https://pvs-studio.com/en/w/v1024/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V5009](https://pvs-studio.com/en/w/v5009/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)|
|5|[CWE\-125](https://cwe.mitre.org/data/definitions/125.html)|Out\-of\-bounds Read|17,67|1|C\+\+: [V512](https://pvs-studio.com/en/w/v512/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V557](https://pvs-studio.com/en/w/v557/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V582](https://pvs-studio.com/en/w/v582/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)<br>C\#: [V3106](https://pvs-studio.com/en/w/v3106/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)<br>Java: [V6025](https://pvs-studio.com/en/w/v6025/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)|
|6|[CWE\-78](https://cwe.mitre.org/data/definitions/78.html)|Improper Neutralization of Special Elements used in an OS Command \('OS Command Injection'\)|17\.53|32|C\+\+: [V1010](https://pvs-studio.com/en/w/v1010/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V5009](https://pvs-studio.com/en/w/v5009/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)<br>C\#: [V5616](https://pvs-studio.com/en/docs/warnings/v5616/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)|
|7|[CWE\-416](https://cwe.mitre.org/data/definitions/416.html)|Use After Free|15\.50|28|C\+\+: [V623](https://pvs-studio.com/en/w/v623/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V723](https://pvs-studio.com/en/w/v723/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V758](https://pvs-studio.com/en/w/v758/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V774](https://pvs-studio.com/en/w/v774/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V1017](https://pvs-studio.com/en/w/v1017/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)|
|8|[CWE\-22](https://cwe.mitre.org/data/definitions/22.html)|Improper Limitation of a Pathname to a Restricted Directory \('Path Traversal'\)|14\.08|19|C\#: [V5609](https://pvs-studio.com/en/w/v5609/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)|
|9|[CWE\-352](https://cwe.mitre.org/data/definitions/352.html)|Cross\-Site Request Forgery \(CSRF\)|11\.53|1|Coming in the future|
|10|[CWE\-434](https://cwe.mitre.org/data/definitions/434.html)|Unrestricted Upload of File with Dangerous Type|9,56|6|Coming in the future|
|11|[CWE\-476](https://cwe.mitre.org/data/definitions/476.html)|NULL Pointer Dereference|7,15|0|C\+\+: [V522](https://pvs-studio.com/en/w/v522/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V595](https://pvs-studio.com/en/w/v595/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V664](https://pvs-studio.com/en/w/v664/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V713](https://pvs-studio.com/en/w/v713/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V1004](https://pvs-studio.com/en/w/v1004/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)<br>C\#: [V3027](https://pvs-studio.com/en/w/v3027/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V3042](https://pvs-studio.com/en/w/v3042/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V3080](https://pvs-studio.com/en/w/v3080/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V3095](https://pvs-studio.com/en/w/v3095/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V3100](https://pvs-studio.com/en/w/v3100/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V3125](https://pvs-studio.com/en/w/v3125/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V3145](https://pvs-studio.com/en/w/v3145/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V3146](https://pvs-studio.com/en/w/v3146/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V3148](https://pvs-studio.com/en/w/v3148/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V3149](https://pvs-studio.com/en/w/v3149/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V3152](https://pvs-studio.com/en/w/v3152/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V3153](https://pvs-studio.com/en/w/v3153/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V3168](https://pvs-studio.com/en/w/v3168/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)<br>Java: [V6008](https://pvs-studio.com/en/w/v6008/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V6060](https://pvs-studio.com/en/w/v6060/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V6093](https://pvs-studio.com/en/w/v6093/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)|
|12|[CWE\-502](https://cwe.mitre.org/data/definitions/502.html)|Deserialization of Untrusted Data|6\.68|7|C\#: [V5611](https://pvs-studio.com/en/w/v5611/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)|
|13|[CWE\-190](https://cwe.mitre.org/data/definitions/190.html)|Integer Overflow or Wraparound|6,53|2|C\+\+: [V629](https://pvs-studio.com/en/w/v629/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V658](https://pvs-studio.com/en/w/v658/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V673](https://pvs-studio.com/en/w/v673/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V683](https://pvs-studio.com/en/w/v683/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V1026](https://pvs-studio.com/en/w/v1026/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V1028](https://pvs-studio.com/en/w/v1028/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V1083](https://pvs-studio.com/en/w/v1083/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V1085](https://pvs-studio.com/en/w/v1085/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V5004](https://pvs-studio.com/en/w/v5004/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V5005](https://pvs-studio.com/en/w/v5005/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V5006](https://pvs-studio.com/en/w/v5006/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V5007](https://pvs-studio.com/en/w/v5007/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V5010](https://pvs-studio.com/en/w/v5010/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V5011](https://pvs-studio.com/en/w/v5011/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)<br>C\#: [V3113](https://pvs-studio.com/en/w/v3113/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)<br>Java: [V6105](https://pvs-studio.com/en/w/v6105/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)|
|14|[CWE\-287](https://cwe.mitre.org/data/definitions/287.html)|Improper Authentication|6\.35|4|Coming in the future|
|15|[CWE\-798](https://cwe.mitre.org/data/definitions/798.html)|Use of Hard\-coded Credentials|5\.66|0|C\+\+: [V5013](https://pvs-studio.com/en/w/v5013/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)<br>C\#: [V5601](https://pvs-studio.com/en/w/v5601/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)<br>Java: [V5305](https://pvs-studio.com/en/w/v5305/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)|
|16|[CWE\-862](https://cwe.mitre.org/data/definitions/862.html)|Missing Authorization|5,53|1|Coming in the future|
|17|[CWE\-77](https://cwe.mitre.org/data/definitions/77.html)|Improper Neutralization of Special Elements used in a Command \('Command Injection'\)|5\.42|5|C\#: [V5616](https://pvs-studio.com/en/w/v5616/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)|
|18|[CWE\-306](https://cwe.mitre.org/data/definitions/306.html)|Missing Authentication for Critical Function|5\.15|6|Coming in the future|
|19|[CWE\-119](https://cwe.mitre.org/data/definitions/119.html)|Improper Restriction of Operations within the Bounds of a Memory Buffer|8\.85|6|C\+\+: [V512](https://pvs-studio.com/en/w/v512/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V557](https://pvs-studio.com/en/w/v557/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V582](https://pvs-studio.com/en/w/v582/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V769](https://pvs-studio.com/en/w/v769/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V783](https://pvs-studio.com/en/w/v783/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022), [V1004](https://pvs-studio.com/en/w/v1004/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)|
|20|[CWE\-276](https://cwe.mitre.org/data/definitions/276.html)|Incorrect Default Permissions|4\.84|0|Coming in the future|
|21|[CWE\-918](https://cwe.mitre.org/data/definitions/918.html)|Server\-Side Request Forgery \(SSRF\)|4\.27|8|C\#: [V5618](https://pvs-studio.com/en/w/v5618/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)|
|22|[CWE\-362](https://cwe.mitre.org/data/definitions/362.html)|Concurrent Execution using Shared Resource with Improper Synchronization \('Race Condition'\)|3\.57|6|Coming in the future|
|23|[CWE\-400](https://cwe.mitre.org/data/definitions/400.html)|Uncontrolled Resource Consumption|3\.56|2|Coming in the future|
|24|[CWE\-611](https://cwe.mitre.org/data/definitions/611.html)|Improper Restriction of XML External Entity Reference|3\.38|0|C\#: [V5614](https://pvs-studio.com/en/w/v5614/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)|
|25|[CWE\-94](https://cwe.mitre.org/data/definitions/94.html)|Improper Control of Generation of Code \('Code Injection'\)|3\.32|4|C\+\+: [V1076](https://pvs-studio.com/en/w/v1076/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)|



The table shows that the PVS\-Studio static analyzer now covers **68% \(17 out of 25\)** the CWE Top 25 2022 list\. Last year, the coverage was 52%\. Significant improvement in coverage over the year is a credit to the large number of SAST\-oriented diagnostic rules that were [released by PVS\-Studio over the past year](https://pvs-studio.com/en/docs/manual/0010/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)\.

## Changes in the CWE Top 25 over the past year

The biggest upshifts:

|**\#**|**CWE ID**|**Name**|**Position in 2021**|**Position in 2022**|**Annual change**|
|---|---|---|---|---|---|
|1|[CWE\-362](https://cwe.mitre.org/data/definitions/362.html)|Concurrent Execution using Shared Resource with Improper Synchronization \('Race Condition'\)|33|22|11▲|
|2|[CWE\-77](https://cwe.mitre.org/data/definitions/77.html)|Improper Neutralization of Special Elements used in a Command \('Command Injection'\)|25|17|8▲|
|3|[CWE\-400](https://cwe.mitre.org/data/definitions/400.html)|Uncontrolled Resource Consumption|27|23|4▲|
|4|[CWE\-476](https://cwe.mitre.org/data/definitions/476.html)|NULL Pointer Dereference|15|11|4▲|
|5|[CWE\-94](https://cwe.mitre.org/data/definitions/94.html)|Improper Control of Generation of Code \('Code Injection'\)|28|25|3▲|

The biggest downshifts:

|**\#**|**CWE ID**|**Name**|**Position in 2021**|**Position in 2022**|**Annual change**|
|---|---|---|---|---|---|
|1|[CWE\-522](https://cwe.mitre.org/data/definitions/522.html)|Insufficiently Protected Credentials|21|38|17▼|
|2|[CWE\-200](https://cwe.mitre.org/data/definitions/200.html)|Exposure of Sensitive Information to an Unauthorized Actor|20|33|13▼|
|3|[CWE\-732](https://cwe.mitre.org/data/definitions/732.html)|Incorrect Permission Assignment for Critical Resource|22|30|8▼|
|4|[CWE\-306](https://cwe.mitre.org/data/definitions/306.html)|Missing Authentication for Critical Function|11|18|7▼|

"Newbies" in the Top 25:

|**\#**|**CWE ID**|**Name**|**Position in 2021**|**Position in 2022**|**Annual change**|
|---|---|---|---|---|---|
|1|[CWE\-362](https://cwe.mitre.org/data/definitions/362.html)|Concurrent Execution using Shared Resource with Improper Synchronization \('Race Condition'\)|33|22|11▲|
|2|[CWE\-400](https://cwe.mitre.org/data/definitions/400.html)|Uncontrolled Resource Consumption|27|23|4▲|
|3|[CWE\-94](https://cwe.mitre.org/data/definitions/94.html)|Improper Control of Generation of Code \('Code Injection'\)|28|25|3▲|

And in the end — the defects that were dropped out of the CWE Top 25 in 2022:

|**\#**|**CWE ID**|**Name**|**Position in 2021**|**Position in 2022**|**Annual change**|
|---|---|---|---|---|---|
|1|[CWE\-200](https://cwe.mitre.org/data/definitions/200.html)|Exposure of Sensitive Information to an Unauthorized Actor|20|33|13▼|
|2|[CWE\-522](https://cwe.mitre.org/data/definitions/522.html)|Insufficiently Protected Credentials|21|23|2▼|
|3|[CWE\-732](https://cwe.mitre.org/data/definitions/732.html)|Incorrect Permission Assignment for Critical Resource|22|30|8▼|



Key points:

* the top ten places remain fairly stable;
* CWE\-787 \(Out\-of\-bounds Write\) still holds the lead;
* CWE\-502 \(Deserialization of Untrusted Data\) and CWE\-862 \(Missing Authorization\) are steadily rising to the top year by year;
* this year, CWE\-362 \(Concurrent Execution using Shared Resource with Improper Synchronization \('Race Condition'\)\) broke into the top, immediately rising by 11 places compared to last year;
* CWE\-306 \(Missing Authentication for Critical Function\) that appeared in 2020 and skyrocketed last year, dropped this year;
* the largest downward movement was marked by CWE\-522 \(Insufficiently Protected Credentials\), which fell down by 17 points at once\.

## Below the top

As a bonus, let's see what defects did not make it into the 2022 CWE Top 25 and may well enter the top next year:

|**\#**|**CWE ID**|**Name**|**Score**|**KEV**|**Annual change**|
|---|---|---|---|---|---|
|26|[CWE\-295](https://cwe.mitre.org/data/definitions/295.html)|Improper Certificate Validation|3\.12|2|\-|
|27|[CWE\-427](https://cwe.mitre.org/data/definitions/427.html)|Uncontrolled Search Path Element|3\.12|0|7▲|
|28|[CWE\-863](https://cwe.mitre.org/data/definitions/863.html)|Incorrect Authorization|3\.10|0|10▲|
|29|[CWE\-269](https://cwe.mitre.org/data/definitions/269.html)|Improper Privilege Management|3\.06|3|\-|
|30|[CWE\-732](https://cwe.mitre.org/data/definitions/732.html)|Incorrect Permission Assignment for Critical Resource|2\.93|1|8▼|
|31|[CWE\-843](https://cwe.mitre.org/data/definitions/843.html)|Access of Resource Using Incompatible Type \('Type Confusion'\)|2\.87|10|5▲|
|32|[CWE\-668](https://cwe.mitre.org/data/definitions/668.html)|Exposure of Resource to Wrong Sphere|2\.68|0|21▲|
|33|[CWE\-200](https://cwe.mitre.org/data/definitions/200.html)|Exposure of Sensitive Information to an Unauthorized Actor|2\.49|2|13▼|
|34|[CWE\-1321](https://cwe.mitre.org/data/definitions/1321.html)|Improperly Controlled Modification of Object Prototype Attributes \('Prototype Pollution'\)|2\.48|0|new|
|35|[CWE\-601](https://cwe.mitre.org/data/definitions/601.html)|URL Redirection to Untrusted Site \('Open Redirect'\)|2\.41|0|2▲|
|36|[CWE\-401](https://cwe.mitre.org/data/definitions/401.html)|Missing Release of Memory after Effective Lifetime|2\.39|0|4▼|
|37|[CWE\-59](https://cwe.mitre.org/data/definitions/59.html)|Improper Link Resolution Before File Access \('Link Following'\)|2\.38|4|6▼|
|38|[CWE\-522](https://cwe.mitre.org/data/definitions/522.html)|Insufficiently Protected Credentials|2\.25|0|17▼|
|39|[CWE\-319](https://cwe.mitre.org/data/definitions/319.html)|Cleartext Transmission of Sensitive Information|2\.15|0|4▼|
|40|[CWE\-312](https://cwe.mitre.org/data/definitions/312.html)|Cleartext Storage of Sensitive Information|2\.01|0|1▲|



Although these defects did not make it to the top, they are still important because under favorable circumstances they may turn into vulnerabilities\.

## Conclusion

I hope you enjoyed this article and understood the current terminology\.

Fortunately, static analyzers help us fight potential vulnerabilities\. Therefore, I invite you to[ download and test](https://pvs-studio.com/en/pvs-studio/try-free/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022) the PVS\-Studio static analyzer on your project\. Maybe a couple of CWEs crept into your code and are about to become CVE :\)

## Additional links

1. [PVS\-Studio: static code analysis technology](https://pvs-studio.com/en/blog/posts/0908/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)\.
1. [Technologies used in the PVS\-Studio code analyzer for finding bugs and potential vulnerabilities](https://pvs-studio.com/en/blog/posts/cpp/0592/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)\.
1. [Potential vulnerability](https://pvs-studio.com/en/blog/terms/6441/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)\.
1. [Zero\-day vulnerability](https://pvs-studio.com/en/blog/terms/6478/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)\.
1. [OWASP, vulnerabilities, and taint analysis in PVS\-Studio for C\#\. Stir, but don't shake](https://pvs-studio.com/en/blog/posts/csharp/0831/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)\.
1. [What is the difference between DevOps and DevSecOps?](https://pvs-studio.com/en/blog/posts/0710/?utm_source=dev_to&utm_medium=articles&utm_content=CWE_Top25_2022)