A single pull request could have handed attackers the keys to Microsoft’s software supply chain
InfoWorld ·

The most dangerous actor in a software supply chain may now be an automated script with powerful credentials and no idea where it’s sending them. Researchers from pen-testing company Cycode have discovered a now patched critical zero-click supply chain vulnerability in the open-source Windows Package Manager (WinGet), which sits on billions of devices worldwide. A single pull request could have tricked Microsoft’s internal tooling into freely handing over a moderator’s GitHub access token, with no phishing, no malware, no moderator clicking or approval required. There is currently no evidence that the flaw has been exploited in the wild. But it serves as a cautionary tale for enterprises that the automation they trust is becoming an attacker entry point, and package repositories are particularly enticing targets. “Package registries have become the highest-profile target in the software supply chain,” Moriel Harush , Cycode security research lead, wrote in a blog post . “Compromise a single maintainer, and you reach everyone who trusts them. Compromise the gatekeepers, and you reach the entire ecosystem.” Whatever the employee can do, the attacker can do WinGet is Microsoft’s free, open source command line tool that helps users discover, install, upgrade, configure, and remove apps. It exists on more than 1.4 billion active devices running Windows 10, Windows 11, and Windows Server 2025. WinGet’s catalog is a public GitHub repository , and its gatekeeper, so to speak, is a small, official group of Microsoft moderators who review a constant stream of community pull requests and proposed changes. By default, WinGet installations on every Windows machine trust the actions those keepers take. The hole is in the moderators’ own internal triage tool. This PowerShell helper attached the moderator’s secret GitHub Personal Access Token (PAT) to any HTTP request, without checking who owned that address. This meant an attacker merely had to supply an address. Theoretically, if they opened a pull request and pointed an InstallerURL software installation package at their own server, “the trap was set,” Harush explained. Microsoft’s automated Azure DevOps validation pipeline would then attempt to fetch the URL, but the attacker’s server would intentionally return an error. This added a validation error label to the pull request. The moderator’s internal script would respond to that label by running a CheckInstaller routine which would send a HEAD request to the attacker via an authenticated HTTP helper, whose job is to automatically attach credentials or tokens to outgoing HTTP requests and handle authorization errors . Then all the attacker had to do was check their logs and extract the moderator’s official GitHub token, which was “casually” handed over. But the token is not merely a repository-scoped credential, it is a full identity credential, meaning whatever that Microsoft employee can do on GitHub, the token can do. Harush explained: “It is like a courier stapling your house key to every parcel that has your name on it, because most of them are destined for your own address.” But if a stranger uses your name and changes the address to one they control, “your key is delivered directly to them.” Armed with this key to Microsoft’s internal environment, an attacker could push malicious manifests, approve their own pull requests, and slip in backdoored installers to 14,000 exposed packages, all under a highly trusted, official Microsoft badge. They could also access and write to every other Microsoft repository the moderator had access to, modify GitHub Actions workflows across those repositories to achieve remote code execution (RCE) and exfiltrate corporate secrets. There is a precondition for this attack: At least one moderator has to have the triage tracker running in a continuous background loop, which it is designed to do as it waits for work. Underlying model ‘fundamentally flawed’ Harush pointed out that Microsoft’s C# version of the tool, in the same directory, did not share the flaw; as such, it would have offered safer authentication. Microsoft has since patched the PowerShell vulnerability , safely scoping the authentication mechanism to ensure that users’ tokens are only attached when a request host is an authorized GitHub endpoint, such as api.github.com , github.com , or raw.githubusercontent.com . Harush noted, however, that the underlying credential model is “fundamentally flawed,” and that relying on Classic PATs is a “severe liability.” Cycode advises binding credentials to destinations, rather than functions; auditing every internal tool that handles maintainer credentials; and ensuring that headers are conditionally applied based on the target host, “not unconditionally stapled by a wrapper function.” Treat all user inputs as hostile, validated hosts before credentials are attached, and deprecate classic PATs. “The blast radius of a leaked token must be limited to one repository and the bare minimum permissions,” Harush said. “A leaked token should never mean a leaked corporate identity.” He emphasized, though, that WinGet moderators are doing exactly what’s asked of them: Using automated tools to manage a “flood of community submissions” and make their jobs easier. “But automation does not just remove the human who would have clicked the malicious link; it removes the human who would have noticed the anomaly.” Scripts are a soft spot The WinGet flaw was a near miss, but “a very serious one,” said Frank Dickson of Dickson Research. Exploiting it would have let an attacker publish malware with “Microsoft’s seal of approval.” This means attackers could have pushed tampered installers to anyone who ran an install or an update, reached into any other Microsoft repositories the moderator could touch, and hijacked the build machinery to steal more secrets. And the damage would have looked like routine work. An IT team scripting a standard software rollout would have installed the attacker’s code on every machine, and the logs would have shown an approved package from an approved source. “The attack would have been a Trojan horse delivered by the mail carrier everyone trusts,” Dickson said. Enterprise security teams should learn that their own scripts are a soft spot, he pointed out; internal tools, bots, and automation get production-level keys and hobby-level review. CISOs should inventory every script and bot that holds a token, and answer important questions: What could this key do in the wrong hands? Where is it allowed to go? Additionally, he advised replacing broad, long-lived tokens with narrow, short-lived ones, and binding every credential to the specific services that need it, which is exactly how Microsoft fixed this problem. “Also, enterprises should stop trusting public registries blindly,” Dickson said. Ultimately, security teams should review their automations the way they review their people, he said. “A script that runs in a loop around the clock with a moderator’s keys is, in effect, a moderator who never sleeps and never questions anything.” This article originally appeared on CSOonline .