NuGet

The Moq NuGet SponsorLink Incident

Updated 5 Oct 2026 · Incident date 8 Aug 2023

Moq 4.20.0 and 4.20.1 on NuGet added SponsorLink, which sent a hash of the developer's git email to a server during builds, in August 2023.

The package maintainer added it, not an outside attacker. Version 4.20.2 removed the dependency.

What happened

A trusted package started to collect data from developers when they compiled.

  • Moq added the sub-dependency Devlooped.SponsorLink.
  • It ran git config --get user.email in a separate process and hashed the email with SHA-256.
  • It sent the result to https://cdn.devlooped.com/sponsorlink.
  • It ran at build time as a .NET analyzer, with no setting to turn it off.
  • It skipped CI systems when it saw variables such as CI, TF_BUILD, TRAVIS and JENKINS_URL.

According to Checkmarx, versions 4.20.0 and 4.20.1 came out on 8 August 2023. Developers reported the behavior on 9 August.

Affected versions

  • Moq 4.20.0 and 4.20.1, released on 8 August 2023.
  • Last version before the change: 4.18.4.
  • Reverted in 4.20.2.

Indicators of compromise

  • Package reference: Devlooped.SponsorLink in a project or in packages.lock.json.
  • Moq version 4.20.0 or 4.20.1.
  • Outbound request to cdn.devlooped.com/sponsorlink during a build on a developer machine.
  • A git config process started by the build.

How to check

List the Moq version and the SponsorLink package in each solution. Any hit means the build possibly sent the hash.

dotnet list package --include-transitive | grep -iE "moq|sponsorlink"

Search the NuGet cache for the package.

ls ~/.nuget/packages | grep -i sponsorlink

What to do now

  1. Move to Moq 4.20.2 or a version before 4.20.0, such as 4.18.4. Check that Devlooped.SponsorLink is gone from the lockfile.
  2. Delete the SponsorLink package from the NuGet cache.
  3. Block Moq 4.20.0 and 4.20.1 in your package feed.
  4. Ask your privacy officer if a hashed email counts as personal data in your case.

Frequently asked questions

What did the maintainer say?

Daniel Cazzulino said the real email is never sent and the hash uses SHA-256 then Base62 encoding. Full emails were stored only after a user installed the SponsorLink GitHub app.

Who uses Moq?

Snyk and BleepingComputer name Microsoft PowerToys and Jellyfin. Snyk reports 10,356 downloads of 4.20.0 in under 24 hours.

Sources

  1. checkmarx.com/blog/popular-nuget-package-moq-silently-exfiltrates-user-data-to-cloud-service/
  2. snyk.io/blog/moq-package-exfiltrates-user-emails/
  3. bleepingcomputer.com/news/security/popular-open-source-project-moq-criticized-for-quietly-collecting-data/

Send this page to the person who looks after AI at your company.

Email it

More supply chain attacks

All 172 attacks in the library · What is a supply chain attack? · How to prevent supply chain attacks

Check the next update before you install it

Vigilance compares the version you trust with the new one. It names the one file that gained a power the old version did not have.

Start the free 14-day trialBrowse the attack library