
Un ricercatore di Tenable, David Wells, ha scoperto tre vulnerabilità nel popolare router TL-WR841N di TP-Link, una delle quali può essere sfruttata – assieme a un’altra vulnerabilità già nota – per prendere il completo controllo del dispositivo.

Il TL-WR841N è un router molto diffuso, costa poco (fra i 20 e i 30 Euro) ed è sul mercato ormai da molti anni. Anche in Italia è presente nelle case di molte famiglie, basti pensare che Amazon lo considera “Amazon’s Choice” – il prodotto raccomandato nella sua categoria – e che attualmente detiene l’invidiabile seconda posizione nell’elenco dei router più venduti da Amazon.it.

Le vulnerabilità scoperte sono le seguenti:
CVE-2018-11714 – un errore di autenticazione che consente a un attaccante, non autenticato, di lanciare una serie di routine CGI nella pagina di amministrazione del router, attraverso lo spoofing di un HTTP Referrer da tplinkwifi.net, tplinklogin.net o dall’indirizzo IP del router. Questa vulnerabilità era già stata pubblicata a giugno dal ricercatore Touhid Shaikh, ma assieme alla seguente CVE-2018-15702 consente un exploit critico.
CVE-2018-15702 – un errore nella funzione di controllo della whitelist degli HTTP referrer, presente all’interno del servizio httpd del router.
CVE-2018-15700 e CVE-2018-15701 – Due vulnerabilità di denial of service (DoS), la prima nel campo referrer e la seconda nel campo cookie, che possono mandare in crash il servizio httpd.
Il problema principale è rappresentato dalla funzione che controlla se un indirizzo HTTP referrer sia o meno nella whitelist. La whitelist contiene i domini di TP-Link tplinkwifi.net, tplinklogin.net e l’indirizzo IP del router. Il problema però è che la funzione controlla solo i primi 14 o 15 caratteri del dominio, quindi un attaccante potrebbe creare un sottodominio ad hoc su un dominio da lui controllato, come ad esempio tplinklogin.net.dominiohacker[.]com, e by-passare il controllo.
Il tutto è ben spiegato in un articolo di Wells, nonché in un video dove si può vedere un proof-of-concept.
Purtroppo TP-Link al momento di scrivere non ha ancora rilasciato una patch per questo router un po’ datato, visto che il firmware è ancora fermo alla versione 0.9.1 4.16 (quella vulnerabile) rilasciata a febbraio.
Fra l’altro nel loro articolo i ricercatori di Tenable hanno pubblicato il processo di disclosure – la procedura dove chi scopre un bug dà al produttore 90 giorni di tempo per risolvere le vulnerabilità di sicurezza, prima di renderle pubbliche – che evidenzia uno scambio con TP-Link a dir poco surreale. Lo ripropongo qui in basso (le date sono nel formato mese-giorno-anno):
07-02-2018 – Tenable sends vulnerability write up and proof of concepts to TP-Link.
07-18-2018 – Tenable asks TP-Link for acknowledgement.
07-18-2018 – TP-Link says all the bugs already fixed. Suggests Tenable verifies using the latest firmware.
07-27-2018 – Tenable confirms the vulnerabilities still exist in the latest build (0.9.1 4.16 v0348.0 Build 180119 Rel 66498n). Tenable asks if there is a more recent unpublished build.
07-27-2018 – TP-Link says they will check the firmware and let Tenable know.
08-27-2018 – Tenable asks for an update.
08-27-2018 – TP-Link asks for hardware version and firmware version.
08-27-2018 – Tenable responds TL-WR841N V13 0.9.1 4.16 v0348.0 Build 180119 Rel 66498n
08-27-2018 – TP-Link sends a beta firmware for Tenable to test.
08-27-2018 – TP-Link follows up that they hope for feedback ASAP.
08-27-2018 – Tenable can’t download the rar attachment via email.
08-27-2018 – TP-Link suggests using we-transfer.
08-27-2018 – Tenable agrees.
08-30-2018 – Tenable asks TP-Link for an update.
08-30-2018 – TP-Link says they sent a we-transfer. They’ll try again.
08-30-2018 – Tenable receive receipt of the firmware (0.9.1 4.16 v0348.0 Build 180821 Rel.42708n(Beta)) and confirms that two vulnerabilities still exist.
08-30-2018 – TP-Link notifies Tenable of another we-transfer.
08-30-2018 – Tenable informs TP-Link that they sent the exact same firmware as before.
09-20-2018 – Tenable asks TP-Link for an update.
09-20-2018 – TP-Link says they already sent the beta version.
09-20-2018 – Tenable says they haven’t received anything new.
09-20-2018 – TP-Link says we-transfer informed them that Tenable downloaded the firmware. Asks Tenable for an email address that doesn’t block rar files.
09-20-2018 – Tenable reiterates that the last downloaded version was vulnerable. Tenable asks for a new version via we-transfer.
10-01-2018 – Tenable reminds TP-Link that today is the 90 day disclosure day.