# CVE-2024-42381: 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 achiev…

- Severity: High 8.3 (CVSS:3.1, scored by mitre) `CVSS:3.1/AC:H/AV:N/A:H/C:H/I:H/PR:N/S:C/UI:R`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.65%, higher than 52% of CVEs (2026-12-01)
- Published: 2024-07-31T00:00:00.000Z
- Modified: 2026-06-17T07:49:21.777Z
- Weaknesses: CWE-830
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: mitre

## 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.)

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- homebrew brew: before 4.2.20

## References

- <https://github.com/Homebrew/brew/tree/237d1e783f7ee261beaba7d3f6bde22da7148b0a>
- <https://github.com/trailofbits/publications/blob/master/reviews/2023-08-28-homebrew-securityreview.pdf>
- <https://blog.trailofbits.com/2024/07/30/our-audit-of-homebrew/>
- <https://brew.sh/2024/07/30/homebrew-security-audit/>
- <https://github.com/Homebrew/brew/commit/916b37388d3851a8a93a8e9b4adc38873680ead7>
- <https://github.com/Homebrew/brew/releases/tag/4.2.20>
- <https://github.com/Homebrew/brew/pull/17136>

## Sources

- CVE List: [CVE-2024-42381](https://www.cve.org/CVERecord?id=CVE-2024-42381), CVE Terms of Use, modified 2024-07-31
- NVD: [CVE-2024-42381](https://nvd.nist.gov/vuln/detail/CVE-2024-42381), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-42381 · Whole record: https://cve.day/CVE-2024-42381.json · Rebuilt by cve.day 2026-11-25T22:58:43.461Z
