How One Pull Request Could Have Exposed Microsoft's WinGet Supply Chain

| 2 Min Read
Cycode found a zero-click flaw in WinGet's moderation tooling that could have leaked a Microsoft maintainer's GitHub token. It's patched, but the lesson is about scripts.

The most exposed credential in this story didn't belong to a developer or a release engineer. It belonged to a triage script that runs in a loop, waiting for work, and nobody was watching it closely.

Security researchers at Cycode found a critical zero-click flaw in the open source Windows Package Manager, WinGet. Microsoft has patched it. Cycode's team found no evidence of exploitation in the wild. Still, the attack path is worth studying, because it required no phishing, no malware, and no human clicking anything. A single pull request was enough to start it.

Why WinGet's trust model matters

WinGet is Microsoft's free command line tool for discovering, installing, upgrading, configuring, and removing apps. It runs on more than 1.4 billion active devices across Windows 10, Windows 11, and Windows Server 2025. Its catalog lives in a public GitHub repository, and a small group of official Microsoft moderators reviews a steady flow of community pull requests and proposed changes.

Out of the box, every WinGet installation trusts the decisions those moderators make. That default is what turns a moderation queue into a supply chain choke point. Compromise the reviewers, and you control what millions of machines will install.

From one pull request to a stolen token

The vulnerability lived in the moderators' internal triage tool, a PowerShell helper. It attached a moderator's classic GitHub Personal Access Token to any outgoing HTTP request, and it never checked who controlled the destination address.

That gap made the attack chain short. An attacker opened a pull request and pointed an InstallerURL at a server they controlled. Microsoft's automated Azure DevOps validation pipeline then tried to fetch that URL. The attacker's server returned an error on purpose, which added a validation error label to the pull request.

The label was the trigger. The moderator's script responded by running a CheckInstaller routine, which sent a HEAD request to the attacker's server through an authenticated HTTP helper. That helper's job is to attach credentials automatically and handle authorization errors. It did exactly that. The attacker then checked their server logs and pulled out the moderator's token, which had been handed over "casually," in the words of Cycode's researchers.

Here's the thing that made this serious: the token wasn't limited to one repository. It was a full identity credential. Whatever that Microsoft employee could do on GitHub, the token could do too.

Moriel Harush, Cycode's security research lead, put it in a way that sticks: "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." If a stranger changes the address to one they control, "your key is delivered directly to them."

With that token, an attacker could push malicious manifests and approve their own pull requests. They could slip backdoored installers into 14,000 exposed packages, all carrying an official Microsoft badge. They could also reach every other Microsoft repository the moderator could access, modify GitHub Actions workflows to achieve remote code execution, and exfiltrate corporate secrets. The main precondition was that at least one moderator had the triage tracker running in a continuous background loop, which is how it was designed to work.

The fix, and the flaw underneath it

Microsoft's C# version of the same tool, sitting in the same directory, didn't share the flaw, which is why Harush considered it the safer option. Microsoft has since patched the PowerShell version in pull request 456300. The fix scopes authentication so tokens attach only when the request host is an authorized GitHub endpoint, such as api.github.com, github.com, or raw.githubusercontent.com.

That said, the patch addresses a symptom. Harush argued the underlying credential model is "fundamentally flawed," and that relying on classic PATs is a "severe liability." A token that broad, held by a script that talks to arbitrary addresses, is a standing risk no matter how carefully one wrapper function is written.

Cycode's guidance points in a clear direction. Bind credentials to destinations rather than to functions. Audit every internal tool that touches maintainer credentials. Apply headers conditionally based on the target host, "not unconditionally stapled by a wrapper function." Treat every user-supplied input as hostile until its host has been validated, and retire classic PATs altogether.

Harush's core test is simple: "The blast radius of a leaked token must be limited to one repository and the bare minimum permissions. A leaked token should never mean a leaked corporate identity."

He was also careful not to blame the moderators. They were doing what they'd been asked to do, using automation to handle a flood of community submissions. But the automation had a side effect. "It removes the human who would have clicked the malicious link," he said, "and it removes the human who would have noticed the anomaly."

Scripts get production keys and hobby-level review

Frank Dickson of Dickson Research called the WinGet flaw "a near miss," and added that it was "a very serious one." Exploited, it would have let an attacker publish malware carrying "Microsoft's seal of approval."

The reach would have been wide. Tampered installers could have gone to anyone who ran an install or an update. The attacker could have moved into other Microsoft repositories the moderator could touch and hijacked build machinery to harvest more secrets. And the activity would have looked routine. An IT team scripting a standard rollout would have installed the attacker's code on every machine, while the logs showed an approved package from an approved source.

"The attack would have been a Trojan horse delivered by the mail carrier everyone trusts," Dickson said.

His broader warning is aimed at enterprise security teams. Their own scripts, bots, and internal automation are soft spots. They often hold production-level keys but get hobby-level review. Dickson's starting point is an inventory: every script and bot that holds a token, along with two questions. What could this key do in the wrong hands? Where is it allowed to go?

From there, the fixes are familiar but often skipped. Replace broad, long-lived tokens with narrow, short-lived ones. Bind each credential to the specific services that need it, which is exactly the change Microsoft made. Dickson also flagged a habit many enterprises still have: "Enterprises should stop trusting public registries blindly."

He suggested a useful mental model. Review automations the way you'd review people. "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."

If your organization runs internal tooling against GitHub or any other code platform, that inventory is the place to start. Find the tokens, find the destinations those tools can reach, and find out how much damage one bad address could do.

Source: Thomas Smith · www.csoonline.com

Comments

Please sign in to comment.