Connect with us

Hi, what are you looking for?

SecurityWeekSecurityWeek

Application Security

Stolen GitHub Credentials Used to Push Fake Dependabot Commits

Threat actors have been using stolen GitHub personal access tokens to push malicious code posing as Dependabot contributions.

Threat actors have been observed pushing fake Dependabot contributions to hundreds of GitHub repositories in an effort to inject malicious code, application security firm Checkmarx reports.

Identified in July, the campaign relied on stolen GitHub personal access tokens to gain access to repositories and push code to steal sensitive information from projects and passwords from end users.

To evade detection, the attackers faked commit messages to make them appear as if generated by Dependabot, GitHub’s free automated dependency management tool that helps software developers identify and address vulnerabilities in their code.

Dependabot continuously scans a project’s dependencies and generates pull requests when identifying issues. The update requests, however, need user acknowledgement.

As part of the observed campaign, the attackers created a commit message “fix” that appeared to be contributed by the ‘dependabot[bot]’ user account, tricking developers into believing the commits came from GitHub’s tool.

Using this technique, the threat actors targeted hundreds of repositories, including private repositories, adding a new “hook.yml” file as a workflow file, to send GitHub secrets to an external server on every push event.

Advertisement. Scroll to continue reading.

In addition to injecting this GitHub Action, the attackers modified all .js files within the targeted projects, by appending an obfuscated line of code at the end.

The code would create a new script tag when executed in a browser, while also loading an additional script from a remote server, to intercept password-based forms and send user credentials to the attackers.

According to Checkmarx, the stolen GitHub personal access tokens used in this campaign were most likely exfiltrated from the victims’ systems after they downloaded a malicious package.

The security firm notes that the attacks were likely automated, and that it was difficult for the victims to identify the token compromise, as the token’s access log activity does not show in the account’s audit log.

“This whole situation teaches us to be careful about where we get our code, even from trusted places like GitHub. This is the first incident we witnessed a threat actor using fake git commits to disguise activity, knowing that many developers do not check the actual changes of Dependabot when they see it,” Checkmarx notes.

Related: GitHub Rotates Publicly Exposed RSA SSH Private Key

Related: Attackers Can Abuse GitHub Codespaces for Malware Delivery

Related: GitHub Announces New Security Improvements

Written By

Ionut Arghire is an international correspondent for SecurityWeek.

Click to comment

Trending

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest threats, trends, and technology, along with insightful columns from industry experts.

In cyber-physical systems (CPS), just one hour of downtime can outweigh an entire annual security budget. Learn how to master the Return on Security Investment (ROSI) to align security goals with the bottom-line priorities.

Register

Delve into big-picture strategies to reduce attack surfaces, improve patch management, conduct post-incident forensics, and tools and tricks needed in a modern organization.

Register

People on the Move

Malwarebytes has named Chung Ip as Chief Financial Officer.

Semperis has appointed John Podboy as Chief Information Security Officer.

Randy Menon has become Chief Product and Marketing Officer at One Identity.

More People On The Move

Expert Insights

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest cybersecurity news, threats, and expert insights. Unsubscribe at any time.