{"id":4264,"date":"2024-07-01T09:18:18","date_gmt":"2024-07-01T14:18:18","guid":{"rendered":"https:\/\/www.darkreading.com\/cloud-security\/apple-cocoapods-bugs-expose-apps-code-injection"},"modified":"2024-07-01T09:18:18","modified_gmt":"2024-07-01T14:18:18","slug":"apple-cocoapods-bugs-expose-millions-of-apps-to-code-injection","status":"publish","type":"post","link":"https:\/\/ddi.mohflo.net\/index.php\/2024\/07\/01\/apple-cocoapods-bugs-expose-millions-of-apps-to-code-injection\/","title":{"rendered":"Apple CocoaPods Bugs Expose Millions of Apps to Code Injection"},"content":{"rendered":"<div class=\"media_block\"><a href=\"https:\/\/i0.wp.com\/eu-images.contentstack.com\/v3\/assets\/blt6d90778a997de1cd\/blt1dfcbaa5f38a5e92\/667f705989e9241a594d893a\/Cocoa-inga_spence-Alamy.jpg?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/apple-cocoapods-bugs-expose-millions-of-apps-to-code-injection.jpg?w=640&#038;ssl=1\" class=\"media_thumbnail\"><\/a><\/div>\n<div><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/apple-cocoapods-bugs-expose-millions-of-apps-to-code-injection.jpg?w=640&#038;ssl=1\" class=\"ff-og-image-inserted\"><\/div>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">A near inconceivable number of Apple apps have been exposed to critical vulnerabilities in a popular dependency manager for years now.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">CocoaPods is a platform that developers in <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/www.darkreading.com\/endpoint-security\/apple-security-bug-opens-iphone-ipad-rce\" rel=\"noopener\">Apple&#8217;s ecosystem<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"> use to add and manage external libraries (called &#8220;pods&#8221;). It sports 100,000+ libraries used by more than three million apps, including the most popular ones in the world. A quick search on its website reveals packages relating to Instagram, X, Slack, AirBnB, Tinder, and Uber, to name just a few. This makes the pods prime targets for hackers, and <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/www.darkreading.com\/cyber-risk\/how-do-attackers-hijack-old-domains-and-subdomains\" rel=\"noopener\">the CocoaPods platform<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">\u2014should it contain some underlying, platform-wide vulnerability\u2014a bona fide money pit.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">Indeed, as revealed by E.V.A Information Security in a report on Monday, it turns out that the CocoaPods platform did contain <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/www.evasec.io\/blog\/eva-discovered-supply-chain-vulnerabities-in-cocoapods#technical-remediation-steps\" rel=\"noopener\">a trio of serious vulnerabilities<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">. The most severe of them\u2014CVE-2024-38366, a remote code execution (RCE) opportunity\u2014was assigned a critical 10 out of 10 CVSS rating. Another remarkable bug caused by pods without owners, CVE-2024-38368, earned a critical 9.3, and an 8.2 was given to the session verification-hijacking issue CVE-2024-38367.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">&#8220;The impact of this is enormous,&#8221; says E.V.A CEO and co-founder Alon Boxiner. &#8220;You can&#8217;t describe it in words. We don&#8217;t even know how to accumulate the numbers [of affected apps] because of CocoaPods&#8217; vast usage.&#8221;<\/span><\/p>\n<h2 class=\"ContentText ContentText_variant_h2 ContentText_align_left\" data-testid=\"content-text\" id=\"CocoaPods Mishandled APIs for a Decade\">CocoaPods Mishandled APIs for a Decade<\/h2>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">CocoaPods was first developed and released in 2011. Its current woes can be traced to 2014, when it replaced a GitHub-based authentication system with a new &#8220;<\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/github.com\/CocoaPods\/trunk.cocoapods.org\" rel=\"noopener\">Trunk<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">&#8221; server, which thereafter doubled as the platform&#8217;s centralized repository and distribution platform.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">Though Trunk promised benefits to security, scalability, and developer quality of life, the migration process was awkward. For example, shockingly, ownership over all pods was reset.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">&#8220;As part of the integration, some API&#8217;s were exposed\u2014including a front-end Web page\u2014to let business owners that were authenticated via their GitHub account claim their own pods,&#8221; recalls Reef Spector, E.V.A vice president of research. In other words, users reclaimed their pods by simply calling dibs.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">Many authors didn&#8217;t reclaim their pods at all. Thousands of dependencies were left &#8220;orphaned.&#8221; Over time still more were abandoned, as authors reneged on their ownership. <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/cocoapods.org\/owners\/7\" rel=\"noopener\">Thousands of pods remain ownerless today<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">The rub? The public API endpoint for claiming pods was still available nine years later.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">Anyone in possession of this knowledge could have, at any point from 2014 to 2023, claimed anyone else&#8217;s pod for themselves, modified it however they wished, and pushed that modification to any Apple apps that use it.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">What reasonable app would rely on an abandoned pod? It turns out: many, sometimes without noticing simply because it&#8217;s a dependency of yet another pod. E.V.A found evidence of orphaned pods in documentation for apps like Facebook, Safari, Microsoft Teams, TikTok, Snapchat, and many more.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">Remarkably, this wasn&#8217;t even the most severe bug they found.<\/span><\/p>\n<h2 class=\"ContentText ContentText_variant_h2 ContentText_align_left\" data-testid=\"content-text\" id=\"Max-Severity RCE Bug Tied to RubyGem\">Max-Severity RCE Bug Tied to RubyGem<\/h2>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">Ironically, CocoaPods&#8217; worst vulnerability lay with an open-source component it incorporated back in 2014 for validating user email addresses.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">Thanks to some vulnerable methods in the RubyGem package rfc-22, an attacker could have injected arbitrary malicious code into the address field during Trunk&#8217;s account validation process. The server would unknowingly run their arbitrary code, granting them carte blanche.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">At this stage, Spector explains, &#8220;I have complete access to the Trunk service\u2014every owner, every pod, unclaimed, claimed, it doesn&#8217;t really matter. I can take full ownership over them if I want to, I can edit them at runtime. So, for example, someone publishes a pod, and in the server I can hook to the pod specification and alter it to add malicious code. And that wouldn&#8217;t really be visible externally.&#8221;<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">The type of malicious code such an attacker could silently add to a pod would be limitless, and this is just one way they could take advantage of such access. They could use such access to shut down Trunk entirely, or steal session tokens from pod owners or CocoaPods itself.<\/span><\/p>\n<h2 class=\"ContentText ContentText_variant_h2 ContentText_align_left\" data-testid=\"content-text\" id=\"Needle in a Haystack\">Needle in a Haystack<\/h2>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">There&#8217;s no clear evidence that attackers have exploited any of the issues uncovered by the researchers and <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/blog.cocoapods.org\/CocoaPods-Trunk-RCEs-2023\/\" rel=\"noopener\">patched by CocoaPods<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"> in October.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">It&#8217;s worth noting, however, that the easily concealable nature of software supply chain bugs, combined with the sheer number of pods at risk for so long, would provide ample cover to anyone who has done so.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">Finding a CocoaPods exploit over the past decade would make finding a needle in a haystack seem easy, but that hasn&#8217;t happened. So instead, E.V.A recommends that any developers of apps that have relied on pods prior to last October (read: almost all Apple apps) should pursue six steps for remediation such as checking for orphaned pods and thoroughly reviewing <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/www.darkreading.com\/vulnerabilities-threats\/log4j-reveals-cybersecurity-s-dirty-little-secret\" rel=\"noopener\">all third-party code dependencies<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">Dark Reading has also reached out to Apple for comment.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">&#8220;CocoaPods is a perfect example of why we should take care of supply chain risk,&#8221; Boxiner says. &#8220;It&#8217;s not only about how you develop what you develop, but you also have dependencies [which can be] blind spots.&#8221;<\/span><\/p>\n<p><a href=\"https:\/\/www.darkreading.com\/cloud-security\/apple-cocoapods-bugs-expose-apps-code-injection\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A near inconceivable number of Apple apps have been exposed<\/p>\n","protected":false},"author":12,"featured_media":4265,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[809],"class_list":["post-4264","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-dark-reading"],"featured_image_urls":{"full":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/apple-cocoapods-bugs-expose-millions-of-apps-to-code-injection-scaled.jpg?fit=2560%2C1690&ssl=1",2560,1690,false],"thumbnail":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/apple-cocoapods-bugs-expose-millions-of-apps-to-code-injection-scaled.jpg?resize=150%2C150&ssl=1",150,150,true],"medium":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/apple-cocoapods-bugs-expose-millions-of-apps-to-code-injection-scaled.jpg?fit=300%2C198&ssl=1",300,198,true],"medium_large":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/apple-cocoapods-bugs-expose-millions-of-apps-to-code-injection-scaled.jpg?fit=640%2C423&ssl=1",640,423,true],"large":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/apple-cocoapods-bugs-expose-millions-of-apps-to-code-injection-scaled.jpg?fit=640%2C423&ssl=1",640,423,true],"1536x1536":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/apple-cocoapods-bugs-expose-millions-of-apps-to-code-injection-scaled.jpg?fit=1536%2C1014&ssl=1",1536,1014,true],"2048x2048":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/apple-cocoapods-bugs-expose-millions-of-apps-to-code-injection-scaled.jpg?fit=2048%2C1352&ssl=1",2048,1352,true],"chromenews-featured":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/apple-cocoapods-bugs-expose-millions-of-apps-to-code-injection-scaled.jpg?fit=1024%2C676&ssl=1",1024,676,true],"chromenews-large":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/apple-cocoapods-bugs-expose-millions-of-apps-to-code-injection-scaled.jpg?resize=825%2C575&ssl=1",825,575,true],"chromenews-medium":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/apple-cocoapods-bugs-expose-millions-of-apps-to-code-injection-scaled.jpg?resize=590%2C410&ssl=1",590,410,true]},"author_info":{"display_name":"Dark Reading","author_link":"https:\/\/ddi.mohflo.net\/index.php\/author\/darkreading\/"},"category_info":"<a href=\"https:\/\/ddi.mohflo.net\/index.php\/category\/uncategorized\/\" rel=\"category tag\">Uncategorized<\/a>","tag_info":"Uncategorized","comment_count":"0","jetpack_featured_media_url":"https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/apple-cocoapods-bugs-expose-millions-of-apps-to-code-injection-scaled.jpg?fit=2560%2C1690&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/posts\/4264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/comments?post=4264"}],"version-history":[{"count":0,"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/posts\/4264\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/media\/4265"}],"wp:attachment":[{"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/media?parent=4264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/categories?post=4264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/tags?post=4264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}