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::$_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::$_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_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_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::$_yoast_wpseo_wordproof_timestamp 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_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::$_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::$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
Password Bitwarden rubate sfruttando una vulnerabilità di Nginx

Password Bitwarden rubate sfruttando una vulnerabilità di Nginx

Bitwarden è un gestore di password open source che offre la possibilità di memorizzare, organizzare e generare password complesse in modo sicuro. Quando si parla di password Bitwarden ci si riferisce all’archivio contenente le credenziali degli utenti.

Il password manager di Bitwarden è disponibile sia come servizio cloud ma è prevista anche la possibilità di ospitare il sistema su un proprio server Web.

Il funzionamento di Bitwarden si basa su un’architettura client-server, dove il client è un’applicazione installata su diversi dispositivi (computer, smartphone, tablet) e il server è responsabile dell’archiviazione e della gestione delle credenziali.

Per interagire con le password archiviate lato server, si può scegliere e configurare qualunque server Web, compreso Nginx.

Secondo i dati di W3Tech, a giugno 2022, Nginx deteneva la quota di mercato più elevata tra i server Web, con il 33,6% dei siti che lo utilizzava. Secondo Docker, Nginx è la soluzione più utilizzata all’interno dei software containerizzati. Questa popolarità rende le vulnerabilità legate a Nginx ancora più rilevanti e, se vogliamo, ancora più critiche.

È stato inoltre ripetutamente dimostrato come errori di configurazione in Nginx possono impattare direttamente sulla disponibilità delle applicazioni e dei dati oltre che sulla loro integrità e riservatezza.

Vulnerabilità alias traversal: cosa sono e perché sono pericolose

Il termine alias traversal si riferisce a una vulnerabilità di sicurezza che può verificarsi quando viene utilizzata la direttiva alias nelle configurazioni dei server Web. L’alias è una funzionalità utilizzata anche da Nginx che consente di mappare una determinata directory su un URL specifico.

Il problema di sicurezza si presenta quando un utente malintenzionato tenta di sfruttare l’alias per accedere a file o directory al di fuori del percorso specificato. Ad esempio, se un’applicazione Web utilizza l’alias per mappare la directory /var/www sull’URL /static, un utente potrebbe tentare di accedere a ../secrets per ottenere visibilità a file riservati senza disporre di alcuna autorizzazione.

Cos’è la direttiva location e come può essere sfruttata

La direttiva location viene utilizzata in Nginx per specificare come il server deve gestire le richieste per un determinato percorso o URL. Consente di definire le regole per la corrispondenza delle richieste e di configurare le azioni da intraprendere. Tuttavia, la direttiva location può anche essere sfruttata per attacchi ai server Nginx se non viene configurata correttamente. Ci sono diverse tecniche di attacco che possono essere utilizzate: un aggressore può far leva su un match ambiguo o errato, iniettare codice o disporre reindirizzamenti indesiderati o non sicuri.

Un semplice esempio di vulnerabilità che può essere utilizzata per aggredire le applicazioni erogate da Nginx

Daniel (Celesian) Matsumoto (Hakai Offensive Security) fa il punto sulle configurazioni errate di Nginx che possono introdurre vere e proprie vulnerabilità sfruttabili da remoto. Le situazioni seguenti, che coinvolgono l’uso delle direttive citate in precedenza, espongono a rischi concreti:

  • Una direttiva location non ha la barra finale nel percorso.
  • Una direttiva alias è presente nel contesto di location e termina con una barra.

Matsumoto cita il seguente esempio di configurazione vulnerabile:

location /img {
    alias /var/images;
}

Un aggressore può provare ad accedere alle cartelle a valle del percorso indicato inviando una richiesta per la risorsa /img..

Ricevendo una risposta di reindirizzamento da Nginx, l’attaccante può accertare l’esistenza della vulnerabilità. Qualsiasi file o directory figlio all’interno della directory principale risulta così accessibile e Nginx li servirà al client.

Per un utente malintenzionato ciò significherebbe accedere a tutti i file ospitati nella /var/. Con semplici payload, come GET verso /img../log/nginx/access.log è ad esempio possibile scaricare un file di registro.

Password Bitwarden a rischio con le configurazioni errate di Nginx

Come anticipato nell’introduzione, Bitwarden offre un’opzione self-hosted a beneficio di coloro che desiderano mantenere il proprio gestore di password lato server.

Tra i modi per installare e configurare rapidamente Bitwarden, uno dei modi ufficialmente presentati si chiama Unified: si tratta di una configurazione appositamente creata per semplificare l’implementazione della piattaforma.

Analizzando il contenuto del repository di Bitwarden, Matsumoto si è accorto che inviando una richiesta “ad hoc” (non autenticata; l’utente remoto non deve aver effettuato alcun login…) è incredibilmente possibile scaricare l’intero database Bitwarden in formato SQLite3 (URL simile al seguente: http://<instance>/attachments../vault.db).

È possibile anche recuperare i file di registro di Bitwarden, che hanno un nome prevedibile e possono essere tutti scaricati accedendo a percorsi già noti.

In conclusione, Nginx è uno strumento robusto ed estremamente che “fa funzionare” una notevole parte dei siti Web che visitiamo ogni giorno. Eppure alcune insidie, come quelle presentate in questo articolo, spesso risultato di configurazioni errate, possono inavvertitamente trasformare il server Web nell’anello debole della catena.

L’approccio di Nginx alla sicurezza lascia agli sviluppatori l’onere di evitare configurazioni pericolose, sottolineando l’importanza di una comprensione approfondita delle varie impostazioni e di un’implementazione prudente.

Ti consigliamo anche

Link copiato negli appunti