Security Experts:

Connect with us

Hi, what are you looking for?

SecurityWeekSecurityWeek

Vulnerabilities

Leaked GitHub API Token Exposed Homebrew Software Repositories

A GitHub API token leaked from Homebrew’s Jenkins provided a security researcher with access to core Homebrew software repositories (repos).

A GitHub API token leaked from Homebrew’s Jenkins provided a security researcher with access to core Homebrew software repositories (repos).

Around since 2009, Homebrew is a free and open-source software package management system that is integrated with command line and which allows for simple installation of software on macOS machines.

On July 31, 2018, security researcher Eric Holmes discovered that an exposed token provided him with commit access to Homebrew/brew, Homebrew/homebrew-core, and Homebrew/formulae.brew.sh repositories.

With hundreds of thousands of people using Homebrew, the potential impact of the compromise was disastrous. By modifying a highly popular package, such as openssl, the researcher could have pushed the malicious code directly to a large number of users.

“If I were a malicious actor, I could have made a small, likely unnoticed change to the openssl formulae, placing a backdoor on any machine that installed it,” Holmes explained.

The issue, which was addressed the same day that it was discovered, did not result in compromised packages, Homebrew lead maintainer Mike McQuaid reveals.

The exposed token had elevated scopes, but the GitHub Support team has verified that it hasn’t been used to perform any pushes to Homebrew/brew or Homebrew/homebrew-core.

“Within a few hours the credentials had been revoked, replaced and sanitised within Jenkins so they would not be revealed in future. Homebrew/brew and Homebrew/homebrew-core were updated so non-administrators on those repositories cannot push directly to master,” McQuaid says.

He also explains that the team also enforced stronger security by updating most repositories in the Homebrew organization “to require CI checks from a pull request to pass before changes can be pushed to master.”

In addition to enabling branch protection and requiring reviews on additional repositories, the Homebrew team also required all maintainers to review and prune their personal access tokens and disable SMS fallback for 2FA.

“We try our best to behave as a for-profit company would do in terms of timely response to security issues but this is heavily limited by our lack of resources. For example, in this the Homebrew maintainer who resolved the above issues was on paternity leave from work and the primary carer for their child and had to reach a quick resolution while their child had a nap,” McQuaid notes.

In the wake of recent incidents with compromised Gentoo Linux and Arch Linux AUR repositories, it is increasingly clear that malicious actors can cause a great deal of damage by targeting the supply chain. This is exactly what last year’s CCleaner and NotPetya attacks demonstrated as well.

“This is my growing concern, and it’s been proven time and time again that package managers, and credential leaks, are a weak point in the security of the internet, and that supply chain attacks are a real and persistent threat. This is not a weakness in Homebrew, but rather a systemic problem in the industry, and one where we need more security research,” Holmes concludes.

Related: Arch Linux AUR Repository Compromised

Related: Gentoo Publishes Incident Report After GitHub Hack

Written By

Ionut Arghire is an international correspondent for SecurityWeek.

Click to comment

Expert Insights

Related Content

Cloud Security

VMware vRealize Log Insight vulnerability allows an unauthenticated attacker to take full control of a target system.

Mobile & Wireless

Apple rolled out iOS 16.3 and macOS Ventura 13.2 to cover serious security vulnerabilities.

IoT Security

Lexmark warns of a remote code execution (RCE) vulnerability impacting over 120 printer models, for which PoC code has been published.

Mobile & Wireless

Technical details published for an Arm Mali GPU flaw leading to arbitrary kernel code execution and root on Pixel 6.

Mobile & Wireless

Apple’s iOS 12.5.7 update patches CVE-2022-42856, an actively exploited vulnerability, in old iPhones and iPads.

Vulnerabilities

Security researchers have observed an uptick in attacks targeting CVE-2021-35394, an RCE vulnerability in Realtek Jungle SDK.

Email Security

Microsoft is urging customers to install the latest Exchange Server updates and harden their environments to prevent malicious attacks.

Vulnerabilities

Google has awarded more than $25,000 to the researchers who reported the vulnerabilities patched with the release of the latest Chrome update.