Connect with us

Hi, what are you looking for?


Application Security

Vulnerability in CocoaPods Dependency Manager Exposed Millions of Apps

A remote code execution vulnerability identified on the central CocoaPods server could have allowed an attacker to poison any package download, security researcher Max Justicz reveals.

A remote code execution vulnerability identified on the central CocoaPods server could have allowed an attacker to poison any package download, security researcher Max Justicz reveals.

A dependency manager for Swift and Objective-C Cocoa projects, CocoaPods has more than 82,000 libraries and is being used in over 3 million applications. The tool is built using Ruby and can be used with the default Ruby on macOS.

The identified vulnerability, Justicz explains, resides in a function designed to check that, when a package spec was uploaded to CocoaPods, it was not linking to a private repository.

In short: the manner in which the function checked the contents of a flag could have allowed an attacker to serve tailored content and abuse it to run commands.

The vulnerability was disclosed to CocoaPods on Monday, and a patch was deployed server-side on the same day.

“The exploit is a combination of un-sanitized user input getting through to a git call param which can be used to send remote payloads,” CocoaPods developer Orta Therox explains.

Successful exploitation of the flaw, he notes, could lead to the execution of arbitrary shell commands on the server, thus allowing an attacker to read environment variables and write to the CocoaPods/Specs repo or even read the trunk database.

While the patch was deployed server-side and CocoaPods installations were not affected, developers would still need to log in to the central repository of Podspecs (trunk) again and deploy any new Podspecs.

Advertisement. Scroll to continue reading.

The change also breaks automated deployments to CocoaPods and requires developers to replace their COCOAPODS_TRUNK_TOKEN. This, however, ensures that no one else has access to one’s pods.

The vulnerability was introduced in 2015 but, despite the long time during which the flaw resided on the server, the CocoaPods team doesn’t believe that the CocoaPods Specs repo has been tampered with. Furthermore, they say, there’s no proof that anyone has exploited the issue in the manner described by Justicz.

“However, just because it hasn’t been proved, doesn’t mean it hasn’t happened. 6 years is a long time. The worst case scenario is that an attacker could have used this technique to get access to our trunk database,” Therox notes.

While the trunk database contains email addresses that are already public, it also contains session keys, which could be used to allow unauthenticated users to connect to pods. Thus, CocoaPods is deleting all session keys, to prevent pod compromise.

“From the side of our investigation, we cannot automatically detect if someone has deployed a poisoned copy of a Pod,” Therox notes.

Related: Library Dependencies and the Open Source Supply Chain Nightmare

Related: Software Dependencies Exposed Microsoft, Apple to High-Impact Attacks

Related: GitHub Helps Developers Keep Dependencies Secure via Dependabot

Written By

Ionut Arghire is an international correspondent for SecurityWeek.

Click to comment


Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest threats, trends, and technology, along with insightful columns from industry experts.

Gain valuable insights from industry professionals who will help guide you through the intricacies of industrial cybersecurity.


Join us for an in depth exploration of the critical nature of software and vendor supply chain security issues with a focus on understanding how attacks against identity infrastructure come with major cascading effects.


Expert Insights

Related Content

Application Security

Cycode, a startup that provides solutions for protecting software source code, emerged from stealth mode on Tuesday with $4.6 million in seed funding.


Less than a week after announcing that it would suspended service indefinitely due to a conflict with an (at the time) unnamed security researcher...

Data Breaches

OpenAI has confirmed a ChatGPT data breach on the same day a security firm reported seeing the use of a component affected by an...

IoT Security

A group of seven security researchers have discovered numerous vulnerabilities in vehicles from 16 car makers, including bugs that allowed them to control car...


A researcher at IOActive discovered that home security systems from SimpliSafe are plagued by a vulnerability that allows tech savvy burglars to remotely disable...

Risk Management

The supply chain threat is directly linked to attack surface management, but the supply chain must be known and understood before it can be...


Patch Tuesday: Microsoft calls attention to a series of zero-day remote code execution attacks hitting its Office productivity suite.