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

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.

Advertisement. Scroll to continue reading.

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

Related Content

Malware & Threats

Checkmarx warns of a new attack relying on GitHub search manipulation to deliver malicious code.

Application Security

GitHub’s code scanning autofix delivers remediation suggestions for two-thirds of the identified vulnerabilities.

Vulnerabilities

GitHub rotates credentials and releases patches after being alerted of a vulnerability affecting GitHub.com and GitHub Enterprise Server.

Artificial Intelligence

Exposed data includes backup of employees workstations, secrets, private keys, passwords, and over 30,000 internal Microsoft Teams messages.

Vulnerabilities

Despite GitHub’s efforts to prevent repository hijacking, cybersecurity researchers continue finding new attack methods, and thousands of code packages and millions of users could...

Application Security

GitHub Enterprise Server 3.10 released with additional security capabilities, including support for custom deployment rules.

Application Security

GitHub this week introduced NPM package provenance and deployment protection rules and announced general availability of private vulnerability reporting.

Security Infrastructure

GitHub replaced the RSA SSH private key used to secure Git operations for GitHub.com after it was exposed in a public GitHub repository.

Copyright © 2024 SecurityWeek ®, a Wired Business Media Publication. All Rights Reserved.

Exit mobile version