One Pull Request Could Have Turned WinGet Into a Malware Pipeline

| 5 min read

The most dangerous component in a software supply chain may be an automated script holding powerful credentials and no idea where it's sending them. A recently patched flaw in the open-source Windows Package Manager (WinGet) shows how little it takes. Security company Cycode found a critical zero-click vulnerability in a tool that sits on billions of devices worldwide. One pull request could have pulled a Microsoft moderator's GitHub access token out of internal tooling. No phishing, no malware, and no human had to click anything.

Nobody has seen this exploited in the wild, and that's the good news. The bad news is that the bug points at a pattern. Package repositories are high-value targets, and the automation teams rely on to keep them moving can quietly become the way in. As Cycode security research lead Moriel Harush put it in a blog post, "Package registries have become the highest-profile target in the software supply chain. Compromise a single maintainer, and you reach everyone who trusts them. Compromise the gatekeepers, and you reach the entire ecosystem."

Why a moderator's token matters this much

WinGet is Microsoft's free, open-source command-line tool for discovering, installing, upgrading, configuring, and removing applications. 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. By default, WinGet on every Windows machine trusts what those moderators approve.

That trust is the whole problem. Whoever controls the moderators' actions controls what millions of installers deliver.

The flaw: a helper that handed out credentials

The hole sat in the moderators' own internal triage tool, a PowerShell helper. It attached the moderator's secret GitHub Personal Access Token (PAT) to any outgoing HTTP request, and it never checked who owned the destination address.

That made the attack surprisingly simple. An attacker only needed to supply an address. Harush described the setup: an attacker opens a pull request and points an InstallerURL, the field that tells WinGet where to fetch a software installer, at their own server. "The trap was set," he wrote.

Microsoft's automated Azure DevOps validation pipeline then tries to fetch that URL. The attacker's server deliberately returns an error, which adds a validation error label to the pull request. The moderator's internal script reacts to that label by running a CheckInstaller routine. That routine sends a HEAD request to the attacker through an authenticated HTTP helper, whose job is to attach credentials to outgoing requests automatically. The attacker then checks their server logs and collects the token. Cycode's write-up says the token was handed over "casually."

Nothing in that chain required the moderator to do something unusual. The tool did exactly what it was built to do, just without checking where the credentials were going.

What a stolen token could have done

A repository-scoped credential would be bad enough. This one was worse, because it was a full identity credential. Whatever that Microsoft employee could do on GitHub, the token could do too.

With it, an attacker could push malicious manifests, approve their own pull requests, and slip backdoored installers into 14,000 exposed packages, all carrying the trust of an official Microsoft badge. They could also reach every other Microsoft repository the moderator could access, modify GitHub Actions workflows across those repositories to achieve remote code execution (RCE), and exfiltrate corporate secrets.

One precondition had to hold. At least one moderator needed the triage tracker running in a continuous background loop, which is how it's designed to work while it waits for new submissions.

The fix is narrower than the bug

Harush pointed out that Microsoft's C# version of the same tool, sitting in the same directory, didn't share the flaw, so it offered safer authentication. Microsoft has since patched the PowerShell vulnerability. 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 patch closes this specific door. Harush argues it doesn't address the deeper issue. He called the underlying credential model "fundamentally flawed" and described reliance on classic PATs as a "severe liability." Tokens like these carry broad, long-lived authority, and any tool that touches them becomes a potential leak point.

Cycode's advice follows from that. Bind credentials to destinations rather than to functions. Audit every internal tool that handles maintainer credentials. Apply headers conditionally based on the target host, "not unconditionally stapled by a wrapper function." Treat all user input as hostile, validate hosts before any credential is attached, and phase out classic PATs. Harush summed up the goal this way: "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 fair to the people involved. WinGet moderators are doing what they've been asked to do, using automation to handle a "flood of community submissions." The trouble is what that automation removes. "It removes the human who would have clicked the malicious link," Harush wrote, "it removes the human who would have noticed the anomaly."

Scripts deserve the same scrutiny as people

Frank Dickson of Dickson Research called the WinGet flaw a near miss, though "a very serious one." Exploiting it would have let an attacker publish malware carrying "Microsoft's seal of approval." Tampered installers could reach anyone who ran an install or update. The attacker could also move into other repositories the moderator could touch and take over the build machinery to harvest more secrets.

The detection problem is what worries Dickson most. 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 malicious activity would have looked like routine work.

His point for enterprise security teams is blunt. Their own scripts are a soft spot. Internal tools, bots, and automation routinely get production-level keys and hobby-level review. Dickson suggests CISOs inventory every script and bot that holds a token, then ask two questions: What could this key do in the wrong hands? Where is it allowed to go? He also recommends replacing broad, long-lived tokens with narrow, short-lived ones, and binding each credential to the specific services that need it. That, he noted, is exactly how Microsoft resolved this one. "Also, enterprises should stop trusting public registries blindly," he added.

Dickson's closing comparison is the one I'd put on a whiteboard: "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."

Security teams should review their automation the way they review their people, with clear scopes, limited authority, and an assumption that it will eventually be pointed the wrong way. The next near miss probably won't come from a phishing email. It'll come from a bot doing its job with keys it should never have been holding.

Source: David Jones · www.csoonline.com