Buffer overflow in Toxcore exploited via UDP packet sending

In Toxcore, the reference implementation of the P2P messaging protocol Tox, a vulnerability (CVE-2021-44847) has been identified, which potentially allows for code execution through specially crafted UDP packets. All users of applications based on Toxcore that do not disable UDP transport are vulnerable. For an attack, it is enough to send a UDP packet knowing the victim's IP address, network port, and public DHT key (this information is publicly available in DHT, meaning the attack could be directed at any user or DHT node).

The issue was present in toxcore releases from 0.1.9 to 0.2.12 and has been fixed in version 0.2.13. As of now, only the qTox project has released an update to address the vulnerability for client applications. As a workaround for protection, UDP can be disabled while keeping TCP support.

La vulnerabilità è causata da un overflow del buffer nella funzione handle_request(), che si verifica a causa di un calcolo errato delle dimensioni dei dati nel pacchetto di rete. In particolare, la lunghezza dei dati crittografati era determinata nel macro CRYPTO_SIZE, definito come «1 + CRYPTO_PUBLIC_KEY_SIZE * 2 + CRYPTO_NONCE_SIZE», utilizzato in seguito nell'operazione di sottrazione «lunghezza - CRYPTO_SIZE». A causa dell'assenza di parentesi nel macro, invece della sottrazione della somma di tutti i valori, veniva effettuata la sottrazione di 1 e l'addizione delle altre parti. Ad esempio, invece di «lunghezza - (1 + 32 * 2 + 24)», la dimensione del buffer veniva calcolata come «lunghezza - 1 + 32 * 2 + 24», portando a un sovrascrittura dei dati nello stack, oltre il limite del buffer.

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