New Malvertising Campaign Exploits GitHub Repositories to Distribute Malware

New Malvertising Campaign Exploits GitHub Repositories to Distribute Malware

A sophisticated malvertising campaign has been uncovered targeting unsuspecting users through “dangling commits” in a legitimate GitHub repository.

Attackers are injecting promotional content for a counterfeit GitHub Desktop installer into popular development and open-source projects.

When users download what appears to be the genuine client, the installer quietly delivers malicious payloads in the background, compromising systems without raising immediate suspicion.

Security researchers first observed the campaign when monitoring web traffic for unusual advertising redirects.

Victims clicking on malvertising banners were redirected to compromised pages offering an updated GitHub Desktop client build.

Instead of fetching the official installer, these pages served a dropper masquerading as “GitHubDesktopSetup-x64.exe.” Execution of the dropper triggers a multi-stage process: it launches a Windows Script Host (wscript.exe) script, which in turn executes PowerShell commands to load and run a malicious DLL payload via svchost.exe.

The payload establishes persistent communication with a command-and-control (C2) server, enabling remote code execution, data exfiltration, and potential lateral movement within enterprise environments.

Researchers noted the attackers employed sophisticated obfuscation techniques, embedding encoded PowerShell commands within seemingly benign processes.

By leveraging legitimate process names and Windows mechanisms, such as scheduled tasks (schtasks.exe) for persistence and svchost.exe for cloaked execution, the campaign evades common endpoint detection and response (EDR) solutions.

Victims may not realize they have been compromised until anomalies appear, such as unexpected network connections or resource consumption spikes.

Innovative Use of GitHub Infrastructure

This campaign innovatively abuses GitHub’s own platform to establish credibility. By targeting dangling commits—temporary or orphaned versions of code pushed by legitimate contributors—the attackers ensure their malicious promotional content appears in the context of an established project.

New Malvertising Campaign Exploits GitHub Repositories to Distribute Malware

Users seeing the repository updates trust the source and download the installer, unwittingly initiating the infection chain.

Researchers emphasize that dangling commits can bypass conventional repository monitoring, as they do not show up in primary branch histories.

The attackers exploit this blind spot to plant malicious links in the project’s README or release notes.

When repository visitors click download buttons, they are instead directed to external hosting under the attacker’s control.

The overarching goal appears to be widespread distribution of a backdoor capable of harvesting credentials, deploying cryptocurrency miners, or delivering additional exploit modules.

Mitigations

To protect against this novel malvertising tactic, organizations should implement strict validation of software sources before installation.

Verifying code signatures and checksums against official vendor repositories helps ensure installers have not been tampered with.

Security teams should also monitor DNS and HTTP logs for connections to unfamiliar domains or IP addresses immediately following software downloads.

Deploying behavior-based EDR solutions can detect anomalous PowerShell and script-host activities that deviate from normal usage patterns.

Developers maintaining open-source projects on GitHub can mitigate risk by pruning dangling commits and enabling branch protection rules.

Regular audits of repository metadata and release assets can uncover unauthorized modifications before they are exploited.

Additionally, enabling multi-factor authentication (MFA) across developer accounts reduces the chances of attackers gaining push access to repositories in the first place.

As malvertising techniques continue evolving, collaboration between platform providers and the security community is critical.

GitHub has been notified of the abuse of its infrastructure and is working on enhancing visibility for dangling commits.

Meanwhile, security researchers urge users to remain vigilant, question unexpected update prompts even within trusted repositories, and report suspicious activity promptly.

This emerging campaign underscores the importance of a zero-trust approach to software supply chains.

By assuming nothing is inherently safe and continually validating the authenticity of every component, organizations can better defend against innovative threats that exploit long-standing developer workflows.

Find this Story Interesting! Follow us on LinkedIn and X to Get More Instant Updates.


Source link

About Cybernoz

Security researcher and threat analyst with expertise in malware analysis and incident response.