CVE-2024-42381: brew · Inclusion of Web Functionality from an Untrusted Source
Affects brewSource CVE Database V5
Not known to be exploited · CVSS 8.3 High : upgrade to 4.2.20 soon.
Data as of 26 Oct 2026, 09:15 UTC
- EPSS
- 0.6% chance of exploitation in 30 days – higher than 50% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 4.2.20
CVSS:3.1/AC:H/AV:N/A:H/C:H/I:H/PR:N/S:C/UI:RExploitation evidence
Disclosed: evidence found.
CVE published 31 Jul 2024
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.
What to do
Upgrade homebrew/brew to 4.2.20.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
GitHubhomebrew/brewpkg:github/homebrew/brewOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
To mitigate CVE-2024-42381, organizations should immediately upgrade Homebrew to version 4.2.20 or later, where the vulnerability has been addressed. Avoid installing or loading ELF binaries from untrusted or unverified sources, especially those that could contain malicious .interp sections. Implement strict package source validation and use cryptographic signatures to verify package integrity before installation. Employ runtime monitoring tools to detect unusual process behaviors during package installation and binary relocation phases. Consider sandboxing or containerizing package management operations to limit the impact of potential code execution. Educate users and administrators about the risks of installing untrusted packages and the importance of applying security updates promptly. For environments with high security requirements, restrict the use of Homebrew or similar package managers to trusted internal repositories only. Regularly audit and monitor systems for signs of compromise related to package management activities. Finally, maintain up-to-date backups to enable recovery in case of exploitation.
Description
os/linux/elf.rb in Homebrew brew before 4.2.20 uses ldd to load ELF files obtained from untrusted sources, which allows attackers to achieve code execution via an ELF file with a custom .interp section. NOTE: this code execution would occur during an un-sandboxed binary relocation phase, which occurs before a user would expect execution of downloaded package content. (237d1e783f7ee261beaba7d3f6bde22da7148b0a was the tested vulnerable version.)
References
- github.com/Homebrew/brew/tree/237d1e783f7ee261beaba7d3f6bde22da7148b0a (opens in a new tab)
- github.com/trailofbits/publications/blob/master/reviews/2023-08-28-homebrew-securityreview.pdf (opens in a new tab)
- blog.trailofbits.com/2024/07/30/our-audit-of-homebrew/ (opens in a new tab)
- brew.sh/2024/07/30/homebrew-security-audit/ (opens in a new tab)
- github.com/Homebrew/brew/commit/916b37388d3851a8a93a8e9b4adc38873680ead7 (opens in a new tab)
- github.com/Homebrew/brew/releases/tag/4.2.20 (opens in a new tab)
- github.com/Homebrew/brew/pull/17136 (opens in a new tab)