Root command execution via MX lookup injection
Published Jul 1, 2024 · Updated Aug 2, 2024
Command injection in CocoaPods Trunk allows remote attackers to execute commands as root through the unauthenticated signup flow. The rfc-822 host_mx method concatenates the registrant-controlled email domain into /usr/bin/env host -t MX and passes the resulting string to the shell. Controlling the email domain and its MX response is sufficient to obtain a reverse shell, exposing Trunk session tokens and allowing any Podspec to be rewritten.
Summary
What happened
Command injection in CocoaPods Trunk allows remote attackers to execute commands as root through the unauthenticated signup flow. The rfc-822 host_mx method concatenates the registrant-controlled email domain into /usr/bin/env host -t MX and passes the resulting string to the shell. Controlling the email domain and its MX response is sufficient to obtain a reverse shell, exposing Trunk session tokens and allowing any Podspec to be rewritten.
The record
- CVE
- CVE-2024-38366
- Published
- Jul 1, 2024
- Updated
- Aug 2, 2024
- Vendor
- CocoaPods
- Product
- CocoaPods
- Classifications
- CWE-74, T1190
- Attack vector
- network
- Privileges
- unauthenticated
Timeline
How it unfolded
- Jul 1, 2024CVE publishedPublication date reported by the CVE source.
- Aug 2, 2024Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=0 <001cc3a430e75a16307f5fd6cdff1363ad2f40f3
- Affected versionversion=< 001cc3a430e75a16307f5fd6cdff1363ad2f40f3
What conditions does exploitation require?
What is affected?
Published CVSS scores
CVSS describes severity. EPSS estimates exploitation probability.
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- EVA CocoaPods Trunk reverse-shell proof of conceptproof of concept · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo