trunk.cocoapods.org is the authentication server for the CoacoaPods dependency manager. The part of trunk which verifies whether a user has a real email address on signup used a rfc-822 library which executes a shell command to validate the email domain MX records validity. It works via an DNS MX. This lookup could be manipulated to also execute a command on the trunk server, effectively giving root access to the server and the infrastructure. This issue was patched server-side with commit 001cc3a430e75a16307f5fd6cdff1363ad2f40f3 in September 2023. This RCE triggered a full user-session reset, as an attacker could have used this method to write to any Podspec in trunk.
During user registration, the trunk server validated email domain correctness by checking MX records in DNS using the rfc-822 library. This library executes a shell command to perform a DNS query. An attacker could craft an email address to inject an additional system command (command injection) that would be executed on the trunk server with root privileges. The attack required no authentication, user interaction, or special privileges — only sending a registration request with an appropriately constructed email field value.
Attackers gained full root access to the CocoaPods server and infrastructure, enabling modification of any Podspec files in the repository and allowing a supply chain attack targeting iOS and macOS applications using CocoaPods.
A patch was deployed on the server side in September 2023 via commit 001cc3a430e75a16307f5fd6cdff1363ad2f40f3. Following the incident, a full user session reset was performed. Administrators and users should review the official vendor statement at blog.cocoapods.org and verify the integrity of their dependencies according to the recommendations in the references.
The trunk.cocoapods.org server — the authentication server for the CocoaPods dependency manager. The vulnerability affected the server version running before the patch deployment (commit 001cc3a430e75a16307f5fd6cdff1363ad2f40f3).
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:HCocoapods Trunk.cocoapods.org
APPCocoapods< 2023-09-22
Related vulnerabilities
CocoaPods Trunk: nieautoryzowane przejęcie własności osieroconych pakietów
trunk.cocoapods.org is the authentication server for the CoacoaPods dependency manager. Prior to commit d4fa66...
The package cocoapods-downloader before 1.6.2 are vulnerable to Command Injection via hg argument injection. W...
The package cocoapods-downloader before 1.6.0, from 1.6.2 and before 1.6.3 are vulnerable to Command Injection...