Deprecated: Creation of dynamic property Timber\Site::$pingback is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Site.php on line 180

Deprecated: Creation of dynamic property Timber\User::$name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/User.php on line 118

Deprecated: Creation of dynamic property Timber\Post::$has_disclaimer is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_lock is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_last is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_meta_box_present is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_send_notification is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_modify_title_and_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_heading is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_category is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_blz_affiliation_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_content_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_speciali is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskw is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_metadesc is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_linkdex is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_content_score is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskeywords is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_keywordsynonyms is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_estimated-reading-time-minutes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_thumbnail_id is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$response_body is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_indexnow_last_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_date_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$ping_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_password is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$to_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$pinged is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_content_filtered is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$guid is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$menu_order is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_mime_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_count is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$filter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71
Next.js, incredibile falla di sicurezza permette di eludere tutti i controlli

Next.js, incredibile falla di sicurezza permette di eludere tutti i controlli

Una grave vulnerabilità in Next.js, identificata come CVE-2025-29927, ha esposto le applicazioni Web al rischio di bypass dei middleware di sicurezza per anni. Il problema, presente in molteplici versioni, consente agli attaccanti di eludere i controlli di autorizzazione inviando richieste con un header specifico.

Next.js è un framework popolare, con oltre 9 milioni di download settimanali su npm, utilizzato da aziende di rilievo come TikTok, Twitch, Hulu, Netflix, Uber e Nike per sviluppare le loro applicazioni Web. Una delle caratteristiche principali di Next.js è l’integrazione di middleware per gestire autenticazione, autorizzazione, logging, gestione degli errori, reindirizzamenti, blocchi geografici e limitazione del traffico.

I middleware sono eseguiti in Next.js prima che una richiesta raggiunga il sistema di routing dell’applicazione, assicurando che siano applicati tutti i controlli di sicurezza fondamentali. Tuttavia, per evitare loop infiniti nei middleware, Next.js utilizza un header specifico, x-middleware-subrequest, che determina se una richiesta deve attraversare o meno la catena di middleware.

La notizia agghiacciante è che la vulnerabilità critica CVE-2025-29927 era presente da anni in Next.js, consentendo agli aggressori remoti di aggirare i controlli di autorizzazione e inviare richieste direttamente ai percorsi di destinazione senza passare attraverso le verifiche di sicurezza previste.

Il grave problema: bypass delle verifiche di autorizzazione in Next.js

La vulnerabilità CVE-2025-29927 risiede nel modo in cui Next.js gestisce l’header x-middleware-subrequest. La funzione runMiddleware, incaricata di elaborare le richieste in ingresso, se rileva la presenza dell’header con un valore specifico, ignora completamente l’esecuzione dei middleware e inoltra la richiesta direttamente alla destinazione finale.

I ricercatori Allam Rachid e Allam Yasser hanno pubblicato un’analisi tecnica dettagliata, spiegando che l’header e il suo valore agiscono come una chiave universale che permette di bypassare le regole di sicurezza. Un attaccante, quindi, può semplicemente inviare una richiesta HTTP contenente l’header con il valore corretto per eludere i controlli di autorizzazione e accedere a risorse riservate senza restrizioni.

La lacuna di sicurezza è quindi non soltanto davvero severa (e scaturisce da una svista davvero colossale!…), ma i dettagli tecnici dell’exploit sono ormai di dominio pubblico. Gli sviluppatori sono quindi invitati ad aggiornare immediatamente alle versioni più recenti.

Versioni affette e risoluzione del problema

Il problema riguarda tutte le versioni di Next.js precedenti alle release 15.2.3, 14.2.25, 13.5.9 e 12.3.5. Gli sviluppatori sono quindi invitati ad aggiornare immediatamente alle versioni più recenti.

Secondo il bollettino di sicurezza di Next.js, CVE-2025-29927 colpisce esclusivamente le installazioni self-hosted che utilizzano next start con output: standalone. Le applicazioni Next.js ospitate su Vercel e Netlify, o distribuite come static export, non sono interessate.

Risultano inoltre particolarmente a rischio gli ambienti in cui i middleware sono impiegati per controlli di autorizzazione o sicurezza senza ulteriori validazioni successive nel ciclo di richiesta.

Se l’aggiornamento immediato all’ultima versione di Next.js non fosse possibile, è caldamente consigliato bloccare le richieste esterne che contengono l’header x-middleware-subrequest. Inoltre, è essenziale implementare controlli di sicurezza aggiuntivi lato server per verificare correttamente le autorizzazioni.

La reazione della comunità

La scoperta della vulnerabilità in questione ha sollevato numerosi interrogativi sulla sicurezza dell’ecosistema JavaScript.

Alcuni sviluppatori hanno criticato duramente la gestione della sicurezza da parte di Next.js, con commenti del tipo: “come si può trascurare una vulnerabilità simile? Basta controllare se l’header esiste e ignorare il middleware“. Altri hanno evidenziato come il successo e l’hype attorno a Vercel stiano mettendo in secondo piano la sicurezza effettiva del framework.

In ogni caso, l’incidente evidenzia l’importanza di una gestione attenta dei meccanismi di sicurezza e la necessità di una verifica continua delle configurazioni adottate.

La sicurezza delle applicazioni Web non dovrebbe mai dipendere da un solo strato di protezione: controlli multipli, aggiornamenti tempestivi e una maggiore consapevolezza sulle potenziali falle sono essenziali per prevenire attacchi.

Ti consigliamo anche

Link copiato negli appunti