Security Experts:

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.

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

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.

Cloud Security

VMware vRealize Log Insight vulnerability allows an unauthenticated attacker to take full control of a target system.

IoT Security

Lexmark warns of a remote code execution (RCE) vulnerability impacting over 120 printer models, for which PoC code has been published.

Mobile & Wireless

Apple rolled out iOS 16.3 and macOS Ventura 13.2 to cover serious security vulnerabilities.

Email Security

Microsoft is urging customers to install the latest Exchange Server updates and harden their environments to prevent malicious attacks.

Mobile & Wireless

Technical details published for an Arm Mali GPU flaw leading to arbitrary kernel code execution and root on Pixel 6.


Security researchers have observed an uptick in attacks targeting CVE-2021-35394, an RCE vulnerability in Realtek Jungle SDK.


Google has awarded more than $25,000 to the researchers who reported the vulnerabilities patched with the release of the latest Chrome update.