Cycode discovers critical zero-click supply chain vulnerability in WinGet (now patched)
Vulnerability potentially affecting 1.4B active devices discovered during development of Cycode’s AI offensive security capabilities
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.
Windows Package Manager (WinGet) is Microsoft’s free, open-source command-line package manager on over 1.4 billion active devices globally running Windows 10 and Windows 11. It operates on a unique model: its catalog is a public GitHub repository (microsoft/winget-pkgs), and its gatekeepers are a small, official group of Microsoft moderators reviewing a constant stream of community pull requests. Every WinGet installation on every modern Windows machine ultimately trusts what these Microsoft employees merge.
What does it take to compromise one of them? The answer, it turns out, was a single pull request.
When Automation Hands Over the Keys
Compromising WinGet required no phishing, no malware, and no interaction from the Microsoft moderators.
The moderators’ internal triage tool, a PowerShell script named ManualValidationPipeline.ps1, attached the moderator’s GitHub Personal Access Token (PAT) to every HTTP request it makes, with zero checks on the destination host.
One of the tool’s automated code paths reads a URL provided in a submitted manifest and calls it. If an attacker opened a PR, pointed the InstallerUrl to a server they control, and waited, the trap was set. At twenty minutes past the hour, a Microsoft moderator’s workstation connects to the attacker’s server and presents an Authorization: Bearer header, casually handing over their official GitHub token.
To put this in perspective: 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. However, if a stranger just uses your name but changes the address to one they control, your key is delivered directly to them.
A Zero-Click Kill Chain
The only precondition for this attack is that at least one moderator has the triage tracker running in its designed mode of operation, which is a continuous background loop waiting for work.
From there, the kill chain is entirely mechanical:
- The Bait: The attacker opens a pull request against microsoft/winget-pkgs with an InstallerUrl pointing to their own server.
- The Trigger: Microsoft’s automated Azure DevOps validation pipeline attempts to fetch the URL. The attacker’s server intentionally returns an error, causing the pipeline to automatically apply a URL-Validation-Error label to the PR.
- The Hook: This specific label forces the moderator’s automated loop to unconditionally run a CheckInstaller routine. The routine extracts the attacker’s URL and sends a HEAD request to it.
- The Catch: The request is dispatched using an authenticated HTTP helper. The attacker simply checks their server logs and extracts the bearer token.
To make matters worse, the internal Microsoft tool then posts an automated comment on the PR on behalf of the moderator, recording the HTTP status code it received. The attacker gets public, documented confirmation that their exploit executed successfully.
Figure 1: Attack kill chain
Figure 2: Proof of concept showing the automated Microsoft triage tool connecting to the rogue server.
The True Impact: From a Package Registry to Microsoft’s Core
It is tempting to score this vulnerability simply as “unauthorized write access to winget-pkgs.” That undersells the severity.
The compromised credential is a Classic Personal Access Token carrying the workflow scope. This is not a repository-scoped credential; it is a full identity credential. Whatever that Microsoft employee can do on GitHub, the token can do.
Armed with this token, an attacker can:
- Push malicious manifests directly to winget-pkgs, approve their own pull requests, and publish backdoored installers to 14,000 exposed packages, all cryptographically signed off by a trusted Microsoft moderator.
- Access and write to every other Microsoft repository that the moderator has access to. You aren’t just compromising a public package manager; you are inheriting the keys to Microsoft’s internal ecosystem, committing code under a highly trusted, official Microsoft badge.
- Modify GitHub Actions workflows across those Microsoft repositories (thanks to the workflow scope), achieving Remote Code Execution (RCE) on CI/CD runners and exfiltrating the corporate secrets those pipelines hold.
The attacker does not need to breach the supply chain from the outside; they are operating strictly inside it. A poisoned commit to a side project reads as a routine maintainer fix. A backdoored 7zip manifest ships as a standard update.
The Fix: Implementing the Missing Allowlist (PR #456300)
What makes this particularly striking is that a safer authentication pattern already existed in the same directory, in the tool’s C# implementation. The triage tool has a C# port where the HTTP helper explicitly defaults the Authorization parameter to false, attaching the credential only when a caller explicitly opts in. The PowerShell version completely lacked this safeguard, aggressively broadcasting the token even to harmless endpoints like githubstatus.com.
Microsoft has since patched this vulnerability. The official remediation, implemented in Pull Request #456300, applies the exact logic that was missing. It safely scopes the authentication mechanism, ensuring that the bearer token is strictly attached only when the request host is an authorized GitHub endpoint (api.github.com, github.com, or raw.githubusercontent.com).
Beyond the code, the underlying credential model is fundamentally flawed. Relying on Classic PATs is a severe liability. Transitioning to a Fine-Grained Token strictly scoped to the microsoft/winget-pkgs repository confines the blast radius of a leak to a single public catalog, rather than compromising an entire human identity across Microsoft’s organization.
Takeaways for Security and Engineering Teams
- Bind Credentials to Destinations, Not Functions: Audit every internal tool that handles maintainer credentials. Ensure authentication headers are conditionally applied based on the target host, not unconditionally stapled by a wrapper function.
- Treat All User Input as Hostile: Assume any field submitted by a user, even a simple URL in a triage environment, will eventually be passed to an HTTP client. Validate hosts before credentials are attached.
- Scope Down Automation: Deprecate Classic PATs. 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.
The WinGet moderators are doing exactly what the open-source ecosystem asks of them: managing a flood of community submissions using automation to make the workload sustainable. 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. A package registry is only as secure as the laptops of its moderators, and a blind automated loop is the perfect target.
Leveraging AI cyber offense for security
The way this vulnerability was found matters as much as the vulnerability itself. It surfaced during development of Cycode’s AI offensive security capabilities, which look at software the way an attacker does. No single piece of this kill chain looks dangerous on its own: a validation label, a background loop, a helper that attaches a token. The risk appears when you connect them. That’s the kind of reasoning AI models excel at.
That cuts both ways. Attackers have access to the same frontier models defenders do, and they are using them to find and chain flaws faster and more cheaply than ever. AI can turn a finding into a working exploit in minutes, and attackers now exploit newly disclosed vulnerabilities within hours.
Defenders cannot cede the advantage.
The teams that stay ahead will be the ones that leverage AI offensive capabilities proactively, validate which weaknesses an attacker could actually reach, and fix or patch them before adversaries find them. That is how this story played out: an AI-assisted discovery, a coordinated report, and a fix in place.
Disclosure and Collaboration
We would like to extend our appreciation to the Microsoft Security Response Center (MSRC) and the WinGet repository maintainers for their prompt response and professionalism throughout the coordinated disclosure process. They acknowledged the report quickly, maintained transparent communication, and deployed a robust fix to protect the ecosystem. Collaborations like this are essential to securing the open-source supply chain.
See Cycode in actionBook a demoStay ahead of AI risk
See how Cycode empowers security teams to find, validate, and fix exploitable risk across code, pipelines, and the software supply chain. Get a demo.