Critical immer vulnerability in @sanity/desk-tool - update to 9.0.6?

16 repliesLast updated: Dec 1, 2025

Our security team has found there is a vulnerability in the
@sanity/desk-tool
. When I run
yarn audit
you can see the issue. Is it possible to update the dependency of immer to 9.0.6? This is the critical vulnerabilities:
┌───────────────┬──────────────────────────────────────────────────────────────┐
criticalPrototype Pollution in immer
├───────────────┼──────────────────────────────────────────────────────────────┤
Packageimmer
├───────────────┼──────────────────────────────────────────────────────────────┤
Patched in>=9.0.6
├───────────────┼──────────────────────────────────────────────────────────────┤
Dependency of │ @sanity/desk-tool
├───────────────┼──────────────────────────────────────────────────────────────┤
Path          │ @sanity/desk-tool > @sanity/form-builder >                   │
│               │ @sanity/portable-text-editor > slate > immer
├───────────────┼──────────────────────────────────────────────────────────────┤
More info<https://www.npmjs.com/advisories/1002492>                     │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
criticalPrototype Pollution in immer
├───────────────┼──────────────────────────────────────────────────────────────┤
Packageimmer
├───────────────┼──────────────────────────────────────────────────────────────┤
Patched in&gt;=9.0.6
├───────────────┼──────────────────────────────────────────────────────────────┤
Dependency ofsanity-plugin-media
├───────────────┼──────────────────────────────────────────────────────────────┤
Pathsanity-plugin-media &gt; @reduxjs/toolkit &gt; immer
├───────────────┼──────────────────────────────────────────────────────────────┤
More info<https://www.npmjs.com/advisories/1002492>                     │
└───────────────┴──────────────────────────────────────────────────────────────┘
AI Update

I can help you with this security vulnerability issue. The @sanity/desk-tool package you're seeing is from Sanity Studio v2, which reached end-of-life on April 1st, 2024, and no longer receives security updates.

The Solution: Upgrade to Studio v3+

The immer vulnerability you're experiencing (immer 9.0.6 prototype pollution advisory 1002492) was resolved when Sanity migrated to Studio v3. In Studio v3 and later:

Why You Can't Just Update immer

You can't simply update the immer dependency to 9.0.6 because:

Your Action Items

For the first vulnerability (via @sanity/desk-tool):

For the second vulnerability (via sanity-plugin-media):

If you absolutely cannot upgrade immediately, you could try using yarn resolutions to force immer to 9.0.6:

"resolutions": {
  "immer": "9.0.6"
}

However, this may break functionality and is not supported. The proper solution is upgrading to Studio v3 or v4, which removes these vulnerable dependencies entirely. Since Studio v2 is past its end-of-life date, continuing to use it poses ongoing security risks beyond just this immer vulnerability.

Show original thread
16 replies

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Related contributions