Safety researchers demonstrated a software program supply-chain assault that would have allowed them to backdoor the codebase of Bazel, a Google-developed open-source device for automating software program constructing and testing. The assault exploited vulnerabilities in a customized GitHub Motion utilized by the venture in its CI/CD workflows, highlighting how safety points might be inherited from third-party CI/CD dependencies.
“We discovered {that a} GitHub Actions workflow may have been injected by a malicious code as a result of a command injection vulnerability in considered one of Bazel’s dependent actions,” researchers from software safety agency Cycode stated in a weblog submit. “This vulnerability instantly impacts the software program provide chain, probably permitting malicious actors to insert dangerous code into the Bazel codebase, create a backdoor, and have an effect on the manufacturing atmosphere of anybody utilizing Bazel. This vulnerability may have affected hundreds of thousands of initiatives and customers who use Bazel, together with Kubernetes, Angular, Uber, LinkedIn, Databricks, DropBox, Nvidia, Google, and plenty of extra.”
Customized GitHub Actions can introduce hidden safety dangers
GitHub Actions is a CI/CD service provided by GitHub that permits builders to automate the constructing and testing of software program code by defining workflows which execute routinely inside containers on both GitHub’s or the consumer’s personal infrastructure. It is a widespread service that many GitHub-hosted initiatives depend on to run numerous automated checks or actions on code contributed to their repositories.
Nevertheless, the performance provided by GitHub Actions can be utilized insecurely and researchers have highlighted a number of such errors previously that would have resulted in software program supply-chain compromises. In December 2022, researchers from safety agency Legit Safety confirmed how attackers may poison binary artifacts that may then be used as enter for a venture’s GitHub Motion workflows. Earlier this month one other workforce of researchers from Praetorian confirmed how self-hosted GitHub Actions runners might be exploited to infiltrate a company’s improvement infrastructure. Likewise, the brand new analysis from Cycode doesn’t exploit any inherent vulnerability in GitHub Actions itself, however relatively in the best way some initiatives select to make use of a few of its options with out contemplating the dangers.
Customers outline GitHub Actions workflows by creating YAML recordsdata throughout the .github/workflows listing of a repository. These workflow recordsdata include a collection of jobs and steps that needs to be executed to attain a process they usually typically contain calling predefined “actions.” These actions are like small scripts or code capabilities and a few of them are offered by GitHub itself whereas others are created and offered by third events. The latter are generally known as Customized Actions they usually enable a stage of code reuse and nested dependencies that’s just like that seen with numerous bundle managers like npm for JavaScript or pip for Python.
Simply as vulnerabilities might be inherited from bundle dependencies in npm or pip, transitive vulnerabilities could make their means right into a workflow from customized GitHub Actions written by different folks. In truth, it’s even worse, as a result of customized GitHub Actions can execute not simply further actions but additionally JavaScript and Python packages in addition to shell instructions. These are generally known as composite actions.