
Script di verifica della vulnerabilità React2Shell (React2Shell, noto anche come CVE-2025-55182).
verify_react_vulnerability.py)Questo è un semplice script Python autonomo creato per aiutarti a determinare rapidamente se il tuo progetto è affetto dalla critica vulnerabilità React2Shell (nota anche come CVE-2025-55182).
Esegue un controllo su due livelli:
package.json per individuare versioni note vulnerabili di React e Next.js.package.jsonpackage.jsonreact e next elencate nel tuo progetto.npm install per aggiornare a una versione sicura."use server""use client"createSafeActionClientregisterServerReferencereact-server-dom-webpackpython3 --version.pip install packaging
Assicurati che lo script verify_react_vulnerability.py sia nella directory principale del tuo progetto (la stessa directory del tuo package.json).
Apri il terminale ed esegui il comando:
python3 verify_react_vulnerability.py
Se viene trovata una versione vulnerabile di una libreria, lo script si ferma e segnala immediatamente il problema:
--- Step 1: Checking versions in package.json ---
❌ VULNERABLE: Found React version 19.0.1.
...
-------------------------------------------------
❌ SUMMARY: Your project is VULNERABLE based on dependency versions.
Please update the following dependencies immediately.
--- Recommended Fixes ---
npm install [email protected] [email protected]
...
-------------------------------------------------
Se le tue dipendenze sono sicure, lo script offrirà la scansione approfondita.
--- Step 1: Checking versions in package.json ---
✅ OK: Found React version 18.3.1. Not in a known vulnerable range.
...
-------------------------------------------------
✅ INFO: Your project's dependencies do not seem to be affected by React2Shell.
However, vulnerable features might be in use if code was copy-pasted or 'vendored'.
Do you want to perform a comprehensive deep code scan? (y/n): y
Se la scansione approfondita trova indicatori, fornirà un report dettagliato:
--- Step 2: Performing Comprehensive Deep Code Scan ---
Searching for patterns related to React Server Components...
⚠️ WARNING: Deep scan found indicators of React Server Component usage.
This does not guarantee a vulnerability, but warrants a manual review.
Ensure your framework versions are fully patched.
- Found pattern '"use server"':
Reason: Indicates a file contains React Server Actions, the primary feature associated with the vulnerability.
In files: ['src/actions/auth.ts']
- Found pattern '"use client"':
Reason: Indicates a Client Component, which may import and use Server Actions from other files.
In files: ['src/components/LoginButton.tsx', 'src/components/ThemeSwitcher.tsx']
-------------------------------------------------
Se la scansione approfondita non trova nulla, confermerà che il tuo progetto è probabilmente sicuro:
--- Step 2: Performing Comprehensive Deep Code Scan ---
Searching for patterns related to React Server Components...
✅ OK: The comprehensive deep scan did not find any indicators of RSC usage.
-------------------------------------------------