{"id":1464,"date":"2014-04-09T16:07:34","date_gmt":"2014-04-09T14:07:34","guid":{"rendered":"http:\/\/cerezo.name\/blog\/?p=1464"},"modified":"2024-10-14T13:25:50","modified_gmt":"2024-10-14T11:25:50","slug":"preventing-more-heartbleeds","status":"publish","type":"post","link":"https:\/\/cerezo.name\/blog\/2014\/04\/09\/preventing-more-heartbleeds\/","title":{"rendered":"Preventing more Heartbleeds"},"content":{"rendered":"<p style=\"text-align: justify;\">It\u2019s all over the news: a vulnerability has been found on OpenSSL that leaks memory contents on server and clients. Named <a href=\"http:\/\/heartbleed.com\/\" target=\"_blank\" rel=\"noopener\">Heartbleed<\/a>, it has a <a href=\"https:\/\/github.com\/openssl\/openssl\/commit\/96db9023b881d7cd9f379b0c154650d6c108e9a3\" target=\"_blank\" rel=\"noopener\">very simple patch<\/a>&nbsp;and some informative posts have already been written about it (<a href=\"http:\/\/www.troyhunt.com\/2014\/04\/everything-you-need-to-know-about.html\" target=\"_blank\" rel=\"noopener\">Troy Hunt<\/a>, <a href=\"https:\/\/blog.cryptographyengineering.com\/2014\/04\/08\/attack-of-the-week-openssl-heartbleed\/\" target=\"_blank\" rel=\"noopener\">Matthew Green<\/a>).<\/p>\n<p style=\"text-align: justify;\">What nobody is saying is that the real root cause is the lack of modern memory management in the C language: OpenSSL added a wrapper around <em>malloc()<\/em> to manage memory in a more secure and efficient way, effectively bypassing some improvements that have been made in this area during a decade; specifically, it tries to improve the reuse of allocated memory by avoiding to <em>free()<\/em> it. Now enter <a href=\"http:\/\/heartbleed.com\/\" target=\"_blank\" rel=\"noopener\">Heartbleed<\/a>: by a very simple bug (intentional or not), the attacker is able to retrieve chosen memory areas. What was the real use of that&nbsp;layer?<\/p>\n<p style=\"text-align: justify;\">Face it: it\u2019s a no-win situation. No matter how many ways these layers are going to be written, there will always be a chance for error. You can\u2019t have secure code in&nbsp;C.<\/p>\n<p style=\"text-align: justify;\">But re-writing and\/or throwing away thousands of security related programs written in C is no-brainer: the only way to securely run these programs is with the help of some <a href=\"http:\/\/en.wikipedia.org\/wiki\/Memory_debugger\" target=\"_blank\" rel=\"noopener\">memory debuggers techniques<\/a>, like those used by Insure++ or Rational Purify. For example, the next technical report contains a detailed analysis of some of these techniques that prevent these kind of vulnerabilities:<\/p>\n<p style=\"text-align: justify;\"><iframe src=\"\/\/docs.google.com\/viewer?url=http%3A%2F%2Fwww.cl.cam.ac.uk%2Ftechreports%2FUCAM-CL-TR-798.pdf&amp;hl=en_US&amp;embedded=true\" class=\"gde-frame\" style=\"width:100%; height:500px; border: none;\" scrolling=\"no\"><\/iframe>\n<\/p><p class=\"gde-text\"><a href=\"http:\/\/www.cl.cam.ac.uk\/techreports\/UCAM-CL-TR-798.pdf\" class=\"gde-link\">Download (<span class=\"caps\">PDF<\/span>, 1.<span class=\"caps\">99MB<\/span>)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It\u2019s all over the news: a vulnerability has been found on OpenSSL that leaks memory contents on server and clients. Named Heartbleed, it has a very simple patch&nbsp;and some informative posts have already been written about it (Troy Hunt, Matthew Green). What nobody is saying is that the real root cause is the lack&nbsp;of&nbsp;[\u2026]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"wp_typography_post_enhancements_disabled":false,"ngg_post_thumbnail":0},"categories":[6,15],"tags":[],"_links":{"self":[{"href":"https:\/\/cerezo.name\/blog\/wp-json\/wp\/v2\/posts\/1464"}],"collection":[{"href":"https:\/\/cerezo.name\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cerezo.name\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cerezo.name\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cerezo.name\/blog\/wp-json\/wp\/v2\/comments?post=1464"}],"version-history":[{"count":3,"href":"https:\/\/cerezo.name\/blog\/wp-json\/wp\/v2\/posts\/1464\/revisions"}],"predecessor-version":[{"id":1531,"href":"https:\/\/cerezo.name\/blog\/wp-json\/wp\/v2\/posts\/1464\/revisions\/1531"}],"wp:attachment":[{"href":"https:\/\/cerezo.name\/blog\/wp-json\/wp\/v2\/media?parent=1464"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cerezo.name\/blog\/wp-json\/wp\/v2\/categories?post=1464"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cerezo.name\/blog\/wp-json\/wp\/v2\/tags?post=1464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}