{"id":962,"date":"2016-10-18T21:46:05","date_gmt":"2016-10-19T04:46:05","guid":{"rendered":"https:\/\/outflux.net\/blog\/?p=962"},"modified":"2016-10-20T16:02:54","modified_gmt":"2016-10-20T23:02:54","slug":"security-bug-lifetime","status":"publish","type":"post","link":"https:\/\/outflux.net\/blog\/archives\/2016\/10\/18\/security-bug-lifetime\/","title":{"rendered":"Security bug lifetime"},"content":{"rendered":"<p>In several of my <a href=\"\/slides\/2016\/lss\/kspp.pdf\">recent presentations<\/a>, I&#8217;ve discussed the lifetime of security flaws in the Linux kernel. <a href=\"http:\/\/lwn.net\/Articles\/410606\/\">Jon Corbet did an analysis in 2010<\/a>, and found that security bugs appeared to have roughly a 5 year lifetime. As in, the flaw gets introduced in a Linux release, and then goes unnoticed by upstream developers until another release 5 years later, on average. I updated this research for 2011 through 2016, and used the <a href=\"http:\/\/bazaar.launchpad.net\/~ubuntu-security\/ubuntu-cve-tracker\/master\/files\">Ubuntu Security Team&#8217;s CVE Tracker<\/a> to assist in the process. The Ubuntu kernel team already does the hard work of trying to identify when flaws were introduced in the kernel, so I didn&#8217;t have to re-do this for the 557 kernel CVEs since 2011.<\/p>\n<p>As the <a href=\"http:\/\/bazaar.launchpad.net\/~ubuntu-security\/ubuntu-cve-tracker\/master\/view\/head:\/README\">README<\/a> details, the raw CVE data is spread across the <code>active\/<\/code>, <code>retired\/<\/code>, and <code>ignored\/<\/code> directories. By scanning through the CVE files to find any that contain the line &#8220;Patches_linux:&#8221;, I can extract the details on when a flaw was introduced and when it was fixed. For example <a href=\"http:\/\/bazaar.launchpad.net\/~ubuntu-security\/ubuntu-cve-tracker\/master\/view\/head:\/active\/CVE-2016-0728#L38\">CVE-2016-0728<\/a> shows:<\/p>\n<pre class=\"brush:python\">\r\nPatches_linux:\r\n break-fix: 3a50597de8635cd05133bd12c95681c82fe7b878 23567fd052a9abb6d67fe8e7a9ccdd9800a540f2\r\n<\/pre>\n<p>This means that CVE-2016-0728 is believed to have been introduced by <a href=\"https:\/\/git.kernel.org\/linus\/3a50597de8635cd05133bd12c95681c82fe7b878\">commit 3a50597de8635cd05133bd12c95681c82fe7b878<\/a> and fixed by <a href=\"https:\/\/git.kernel.org\/linus\/23567fd052a9abb6d67fe8e7a9ccdd9800a540f2\">commit 23567fd052a9abb6d67fe8e7a9ccdd9800a540f2<\/a>. If there are multiple lines, then there may be multiple SHAs identified as contributing to the flaw or the fix. And a &#8220;<code>-<\/code>&#8221; is just short-hand for the <a href=\"https:\/\/git.kernel.org\/linus\/1da177e4c3f41524e886b7f1b8a0c1fc7321cac2\">start of Linux git history<\/a>.<\/p>\n<p>Then for each SHA, I queried git to find its corresponding release, and made a mapping of release version to release date, wrote out the <a href=\"\/illustrations\/2016\/cve-lifetime.csv\">raw data<\/a>, and rendered graphs. Each vertical line shows a given CVE from when it was introduced to when it was fixed. Red is &#8220;Critical&#8221;, orange is &#8220;High&#8221;, blue is &#8220;Medium&#8221;, and black is &#8220;Low&#8221;:<\/p>\n<p><img decoding=\"async\" src=\"\/illustrations\/2016\/lifetime.png\" alt=\"CVE lifetimes 2011-2016\" \/><\/p>\n<p>And here it is zoomed in to just Critical and High:<\/p>\n<p><img decoding=\"async\" src=\"\/illustrations\/2016\/lifetime-high.png\" alt=\"Critical and High CVE lifetimes 2011-2016\" \/><\/p>\n<p>The line in the middle is the date from which I started the CVE search (2011). The vertical axis is actually linear time, but it&#8217;s labeled with kernel releases (which are pretty regular). The numerical summary is:<\/p>\n<ul>\n<li>Critical: 2 @ 3.3 years<\/li>\n<li>High: 34 @ 6.4 years<\/li>\n<li>Medium: 334 @ 5.2 years<\/li>\n<li>Low: 186 @ 5.0 years<\/li>\n<\/ul>\n<p>This comes out to roughly 5 years lifetime again, so not much has changed from Jon&#8217;s 2010 analysis.<\/p>\n<p>While we&#8217;re getting better at fixing bugs, we&#8217;re also adding more bugs. And for many devices that have been built on a given kernel version, there haven&#8217;t been frequent (or some times any) security updates, so the bug lifetime for those devices is even longer. To really create a safe kernel, we need to get proactive about <a href=\"http:\/\/kernsec.org\/wiki\/index.php\/Kernel_Self_Protection_Project\">self-protection technologies<\/a>. The systems using a Linux kernel are right now running with security flaws. Those flaws are just not known to the developers yet, but they&#8217;re likely known to attackers, as there have been prior boasts\/gray-market advertisements for at least <a href=\"http:\/\/seclists.org\/fulldisclosure\/2010\/Sep\/268\">CVE-2010-3081<\/a> and <a href=\"https:\/\/wikileaks.org\/hackingteam\/emails\/emailid\/227462\">CVE-2013-2888<\/a>.<\/p>\n<p>(Edit: see my <a href=\"\/blog\/archives\/2016\/10\/20\/cve-2016-5195\/\">updated graphs that include CVE-2016-5195<\/a>.)<\/p>\n<p style='text-align:left'>&copy; 2016, <a href=\"https:\/\/outflux.net\/blog\/\">Kees Cook<\/a>. This work is licensed under a <a rel=\"license\" href=\"http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\">Creative Commons Attribution-ShareAlike 4.0 License<\/a>.<br \/><a rel=\"license\" href=\"http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\"><img decoding=\"async\" alt=\"CC BY-SA 4.0\" style=\"border-width:0\" src=\"https:\/\/i.creativecommons.org\/l\/by-sa\/4.0\/88x31.png\" \/><\/a> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>In several of my recent presentations, I&#8217;ve discussed the lifetime of security flaws in the Linux kernel. Jon Corbet did an analysis in 2010, and found that security bugs appeared to have roughly a 5 year lifetime. As in, the flaw gets introduced in a Linux release, and then goes unnoticed by upstream developers until [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,18,21,6,14,19],"tags":[],"_links":{"self":[{"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/posts\/962"}],"collection":[{"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/comments?post=962"}],"version-history":[{"count":13,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/posts\/962\/revisions"}],"predecessor-version":[{"id":982,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/posts\/962\/revisions\/982"}],"wp:attachment":[{"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/media?parent=962"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/categories?post=962"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/outflux.net\/blog\/wp-json\/wp\/v2\/tags?post=962"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}