Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
300 changes: 300 additions & 0 deletions _docs/security/CVE-2025-55182-React2Shell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,300 @@
# CVE-2025-55182 (React2Shell) - Critical Security Update

**Status**: ✅ **RESOLVED - Upgrade Completed (December 6, 2025)**
**CVE ID**: CVE-2025-55182
**Vulnerability Name**: React2Shell
**Severity**: Critical (RCE - Remote Code Execution)
**Date Identified**: December 2025
**Last Updated**: December 6, 2025

---

## Executive Summary

CVE-2025-55182 is a critical remote code execution (RCE) vulnerability affecting React Server Components in Next.js applications. Public exploits are available, and threat actors are actively probing for vulnerable applications. **Immediate upgrade is required.**

### Current Status

- **Current Next.js Version**: 16.0.7 (PATCHED) ✅
- **Required Version**: 16.0.7 (PATCHED)
- **Upgrade Status**: ✅ **COMPLETED** (December 6, 2025)

---

## Vulnerability Details

### What is React2Shell?

React2Shell is a critical RCE vulnerability that affects React Server Components (RSC) implementations. The vulnerability allows attackers to execute arbitrary code on the server, potentially leading to:

- Complete server compromise
- Data exfiltration
- Unauthorized access to internal systems
- Service disruption

### Affected Versions

All Next.js versions between **15.0.0** and **16.0.6** are vulnerable:

| Next.js Version Range | Patched Release |
|----------------------|-----------------|
| 15.0.x | 15.0.5 |
| 15.1.x | 15.1.9 |
| 15.2.x | 15.2.6 |
| 15.3.x | 15.3.6 |
| 15.4.x | 15.4.8 |
| 15.5.x | 15.5.7 |
| **16.0.x** | **16.0.7** ⬅️ **Our Target** |
| 14 canaries after 14.3.0-canary.76 | Downgrade to 14.3.0-canary.76 |
| 15 canaries before 15.6.0-canary.58 | 15.6.0-canary.58 |
| 16 canaries before 16.1.0-canary.12 | 16.1.0-canary.12+ |

### Threat Landscape

- ✅ **Public Exploits Available**: Proof-of-concept exploits are publicly available
- ✅ **Active Exploitation**: Threat actors are actively probing for vulnerable applications
- ✅ **Vercel WAF Protection**: Vercel has deployed WAF rules to block known exploit patterns
- ⚠️ **WAF Limitations**: WAF rules cannot guarantee 100% protection against all variants
- 🔴 **Upgrade Required**: Upgrading to a patched version is the **only complete fix**

---

## Remediation Steps

### Step 1: Verify Current Version

Check your current Next.js version using one of these methods:

**Method 1: Browser Console**
```javascript
// Load any page from your app and run:
next.version
```

**Method 2: Package.json**
```bash
# Check package.json
grep '"next":' package.json
```

**Method 3: Installed Package**
```bash
pnpm list next
```

### Step 2: Automated Fix (Recommended First Attempt)

Vercel has provided an automated fix tool:

```bash
npx fix-react2shell-next
```

This tool will:
- Detect vulnerable Next.js versions
- Automatically upgrade to the patched version
- Update related dependencies if needed

### Step 3: Manual Upgrade (If Automated Tool Doesn't Work)

If the automated tool doesn't work or you need manual control:

1. **Update package.json**:
```json
{
"dependencies": {
"next": "16.0.7" // Update from 16.0.3
},
"devDependencies": {
"@next/bundle-analyzer": "^16.0.7" // Update to match Next.js version
}
}
```

2. **Update dependencies**:
```bash
pnpm install
```

3. **Verify installation**:
```bash
pnpm list next
# Should show: next@16.0.7
```

### Step 4: Verify Upgrade

1. **Check version in browser**:
- Load any page from your app
- Open browser console
- Run: `next.version`
- Should display: `"16.0.7"`

2. **Run type checking**:
```bash
pnpm run typecheck
```

3. **Test build**:
```bash
pnpm run build
```

4. **Test dev server**:
```bash
pnpm run dev
```

### Step 5: Test Critical Functionality

After upgrade, verify these critical features still work:

- ✅ Dynamic routes (e.g., `/features/[slug]`, `/products/[slug]`)
- ✅ Server components and server actions
- ✅ API routes
- ✅ Middleware functionality
- ✅ Metadata generation
- ✅ Image optimization

---

## Project-Specific Upgrade Details

### Current Configuration

- **Package Manager**: pnpm 9.15.9+
- **Node Version**: >=20.0.0 <21.0.0
- **Next.js Version**: 16.0.3 → **16.0.7** (target)

### Related Packages to Update

- `next`: `16.0.3` → `16.0.7`
- `@next/bundle-analyzer`: `^16.0.3` → `^16.0.7`
- `@next/third-parties`: `^15.4.3` (check compatibility, may need update)

### Files Modified

- `package.json` - Update Next.js and related @next package versions
- `pnpm-lock.yaml` - Auto-updated by `pnpm install`

---

## Risk Assessment

### Upgrade Risk: **LOW**

This is a **patch version upgrade** (16.0.3 → 16.0.7) within the same major.minor version, which means:

- ✅ **No Breaking Changes Expected**: Patch versions typically only include bug fixes and security patches
- ✅ **Backward Compatible**: Should not require code changes
- ⚠️ **Testing Required**: Still need to verify critical functionality works

### Security Risk: **CRITICAL**

- 🔴 **Public Exploits Available**: Attackers can easily exploit this vulnerability
- 🔴 **Active Probing**: Threat actors are actively scanning for vulnerable apps
- 🔴 **RCE Impact**: Successful exploitation leads to complete server compromise
- 🔴 **Immediate Action Required**: Upgrade cannot be delayed

---

## Deployment Checklist

- [ ] Run automated fix tool: `npx fix-react2shell-next`
- [ ] Verify Next.js version updated to 16.0.7
- [ ] Run `pnpm install` to update lockfile
- [ ] Run `pnpm run typecheck` - verify no type errors
- [ ] Run `pnpm run build` - verify build succeeds
- [ ] Run `pnpm run dev` - verify dev server starts
- [ ] Test critical routes (dynamic routes, API routes)
- [ ] Test server components and server actions
- [ ] Verify middleware functionality
- [ ] Check production deployment on Vercel
- [ ] Monitor for any errors or warnings post-deployment

---

## Post-Upgrade Monitoring

After deployment, monitor for:

1. **Build Errors**: Check build logs for any new errors
2. **Runtime Errors**: Monitor application logs for unexpected behavior
3. **Performance Issues**: Watch for any performance degradation
4. **Function Timeouts**: Monitor for unusual POST requests or timeout spikes
5. **Unexpected Behavior**: Review application activity for anomalies

---

## Additional Resources

### Official Documentation

- **Vercel Security Advisory**: [Blog Post](https://vercel.com/blog)
- **React Security Advisory**: [react.dev blog](https://react.dev/blog)
- **Next.js Security Advisory**: Check Next.js documentation

### Vercel Platform Protections

- ✅ **WAF Rules**: Vercel has deployed WAF rules to block known exploit patterns
- ✅ **Deployment Blocking**: Vercel blocks new deployments of vulnerable Next.js versions
- ⚠️ **Not a Replacement**: WAF rules are a defense layer, not a replacement for upgrading

### Support

- **Vercel Security Email**: security@vercel.com
- **HackerOne Bounty Program**: $25,000 (high) / $50,000 (critical) for bypass reports

---

## FAQ

### Q: How do I know if my app was exploited?

A: Review application logs for:
- Unusual POST requests
- Spikes in function timeouts
- Unexpected behavior or activity
- However, note that function timeouts don't reliably indicate compromise

### Q: Are Vercel WAF rules enough protection?

A: No. WAF rules provide an additional layer of defense but cannot guarantee 100% protection against all possible attack variants. **Upgrading to a patched version is the only complete fix.**

### Q: What if I'm using canary-only features?

A: You should still prioritize updating. See the Next.js Security Advisory for instructions on updating without disabling canary features.

### Q: Should I test with publicly available POCs?

A: **No.** We caution against using publicly available exploits against production environments. Instead, follow the verification steps above.

### Q: What about other frameworks using React Server Components?

A: If you use another framework implementing RSC, consult the React Security Advisory on react.dev for framework-specific guidance.

---

## Change Log

| Date | Action | Details |
|------|--------|---------|
| 2025-12-06 | Document Created | Initial documentation for CVE-2025-55182 |
| 2025-12-06 | Upgrade Plan Created | Plan created for Next.js 16.0.3 → 16.0.7 upgrade |
| 2025-12-06 | Upgrade Completed | Successfully upgraded Next.js from 16.0.3 to 16.0.7 |
| 2025-12-06 | Verification Complete | Confirmed Next.js 16.0.7 installed, build tested |

---

## Related Files

- `package.json` - Package dependencies
- `pnpm-lock.yaml` - Dependency lockfile
- `.cursor/plans/upgrade_next.js_to_patch_cve-2025-55182_*.plan.md` - Upgrade plan

---

**Last Reviewed**: December 6, 2025
**Next Review**: After upgrade completion
**Document Owner**: Security Team

Loading
Loading