{"id":1628,"date":"2014-04-12T08:19:37","date_gmt":"2014-04-12T15:19:37","guid":{"rendered":"http:\/\/blog.mozilla.org\/security\/?p=1628"},"modified":"2016-09-30T02:52:23","modified_gmt":"2016-09-30T09:52:23","slug":"testing-for-heartbleed-vulnerability-without-exploiting-the-server","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/security\/2014\/04\/12\/testing-for-heartbleed-vulnerability-without-exploiting-the-server\/","title":{"rendered":"Testing for Heartbleed vulnerability without exploiting the server."},"content":{"rendered":"<p>Heartbleed is a serious vulnerability in OpenSSL that was disclosed on Tuesday, April 8th, and impacted any sites or services using OpenSSL 1.01 &#8211; 1.01.f and 1.0.2-beta1. Due to the nature of the bug, the only obvious way to test a server for the bug was an invasive attempt to retrieve memory&#8211;and this could lead to the compromise of sensitive data and\/or potentially crash the service.<\/p>\n<p>I developed a new test case that neither accesses sensitive data nor impacts service performance, and am posting the details here to help organizations conduct safe testing for Heartbleed vulnerabilities. While there is a higher chance of a false positive, this test should be safe to use against critical services.<\/p>\n<p>The test works by observing a specification implementation error in vulnerable versions of OpenSSL: they respond to larger than allowed HeartbeatMessages.<\/p>\n<p><em><b>Details:<\/b><\/em><br \/>\nOpenSSL was patched by <a href=\"https:\/\/github.com\/openssl\/openssl\/commit\/731f431497f463f3a2a97236fe0187b11c44aead\">commit 731f431<\/a>. This patch addressed 2 implementation issues with the <a href=\"https:\/\/tools.ietf.org\/html\/rfc6520\">Heartbeat extension<\/a>:<\/p>\n<ol>\n<li>HeartbeatRequest message specifying an erroneous payload length<\/li>\n<li>Total HeartbeatMessage length exceeding 2^14 (16,384 bytes)<\/li>\n<\/ol>\n<p>Newer versions of OpenSSL silently discard messages which fall into the above categories. It is possible to detect older versions of OpenSSL by constructing a HeartbeatMessage and not sending padding bytes. This results in the below evaluating true:<\/p>\n<pre>\/* Read type and payload length first *\/\r\nif (1 + 2 + 16 &gt; s-&gt;s3-&gt;rrec.length)\r\n  return 0; \/* silently discard *\/\r\n<\/pre>\n<p>Vulnerable versions of OpenSSL will respond to the request. However no server memory will be read because the client sent payload_length bytes.<\/p>\n<p>False positives may occur when all the following conditions are met (but it is unlikely):<\/p>\n<ol>\n<li>The service uses a library other than OpenSSL<\/li>\n<li>The library supports the Heartbeat extension<\/li>\n<li>The service has Heartbeat enabled<\/li>\n<li>The library performs a fixed length padding check similar to OpenSSL<\/li>\n<\/ol>\n<p>False negatives may occur when all the following conditions are met, and can be minimized by repeating the test:<\/p>\n<ol>\n<li>The service uses a vulnerable version of OpenSSL<\/li>\n<li>The Heartbeat request isn\u2019t received by the testing client<\/li>\n<\/ol>\n<p>I have modified the Metasploit openssl_heartbleed module to support the \u2018check\u2019 option.<\/p>\n<p>You can download the updated module at<br \/>\n<a href=\"https:\/\/github.com\/dchan\/metasploit-framework\/blob\/master\/modules\/auxiliary\/scanner\/ssl\/openssl_heartbleed.rb\">https:\/\/github.com\/dchan\/metasploit-framework\/blob\/master\/modules\/auxiliary\/scanner\/ssl\/openssl_heartbleed.rb<\/a><\/p>\n<p>We hope you can use this to test your servers and make sure any vulnerable ones get fixed!<\/p>\n<p>David Chan<br \/>\nMozilla Security Engineer<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Heartbleed is a serious vulnerability in OpenSSL that was disclosed on Tuesday, April 8th, and impacted any sites or services using OpenSSL 1.01 &#8211; 1.01.f and 1.0.2-beta1. Due to the &hellip; <a class=\"go\" href=\"https:\/\/blog.mozilla.org\/security\/2014\/04\/12\/testing-for-heartbleed-vulnerability-without-exploiting-the-server\/\">Read more<\/a><\/p>\n","protected":false},"author":1438,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[69,45499,610,73],"tags":[45493,45494,265,45495],"coauthors":[45547],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Testing for Heartbleed vulnerability without exploiting the server. - Mozilla Security Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.mozilla.org\/security\/2014\/04\/12\/testing-for-heartbleed-vulnerability-without-exploiting-the-server\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"mozilla\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.mozilla.org\/security\/2014\/04\/12\/testing-for-heartbleed-vulnerability-without-exploiting-the-server\/\",\"url\":\"https:\/\/blog.mozilla.org\/security\/2014\/04\/12\/testing-for-heartbleed-vulnerability-without-exploiting-the-server\/\",\"name\":\"Testing for Heartbleed vulnerability without exploiting the server. - Mozilla Security Blog\",\"isPartOf\":{\"@id\":\"https:\/\/blog.mozilla.org\/security\/#website\"},\"datePublished\":\"2014-04-12T15:19:37+00:00\",\"dateModified\":\"2016-09-30T09:52:23+00:00\",\"author\":{\"@id\":\"https:\/\/blog.mozilla.org\/security\/#\/schema\/person\/70ae25c16f09d053c6d8b5eac29dbda9\"},\"breadcrumb\":{\"@id\":\"https:\/\/blog.mozilla.org\/security\/2014\/04\/12\/testing-for-heartbleed-vulnerability-without-exploiting-the-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.mozilla.org\/security\/2014\/04\/12\/testing-for-heartbleed-vulnerability-without-exploiting-the-server\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.mozilla.org\/security\/2014\/04\/12\/testing-for-heartbleed-vulnerability-without-exploiting-the-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.mozilla.org\/security\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Testing for Heartbleed vulnerability without exploiting the server.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.mozilla.org\/security\/#website\",\"url\":\"https:\/\/blog.mozilla.org\/security\/\",\"name\":\"Mozilla Security Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.mozilla.org\/security\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.mozilla.org\/security\/#\/schema\/person\/70ae25c16f09d053c6d8b5eac29dbda9\",\"name\":\"mozilla\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.mozilla.org\/security\/#\/schema\/person\/image\/98138a294cb6e19a68b02ef8ca9be2dc\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/75d2017e019c87560fe5d148a64659dc?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/75d2017e019c87560fe5d148a64659dc?s=96&d=identicon&r=g\",\"caption\":\"mozilla\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Testing for Heartbleed vulnerability without exploiting the server. - Mozilla Security Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.mozilla.org\/security\/2014\/04\/12\/testing-for-heartbleed-vulnerability-without-exploiting-the-server\/","twitter_misc":{"Written by":"mozilla","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/blog.mozilla.org\/security\/2014\/04\/12\/testing-for-heartbleed-vulnerability-without-exploiting-the-server\/","url":"https:\/\/blog.mozilla.org\/security\/2014\/04\/12\/testing-for-heartbleed-vulnerability-without-exploiting-the-server\/","name":"Testing for Heartbleed vulnerability without exploiting the server. - Mozilla Security Blog","isPartOf":{"@id":"https:\/\/blog.mozilla.org\/security\/#website"},"datePublished":"2014-04-12T15:19:37+00:00","dateModified":"2016-09-30T09:52:23+00:00","author":{"@id":"https:\/\/blog.mozilla.org\/security\/#\/schema\/person\/70ae25c16f09d053c6d8b5eac29dbda9"},"breadcrumb":{"@id":"https:\/\/blog.mozilla.org\/security\/2014\/04\/12\/testing-for-heartbleed-vulnerability-without-exploiting-the-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.mozilla.org\/security\/2014\/04\/12\/testing-for-heartbleed-vulnerability-without-exploiting-the-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.mozilla.org\/security\/2014\/04\/12\/testing-for-heartbleed-vulnerability-without-exploiting-the-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.mozilla.org\/security\/"},{"@type":"ListItem","position":2,"name":"Testing for Heartbleed vulnerability without exploiting the server."}]},{"@type":"WebSite","@id":"https:\/\/blog.mozilla.org\/security\/#website","url":"https:\/\/blog.mozilla.org\/security\/","name":"Mozilla Security Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.mozilla.org\/security\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog.mozilla.org\/security\/#\/schema\/person\/70ae25c16f09d053c6d8b5eac29dbda9","name":"mozilla","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.mozilla.org\/security\/#\/schema\/person\/image\/98138a294cb6e19a68b02ef8ca9be2dc","url":"https:\/\/secure.gravatar.com\/avatar\/75d2017e019c87560fe5d148a64659dc?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/75d2017e019c87560fe5d148a64659dc?s=96&d=identicon&r=g","caption":"mozilla"}}]}},"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/security\/wp-json\/wp\/v2\/posts\/1628"}],"collection":[{"href":"https:\/\/blog.mozilla.org\/security\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mozilla.org\/security\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/security\/wp-json\/wp\/v2\/users\/1438"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/security\/wp-json\/wp\/v2\/comments?post=1628"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/security\/wp-json\/wp\/v2\/posts\/1628\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/security\/wp-json\/wp\/v2\/media?parent=1628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/security\/wp-json\/wp\/v2\/categories?post=1628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/security\/wp-json\/wp\/v2\/tags?post=1628"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blog.mozilla.org\/security\/wp-json\/wp\/v2\/coauthors?post=1628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}