{"id":39333,"date":"2023-05-10T15:16:27","date_gmt":"2023-05-10T19:16:27","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=39333"},"modified":"2023-05-10T15:17:25","modified_gmt":"2023-05-10T19:17:25","slug":"code-signing-translocation-vulnerability","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2023\/05\/10\/code-signing-translocation-vulnerability\/","title":{"rendered":"Code Signing Translocation Vulnerability"},"content":{"rendered":"<p><a href=\"https:\/\/occamsec.com\/rotten-apples-macos-codesigning-translocation-vulnerability\/\">OccamSec<\/a> (in 2021):<\/p>\n<blockquote cite=\"https:\/\/occamsec.com\/rotten-apples-macos-codesigning-translocation-vulnerability\/\"><p>It is far easier, however, to break the codesigning system and sign your binary as an Apple binary. But let&rsquo;s get this straight: even though the machine will be aware that the LC_CODE_SIGNATURE LoadCommand is tainted, it will still execute.<\/p><p>[&#8230;]<\/p><p>The result is that we can perform arbitrary memory read and write using the Mach virtual memory APIs and inject code into system processes.<\/p><p>[&#8230;]<\/p><p>As of Friday, July 16th (perhaps earlier, with the release of Big Sur 11.4), it seems Apple issued a stealth patch against this exploit, without notifying us. Code signatures no longer show up via <code>codesign<\/code> or other tools, though the kernel is still able to recognize the &ldquo;detached code signature&rdquo;, as seen above. It seems that the code signature format may have changed; given tools such as &ldquo;Apparency&rdquo; say the code signature is in an invalid format; alongside my script + classic <code>dd<\/code> + <code>otool -l<\/code> refuse to spit out a valid code signature. As for why Apple has been so silent on the communications side of things, we don&rsquo;t know.<\/p><p>[&#8230;]<\/p><p>This band-aid patch essentially makes it possible for malware to hide a phony code signature, and does nothing on the kernel side to mitigate the vulnerability.<\/p><\/blockquote>\n\n<p>Note that the post refers to this as &ldquo;codesigning translocation,&rdquo; but this is completely separate from <a href=\"App Translocation in Ventura\">App<\/a> <a href=\"https:\/\/mjtsai.com\/blog\/2016\/06\/16\/gatekeeper-path-randomization\/\">Translocation<\/a>, though that is also related to code signing.<\/p>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2023\/05\/01\/secret-mac-security\/\">Secret Mac Security<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2021\/05\/24\/macos-11-4\/\">macOS 11.4<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>OccamSec (in 2021): It is far easier, however, to break the codesigning system and sign your binary as an Apple binary. But let&rsquo;s get this straight: even though the machine will be aware that the LC_CODE_SIGNATURE LoadCommand is tainted, it will still execute.[&#8230;]The result is that we can perform arbitrary memory read and write using [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2023-05-10T19:16:29Z","apple_news_api_id":"629fc74c-1717-49de-b688-73e19a8f045a","apple_news_api_modified_at":"2023-05-10T19:17:27Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/AYp_HTBcXSd62iHPhmo8EWg","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[466,2095,465,30,1891,48],"class_list":["post-39333","post","type-post","status-publish","format-standard","hentry","category-technology","tag-codesigning","tag-exploit","tag-gatekeeper","tag-mac","tag-macos-11-0","tag-security"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/39333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=39333"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/39333\/revisions"}],"predecessor-version":[{"id":39337,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/39333\/revisions\/39337"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=39333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=39333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=39333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}