GitHub Used to Distribute Malware via Malicious Visual-Studio Projects

Developers Targeted in Supply Chain Attack Using Malicious Visual Studio Projects on GitHub

HIGH
April 27, 2026
5m read
Supply Chain AttackMalwareThreat Intelligence

Related Entities

Products & Tech

Other

Full Report

Executive Summary

In April 2024, security researchers uncovered a supply chain attack campaign targeting software developers on GitHub. The attackers created malicious Visual Studio projects and uploaded them to the platform, aiming to trick developers into downloading and executing hidden malware. The campaign was notable for its use of social engineering and automation to build a facade of legitimacy. Attackers used typosquatting to mimic popular repositories, fake accounts to generate 'stars' and create an illusion of popularity, and automated commits to make the projects appear actively maintained. This type of attack is particularly dangerous as it poisons the software supply chain, turning a developer's machine into a distribution point for malware.

Threat Overview

The attack represents a growing trend of threat actors shifting their focus 'left' to target the software development process itself. By compromising a single developer or a popular open-source project, an attacker can achieve a widespread impact, infecting potentially thousands of downstream users and applications. This campaign specifically leveraged the trust that developers place in open-source repositories like GitHub. The attackers understood developer behavior, such as searching for code snippets or example projects, and exploited it for malicious purposes.

Technical Analysis

The attackers' methodology was multi-faceted:

  1. Typosquatting and Impersonation: Repositories were given names that were slight misspellings or variations of popular, legitimate projects, hoping to catch developers who made a typo in their search.
  2. Social Proof Manipulation: A botnet of fake GitHub accounts was used to 'star' the malicious repositories. This made them appear more popular and trustworthy in GitHub's search and trending algorithms.
  3. Deceptive Commit History: The attackers used automation to push frequent, small, and seemingly benign commits to the repositories. This created a long and active commit history, giving the impression of a healthy, maintained project.
  4. Payload Obfuscation: The malware payload was often hidden within the project's build scripts (e.g., pre-build or post-build events in the .csproj file) or as an obfuscated resource. It would only be executed when the developer compiled the project, a seemingly safe action.

MITRE ATT&CK Mapping

Impact Assessment

A successful attack of this nature can have a cascading effect:

  • Developer Workstation Compromise: The immediate impact is the full compromise of the developer's machine, leading to the theft of source code, credentials, and other sensitive information.
  • Software Supply Chain Poisoning: If the compromised developer works on a commercial or popular open-source project, the attacker can then inject malicious code into that project, which will then be shipped to all of its users.
  • Corporate Espionage: Attackers can use the compromised workstation as a beachhead to pivot into the developer's corporate network to conduct espionage or deploy ransomware.

IOCs — Directly from Articles

No specific Indicators of Compromise (IOCs) were provided in the source articles.

Cyber Observables — Hunting Hints

For development teams, hunting should focus on developer behavior and environment:

Type
Command Line Pattern
Value
msbuild.exe or dotnet build
Description
Monitor build processes for unexpected network connections or child process execution. A build process should not be reaching out to the internet to download random files.
Type
Log Source
Value
Git logs
Description
Audit the sources of cloned repositories. Look for repositories that were cloned from non-company or untrusted sources.
Type
File Path
Value
.csproj or .sln files
Description
Scan project files for suspicious pre-build or post-build events that execute scripts or commands.

Detection & Response

  • Developer Education: Train developers to be skeptical of open-source projects, especially those that are not well-known or have a suspicious history. Teach them how to inspect project files for malicious build events.
  • Static Analysis (SAST): Integrate SAST tools into your CI/CD pipeline to scan for suspicious commands or scripts in project files.
  • EDR on Developer Machines: Ensure that EDR is deployed on all developer workstations and is configured to monitor build tools for anomalous behavior.

Mitigation

  1. Vet Dependencies: Do not blindly trust open-source code. Use tools to scan dependencies for known vulnerabilities and malicious code. Only use code from reputable, well-maintained projects.
  2. Restrict Build Environments: Where possible, run builds in isolated and ephemeral environments (e.g., Docker containers) that have no access to the internet or the corporate network. This contains the impact of a malicious build script.
  3. Code Signing: Enforce policies that require all internal software to be signed with a trusted certificate. This can help prevent the execution of unauthorized code.
  4. Principle of Least Privilege: Ensure that build processes and developers do not have excessive permissions on their machines or in the CI/CD environment.

Timeline of Events

1
April 27, 2026
This article was published

MITRE ATT&CK Mitigations

Running software builds in isolated, ephemeral containers with no network access can prevent a malicious build script from compromising the host or exfiltrating data.

Mapped D3FEND Techniques:

Vetting software dependencies and only using those from trusted, signed sources can help prevent the inclusion of malicious code.

Mapped D3FEND Techniques:

Training developers on the risks of supply chain attacks and how to spot suspicious repositories is a critical human-layer defense.

D3FEND Defensive Countermeasures

To mitigate the risk of malicious build scripts, organizations must adopt a strategy of application isolation for their build processes. Instead of developers building projects directly on their feature-rich, network-connected workstations, builds should be executed in ephemeral, isolated environments like Docker containers. These build containers should be minimal, containing only the necessary tools and libraries, and, most importantly, should have their network access restricted by default. Any required dependencies should be fetched from a trusted, internal artifact repository (like Artifactory or Nexus), not directly from the public internet. This approach ensures that even if a developer downloads a malicious Visual Studio project, the malicious build script will execute in a sandbox with no ability to compromise the developer's machine, access the corporate network, or exfiltrate data.

Implement automated Software Component Analysis (SCA) tools within the CI/CD pipeline. These tools scan project dependencies and can be configured to do more than just check for known vulnerabilities (CVEs). They can also enforce policies based on the source and reputation of a component. For example, a policy could flag or block any dependency that is not from a well-known, trusted publisher or that has a suspiciously short history. In response to this specific attack, SCA tools and custom scripts should be configured to scan .csproj and other project files for the presence of pre- or post-build event tags that execute arbitrary commands. This automated vetting process removes the burden from individual developers and provides a consistent, organization-wide defense against including untrusted and potentially malicious components in the software supply chain.

Sources & References

Article Author

Jason Gomes

Jason Gomes

• Cybersecurity Practitioner

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.

Threat Intelligence & AnalysisSecurity Orchestration (SOAR/XSOAR)Incident Response & Digital ForensicsSecurity Operations Center (SOC)SIEM & Security AnalyticsCyber Fusion & Threat SharingSecurity Automation & IntegrationManaged Detection & Response (MDR)

Tags

supply chain attackGitHubVisual Studiomalwaredeveloper securityDevSecOps

📢 Share This Article

Help others stay informed about cybersecurity threats