Thread: More than 1 potential vulnerability per 4000 lines of code in Android

  1. #1
    Registered User
    Join Date
    Apr 2016
    Posts
    4

    Post More than 1 potential vulnerability per 4000 lines of code in Android

    A year after writing the article about checking Tizen, developers of the PVS-Studio static analyzer checked the quality of the operating system code again, this time demonstrating the abilities of their product to detect errors and potential security vulnerabilities in the Android code.

    Despite the fact that the Android code is of high quality and is well tested, and its development includes at least the use of Coverity static analyzer, PVS-Studio still managed to find a lot of interesting defects. Some errors are classified as CWE (Common Weakness Enumeration), which for a certain coincidence of circumstances can be used as vulnerability (CVE). That is why, if you want to protect your code from security vulnerabilities, you should find as many bugs as described in CWE and eliminate them.

    According to developers, PVS-Studio is a tool for static application security testing (SAST) and can detect many potential vulnerabilities before they caused harm. This article describes examples of errors by the following categories:


    • Pointless comparisons
    • Null pointer dereference
    • Private data is not cleared in memory
    • Unspecified/implementation-defined behavior
    • Incorrect memory control
    • Array index out of bounds
    • Broken loops
    • and so on.


    Thus, 490 CWE per 1855000 lines of code have been detected or more than 1 vulnerability per 4000 lines.

    Development of large complex projects is impossible without the use of programming methodologies and tools to help monitor the quality of the code. First of all, this is a literate coding standard, code reviews, unit tests, static and dynamic code analyzers. All this helps to detect defects in code at the earliest stages of development. Use additional programs and methods to control the quality of your code and make your product secure!

    Source - We Checked the Android Source Code by PVS-Studio, or Nothing is Perfect

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    What is the percentage of false positives?

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  3. #3
    Registered User
    Join Date
    Apr 2016
    Posts
    4
    We didn't calculate the percentage of false positives specifically for Android. Moreover, without a minimal analyzer configuration there it's useless to speak about the number of false positives. In some cases one unsuccessful macro can give thousands of false positives, but there is nothing crucial in it. These false positives can be immediately removed.

    After a configuration we can expect that the percentage of false positives will be about 10%. The example of such a situation is described in the article - Characteristics of PVS-Studio Analyzer by the Example of EFL Core Libraries, 10-15% of False Positives

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Does the Android SDK include an IDE for writing code?
    By Delicieuxz in forum General Discussions
    Replies: 3
    Last Post: 10-27-2013, 11:43 AM
  2. Hp 4000
    By madunix in forum C Programming
    Replies: 3
    Last Post: 05-05-2012, 03:23 PM
  3. Format String Vulnerability
    By wldrnryn in forum C Programming
    Replies: 1
    Last Post: 05-02-2012, 09:25 PM
  4. M$ JPG Vulnerability
    By Davros in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 09-27-2004, 01:40 AM
  5. What is 'buffer overrun vulnerability' in IIS?
    By Web admin in forum Windows Programming
    Replies: 1
    Last Post: 08-16-2001, 03:33 AM

Tags for this Thread