PinTheft — sesta vulnerabilità di tipo Copy Fail, che fornisce diritti di root in Linux

È stata rivelata la sesta vulnerabilità (1, 2-3, 4, 5) che consente a un utente locale non privilegiato di ottenere diritti di root sovrascrivendo i dati nella cache delle pagine. La vulnerabilità è stata soprannominata PinTheft. È disponibile un prototipo dell'exploit. L'identificativo CVE non è ancora stato assegnato. La correzione è attualmente disponibile solo come patch, pubblicata il 5 maggio, e il 11 maggio è stata accettata nel ramo netdev, ma non è stata inclusa nei rilasci correttivi del nucleo.

La vulnerabilità è presente nell'implementazione del protocollo di rete RDS (Reliable Datagram Sockets), destinato allo scambio di messaggi ad alta velocità tra nodi all'interno di un cluster, con minima latenza e consegna garantita. L'attacco è possibile su sistemi con il sottosistema io_uring attivato (io_uring_disabled=0) e un nucleo compilato con le opzioni CONFIG_RDS, CONFIG_RDS_TCP e CONFIG_IO_URING. Per far funzionare l'exploit, deve esserci un file eseguibile leggibile nel sistema con il flag SUID-root.

Per caricare automaticamente il modulo del kernel rds_tcp, l'exploit richiede l'invio di dati tramite RDS utilizzando il trasporto SO_RDS_TRANSPORT=2. Va notato che tra le distribuzioni Linux testate, il modulo del kernel rds è fornito solo in Arch Linux nella configurazione predefinita. Per mitigare la vulnerabilità, è possibile impedire il caricamento automatico dei moduli del kernel rds e rds_tcp: rmmod rds_tcp rds printf 'install rds /bin/false\ninstall rds_tcp /bin/false\n' > /etc/modprobe.d/pintheft.conf

La vulnerabilità è causata da un errore nell'implementazione del meccanismo zerocopy nella funzione rds_message_zcopy_from_user(), che effettua la modifica diretta dei dati nella cache delle pagine per evitare un'eccessiva buffering. In caso di errore, non avveniva la pulizia del campo rm->data.op_nents, causando quindi un doppio rilascio del buffer (double-free). È stato possibile sfruttare l'emergere di un valore errato nel contatore dei riferimenti per sovrascrivere i dati nella cache delle pagine, grazie alla manipolazione del puntatore su un buffer fisso io_uring.

In other respects, the exploitation mechanism is typical for all vulnerabilities of this class — the attacker achieves the placement of a program file with the suid root flag in the page cache, after which they replace the ELF header with code to run /usr/bin/sh. Following this manipulation, running the program results in loading into memory not the original executable file from the storage, but a modified copy from the page cache. Unlike previous exploits, the new variant is adapted specifically to attack the 'su' utility, but it can also be used if the system has other suid programs, such as mount, passwd, chsh, newgrp, umount, and pkexec.

Fonte: opennet.ru

Acquista hosting affidabile per siti web con protezione DDoS, VPS VDS server 🔥 Acquista hosting affidabile per siti web con protezione DDoS, VPS VDS server | ProHoster