A recently identified security vulnerability in the official Homebrew Cask repository could have been exploited by an RCE bug through an attacker to execute arbitrary code on users’ machines that have Homebrew installed.
The issue, which was reported to the maintainers on April 18 by a Japanese security researcher named RyotaK, stemmed from the way code changes in its GitHub repository were handled, resulting in a scenario where a malicious pull request — i.e., the proposed changes — could be automatically reviewed and approved. The flaw was fixed on April 19.
Homebrew is a free and open-source software package management solution that allows the installation of software on Apple’s macOS operating system as well as Linux. Homebrew Cask extends the functionality to include command-line workflows for GUI-based macOS applications, fonts, plugins, and other non-open source software.
“The discovered vulnerability (RCE bug) would allow an attacker to inject arbitrary code into a cask and have it be merged automatically,” Homebrew’s Markus Reiter said. “This is due to a flaw in the git_diff dependency of the review-cask-pr GitHub Action, which is used to parse a pull request’s diff for inspection. Due to this flaw, the parser can be spoofed into completely ignoring the offending lines, resulting in successfully approving a malicious pull request.”
In other words, the flaw meant malicious code injected into the Cask repository was merged without any review and approval.
The researcher also submitted a proof-of-concept (PoC) pull request demonstrating the vulnerability, following which it was reverted. In light of the findings, Homebrew has removed the “auto-merge” GitHub Action as well as disabled and removed the “review-cask-pr” GitHub Action from all vulnerable repositories.
In addition, the ability for bots to commit to homebrew/cask* repositories has been removed, with all pull requests requiring a manual review and approval by a maintainer going forward. No user action is required.
“If this vulnerability was abused by a malicious actor, it could be used to compromise the machines that run brew before it gets reverted,” the researcher said. “So I strongly feel that a security audit against the centralized ecosystem is required.”
Article Provided By: Hacker News
If you would like liquidvideotechnologies.com to discuss developing your Home Security System, Networking, Access Control, Fire, IT consultant, or PCI Compliance, please do not hesitate to call us at 864-859-9848 or you can email us at firstname.lastname@example.org.