📜 ⬆️ ⬇️

What is wrong with vulnerabilities in C # projects?



This small note is an intermediate result on the search for already known vulnerabilities in open source C # projects. I wanted to look at code samples that would be vulnerable and cause another CVE, but it turned out that not everything is so simple ...

Background (vulnerabilities in C / C ++ projects)


I have already come across a similar task with regards to the C and C ++ programming languages, and I would like to make a small reference to the work done earlier, so that the essence of the question in the title becomes more understandable.

I will not go into the details, I will tell in several sentences. The previous goal was similar - to see which CVEs were found in open source C / C ++ projects, and find out whether PVS-Studio can find similar problems. According to the results of the work, I found some interesting vulnerabilities (and if I continued working in this direction, I’m sure I would find even more), which could be prevented by using PVS-Studio. The experiment ended successfully, and based on it I wrote the article " How can PVS-Studio help in finding vulnerabilities? ".
')
Convenient was the fact that the CVE description often included references to commits covering the vulnerability. Thus, looking at the history of code changes, it was possible to understand what the vulnerability is and how it was closed. As a result, the task was approximately to find something interesting among such corrections.

Summarizing the above, we can single out several points that define a CVE that is convenient for verification:


If CVE meets these requirements, it is likely to be available for detection using static source code analysis.

Vulnerabilities in C # projects


In the direction of searching for vulnerabilities in open source C # projects, I made several visits from various sides, but all of them did not bring the expected result.

The main information tools that I focused on were the CVE database and the CVE Details site (as well as Google, GitHub, reddit, StackOverflow).

Here are the main approaches that I used:


To my great surprise, all these approaches did not bring the expected result - a tiny number of vulnerabilities were found that also contained links to the source code so that you could understand exactly the essence of the problem.

Having experience of similar work with projects on C / C ++, that's what surprised me:


Conclusion


In general, I was surprised by this state of affairs regarding vulnerabilities in C # projects. Why are they so few? Why are there few examples of vulnerabilities that have been closed?

Is the situation really what it is? Or was there some flaw in my approaches that did not allow me to get the necessary result?

If you have examples of parsing the vulnerable code (documented, that is, having the CVE identifier) ​​or you notice some obvious flaw in my approach that did not allow you to get the expected results, please write me an email - vasiliev@viva64.com , with an interesting I will read your suggestions / comments.

List of found vulnerabilities


Below I provide a list of those vulnerabilities that would have both a CVE identifier and examples of vulnerable code. Perhaps they will be interesting / useful to someone. Also, if you want to suggest a link to the example code of vulnerabilities in the letter, please see if the identifier of this vulnerability is found in the list below.




If you want to share this article with an English-speaking audience, then please use the link to the translation: Sergey Vasiliev. What is Wrong with Vulnerabilities in C # Projects?

Read the article and have a question?
Often our articles are asked the same questions. We collected answers to them here: Answers to questions from readers of articles about PVS-Studio, version 2015 . Please review the list.

Source: https://habr.com/ru/post/341320/


All Articles