Fixing The React2Shell Vulnerability in Large and Complex Enterprise Codebases (Part 2)
fix-and-track-affected-code-react-server-components-cve-2025-55182-part-2
This post builds on our previous post (hereafter Part 1) on using Sourcegraph to address CVE-2025-55182. The purpose of this post is to describe how you can automate this remediation process and track organizational progress across your codebase. We focus on four capabilities required to complete remediation at scale: Batch Changes, Sourcegraph MCP, and Deep Search.
Part 1 showed how to identify every repository containing vulnerable versions of:
- react-server-dom-webpack
- react-server-dom-parcel
- react-server-dom-turbopack
For example, you can use the simple query:
context:global file:package.json "react-server-dom-(webpack|parcel|turbopack)":\s*"[~^]?(19\.0(\.0)?|19\.1\.[01]|19\.2\.0)" patterntype:regexp*
to rapidly find potentially vulnerable repositories (when searching thousands of repositories across a variety of code hosts this search takes ~8 ms). Finding these instances is only the first step. Large engineering organizations do not manually fix these vulnerabilities. Dependency changes must be applied consistently across all impacted repositories, lockfiles must be regenerated, branches must be created, and pull requests must be opened. Doing this manually is slow and error-prone, making it challenging to repeat reliably.
This is where Batch Changes enters the workflow.
Automate upgrade patches across all affected repositories
Once you’ve identified the affected repositories or the query that matches them, the next step is to apply consistent, safe upgrades to these repositories. Manually updating hundreds of codebases is not practical; Batch Changes enables an automated process that finds affected repositories, creates patches, commits them, and opens pull requests across all your repositories in parallel. Using the query from Part 1, you can use the repositoriesMatchingQuery field to apply your changes to each of the vulnerable repositories.
An open Batch Changes spec
View of the Batch Changes spec for our specific example.
- Detects vulnerable versions (19.0.0, 19.1.0, 19.1.1, 19.2.0)
- Upgrades to patched version ^19.2.1
- Regenerates lockfiles
- Creates a branch + commit
- Opens a pull request
This defines the upgrade once and applies it everywhere.
If your organization also uses Next.js, then you would follow a similar process to identify vulnerable repos and use Batch Changes to apply fixes (15.x patched builds, 16.0.7, 14 replacing 14.3.0-canary). Here are generalized Batch Changes scripts you can use to address these React and Next.js vulnerabilities using the queries from Part 1 to identify vulnerable repos instead of specifying a known vulnerable repo.
Using the Sourcegraph MCP server to find and fix vulnerabilities
If you prefer to completely automate this process end-to-end, then we recommend using our MCP server, where you can use any agent to:
- Find all repositories containing a vulnerable version
- Find all files containing vulnerable lines
- Generate batch changes YAML script
- Use the Sourcegraph CLI to execute batch changes
Example MCP query that finds repositories containing vulnerable React Server Components:
find repos with vulnerable versions of React 19.0, 19.1.0, 19.1.1, 19.2.0
Using the Sourcegraph MCP server with Amp to get the list of repositories with vulnerabilities
You can then pass the Batch Change documentation or start from a template in the Batch Changes UI to draft your Batch Changes script.
Automate PRs to fix the React Server Components vulnerability across all your code
After you (or your agent) create the batch script, you (or your agent) can then use the Sourcegraph CLI to execute it, or you can create and run the batch change directly through the UI.
Example using the Sourcegraph CLI:
Terminal view of using the Sourcegraph CLI to run Batch Changes
After executing the Batch Change, you have the opportunity to preview the modifications before they are published as a pull request across the affected repositories. Once you look over the preview in the UI (see example below), you can then publish the changes.
UI view of Batch Changes preview
Then you can publish the change as a PR in GitHub where it can be merged.
Merged change produced by Batch Changes PR on GitHub
Track the progress of applying fixes across all your code
To track vulnerable vs. fixed files across your repositories over time, you can add a data series that corresponds to matches with vulnerable versions and a data series that finds matches of the fixed versions.
Here is an example where we are tracking the migration from the PR in our test repository created from our Batch Changes script. We selected the repository explicitly here, but you can also assign repositories that match a particular query (e.g., the query we used earlier to identify the list of repos in our instance that are affected by the vulnerability).
React Server Components Vulnerabilities by Exploit Type
Using Deep Search to validate full remediation
Deep Search enables semantic follow-ups:
- “Are any repositories still importing vulnerable versions of RSC?”
- “Are any lockfiles still referencing 19.1.1?”
- “Do any build artifacts still package vulnerable versions?”
Example Deep Search request to see whether vulnerabilities remained in our repository
Deep Search’s agentic search process enables you to easily check for any remaining vulnerabilities by translating natural-language into complex Code Search queries that identify all instances across your system. You can see in our example we fixed one vulnerability but neglected to include patches for other impacted versions, and Deep Search has alerted us that we should make these changes.
End-to-end workflow summary
- Identify vulnerable React Server Component versions (Part 1)
- Automate vulnerability fixes using the Sourcegraph MCP
- Apply upgrades at scale with a single Batch Changes spec
- Verify full remediation using Deep Search
Sourcegraph helps you complete the code security lifecycle from detection → remediation → verification.
Getting started with Sourcegraph
Schedule a conversation to see how Sourcegraph can help you and your team find code, make large-scale changes, and track changes across codebases of any scale and with any number of code hosts.
Special thanks to Erik Seliger, Robert Lin, and Justin Dorfman for their valuable feedback on this post.
Sourcegraph Blog
https://webflow.sourcegraph.com/blog/fix-and-track-affected-code-react-server-components-cve-2025-55182-part-2Sign in to highlight and annotate this article

Conversation starters
Daily AI Digest
Get the top 5 AI stories delivered to your inbox every morning.
More about
componentA Unified Pulse-Shaped OFDM Framework for Chirp-Domain Waveforms: Continuous-Time Modeling and Practical I/O Analysis
arXiv:2603.14358v2 Announce Type: replace-cross Abstract: In this paper, a unified framework for chirp-domain waveforms, including orthogonal chirp division multiplexing (OCDM) and affine frequency division multiplexing (AFDM), is developed. Based on their continuous-time representations, we show that these waveforms fall within the conventional Weyl-Heisenberg (WH) framework for multicarrier (MC) waveforms, where the root chirp corresponds to the prototype pulse in the WH framework. Since the chirp is a constant-envelope signal and is transparent to subcarrier orthogonality, these waveforms can be further interpreted as pulse-shaped (PS) orthogonal frequency division multiplexing (OFDM). Within the developed PS-OFDM framework, the power spectral density of chirp-domain waveforms is derive

Why Your Frontend Is Actually a State Machine (And AI Makes It More Complicated)
<p>When most developers think about frontend development, they imagine components, UI elements, and responsive layouts. </p> <p>What we rarely acknowledge is that <strong>every modern frontend is fundamentally a state machine</strong> — a system where the state drives the UI, and events drive state changes. </p> <p>Add AI-driven features, predictive models, or automated agents, and your “simple” frontend suddenly becomes a complex web of interacting states, transitions, and events.</p> <h2> Frontends Are State Machines </h2> <p>Consider what a state machine is:</p> <ul> <li> <strong>States</strong> represent the current status of your system.</li> <li> <strong>Transitions</strong> are triggered by events (user clicks, API responses, timers, etc.).</li> <li> <strong>Actions</strong> happen

Your AI Writes Code. Who Fixes the Build?
<p>Every AI coding tool in 2026 can write code. Some of them write great code. But here's the question nobody asks during the demo: <strong>what happens when the build fails?</strong></p> <p>Because the build will fail. It always does.</p> <h2> The Invisible 40% </h2> <p>When you watch a demo of an AI coding tool, you see the impressive part: the AI generates a full component, a complete function, an entire page. It looks magical.</p> <p>What you don't see is what happens next:</p> <ul> <li>The import path is wrong because the AI didn't read the project's module structure</li> <li>There's a type mismatch because the API response shape changed last week</li> <li>A dependency is missing because the AI assumed it was already installed</li> <li>A CSS class doesn't exist because the AI used Tai
Knowledge Map
Connected Articles — Knowledge Graph
This article is connected to other articles through shared AI topics and tags.
More in Generative UI
Tech Sell-Off: 1 No-Brainer Artificial Intelligence (AI) ETF to Buy With $62 and Hold for the Long Term - AOL.com
<a href="https://news.google.com/rss/articles/CBMib0FVX3lxTE5Dc0U2NWV2NFFCNmVVRnJ2VnJ5NG5DVWJrM1A0OUpzbE9ZYUsybm9jU0ZzdzRsdUltLXp5OUpaSnpDUXNacHgycnZpNGpIaFZrR0FKcEVXYWZ5V21nSERXbjYzV0IwMTdTRmZnMTFDVQ?oc=5" target="_blank">Tech Sell-Off: 1 No-Brainer Artificial Intelligence (AI) ETF to Buy With $62 and Hold for the Long Term</a> <font color="#6f6f6f">AOL.com</font>
The Strange, Shaky Alliance Taking on Trump and His Big Tech Friends - Politico
<a href="https://news.google.com/rss/articles/CBMiowFBVV95cUxObFY0TDJNZWpubkotblBlYlpNWXJhVm1RbVR2THBxT2I0OFoxdGg3MlFRczdNWGlXSUZsRjhVN1ptR0x5cTRhOUZrNGhVUWlyWUlYbk8zeWg1RFBRQ2lVcmp4ak9FUDBwa2VWeGk5ZEdCSjVObVlJdnNIWTZqWmdibC03SFhRVTJ2WkRxYzZEV0RXMEhvSjlrSXB0bldLUlZsdExj?oc=5" target="_blank">The Strange, Shaky Alliance Taking on Trump and His Big Tech Friends</a> <font color="#6f6f6f">Politico</font>
How San Diego is using AI now - Axios
<a href="https://news.google.com/rss/articles/CBMiyAFBVV95cUxPZnlwWlpXMnZhLVJLdXZnSGhFQkdsUHJhZlBqQllpOFZENEtLR0tRUDk4THVSMmVUUTRnZFoydEFmeHBNa1NaMzlEQnVGajRoVkVRTWlPaXpVNFAyaC1sNDV0Zzh3dHUtVDAwRDg2bEdaV2N4RF9TNVpUR0p2QUhMTWh0MGhJTm5OeXpQYkI3T2NYbXNQY2hHSGFvTG5KN0JqQ3hIVkRaM0VQNXlVcGx4N0JIc3NLZ3ZWSjNMMWRLNGozd19oOU9idg?oc=5" target="_blank">How San Diego is using AI now</a> <font color="#6f6f6f">Axios</font>
California Just Signed A Pioneering Executive Order Establishing The First-Ever U.S. Guidelines For AI-Generated Content - Secret Los Angeles
<a href="https://news.google.com/rss/articles/CBMihAFBVV95cUxQdGhTR2hURC0wQmJIWVlncEo3VEc5WUNEYTlHb1gtbktUVjhoSE90ZXJ2dG9JWkNoejZSWW1SRllhSkxONk9WWHZ6amQ4UlR5RE1VempndlVNTTBCdVp6b2k0b0c1NmtFMGNGQ2Y3V01MMVZab05VR2pOUmt3c3VuU08xTXk?oc=5" target="_blank">California Just Signed A Pioneering Executive Order Establishing The First-Ever U.S. Guidelines For AI-Generated Content</a> <font color="#6f6f6f">Secret Los Angeles</font>
Discussion
Sign in to join the discussion
No comments yet — be the first to share your thoughts!