Tenable Research has identified a critical vulnerability (CVSSv4 9.3) in a Microsoft GitHub repository that allowed for Remote Code Execution (RCE) and unauthorized access to repository secrets. This disclosure highlights that CI/CD infrastructure is a critical part of a modern attack surface.
The discovery involves a vulnerable GitHub workflow, [GitHub’s automation scripts using one or more jobs using GitHub Actions] within the Windows-driver-samples repository. This repository, which has been forked 5,000 times and has 7,700 stars, represents a significant point of interaction for developers. Tenable researchers demonstrated how the repository’s CI/CD infrastructure could be exploited to compromise the software supply chain
The “Trivial” Exploit Path
The vulnerability stems from a simple Python string injection flaw. Attackers could exploit this through the following steps:
- Issue Creation: An attacker opens a GitHub issue, which is a feature available to any registered user.
- Malicious Injection: The attacker includes malicious Python code within the issue description.
- Automatic Execution: The GitHub workflow triggers automatically upon the issue’s creation, executing the attacker’s code in the context of the GitHub runner.
- Secret Exfiltration: The exploit allows the attacker to exfiltrate the GITHUB_TOKEN and other potential secrets configured on the repository.
Impact on Repository Integrity
The exfiltrated GITHUB_TOKEN is a secret that allows for operations on a GitHub repository. Because the repository was created before 2023, and the token allows at least issue creation without explicit permission set in the workflow, researchers infer that the token likely retained default read and write permissions. This could allow unauthorized users to perform privileged operations on behalf of Microsoft, such as creating issues or modifying repository content.
“The CI/CD infrastructure is part of an organization’s attack surface and software supply chain,” said Rémy Marot, Staff Research Engineer at Tenable. “Without strong safeguards, a vulnerability in a pipeline can be exploited to trigger large-scale supply chain attacks and have critical impacts on downstream systems and users”.
Following the disclosure, Tenable emphasizes that organizations must treat their CI/CD pipelines as critical infrastructure. To prevent similar exposures, the following are recommended:
- Strict Security Controls: Implement rigorous security measures to protect source code and build integrity within automated workflows.
- Permission Review: Explicitly update and restrict GITHUB_TOKEN permissions to ensure they do not default to broad read/write access.
- Pipeline Monitoring: Regularly audit automated workflows for potential injection vulnerabilities, especially those triggered by external user input.