CPU Side-Channel Vulnerabilities

Il 3 gennaio 2018 sono state rivelate tre vulnerabilità che possono sfruttare l’esecuzione speculativa delle istruzioni implementata molti moderni processori per eseguire attacchi di tipo side-channel. Gli attacchi side-channel sfruttano appunto caratteristiche implementative di componenti hardware e software per ottenere informazioni di norma non accessibili, ad esempio possono utilizzare i tempi di esecuzione di un algoritmo crittografico per forzarne i segreti, misurare il consumo energetico o le emissioni elettromagnetiche per estrarne informazioni, sfruttare l’architettura di un processore e l’implementazione delle richieste tra la memoria e la CPU per ottenere accesso arbitrario ai dati in memoria.

Come è stato annunciato il 4 gennaio 2018 dal CERT Nazionale Italia nella news Moderni processori vulnerabili ad attacchi Side-Channel e dal US-CERT nella news Meltdown and Spectre Side-Channel Vulnerabilities e nell’Alert (TA18-004A) Meltdown and Spectre Side-Channel Vulnerability Guidance ricercatori di realtà private e accademiche come United Kingdom National Cyber Security Centre, Project Zero di Google, Institute of Applied Information Processing and Communications (IAIK) della Graz University of Technology (TU Graz) hanno scoperto che è possibile sfruttare il timing della cache dei dati della CPU nelle operazioni legate alla tecnica di ottimizzazione delle prestazioni speculative execution per ottenere informazioni che possono consentire ad un attaccante con bassi privilegi di accedere in lettura alla memoria protetta del kernel aggirando la protezione di sicurezza KASLR (Kernel Adress Space Layout Randomization).

Tramite la speculative execution le CPU possono scegliere di eseguire le istruzioni in modo speculativo, ovvero sulla base di ipotesi considerate verosimili. Durante l’esecuzione speculativa il processore verifica queste ipotesi e se sono valide l’esecuzione continua. Nel caso in cui le ipotesi non siano valide l’esecuzione viene bloccata e può essere avviato il corretto percorso di esecuzione in base alle condizioni effettive. In estrema sintesi l’origine delle vulnerabilità dipende dal fatto l’esecuzione speculativa generi effetti collaterali che non vengono ripristinati quando la CPU fa ipotesi errate e ciò può portare alla divulgazione di informazioni.

Scendendo nel dettaglio sono state identificate due possibili tipologie attacco di tipo side-channel:

Le vulnerabilità affliggono i moderni processori da circa 20 anni e quindi risultano coinvolti i processori Intel, AMD e ARM che a loro volta sono presenti in Computer Server, Desktop, Portatili e dispositivi mobili.

Dal momento che le vulnerabilità sono legate all’implementazione dell’architettura delle CPU possono essere rimosse completamente solamente sostituendo l’hardware, quindi è possibile solo mitigarle tramite aggiornamenti software specifici per i sistemi operativi. Questo significa che le patch di sicurezza in alcuni casi ridurranno le performance dei processori, nell’Alert (TA18-004A) Meltdown and Spectre Side-Channel Vulnerability Guidance viene riportato che potrebbero esserci riduzioni di performance sino al 30% che però dipenderà dalla generazione dell’hardware e dall’implementazione del chip:

“After patching, performance may be diminished by up to 30 percent. Administrators should ensure that performance is monitored for critical applications and services, and work with their vendor(s) and service provider(s) to mitigate the effect if possible.”

Ovviamente tutti i produttori di sistemi operativi necessitano di patch di sicurezza per mitigare le vulnerabilità quindi occorrerà verificare i rilasci degli aggiornamenti di sicurezza per Windows, Android, Chrome, iOS, MacOS, le varie distro Linux e ogni altro OS. Anche se al momento non si ha notizia che tali vulnerabilità sia state sfruttate vista l’impatto che possono avere sui sistemi in termini di sicurezza è raccomandabile installare rapidamente gli aggiornamenti rilasciati dai vendor software e hardware.

La problematica può avere impatto anche sulle infrastrutture di virtualizzazione alla base dei servizi Cloud a riguardo si vedano le seguenti comuncazioni dei principali vendor di servizi cloud (in ordine alfabetico):

  • Amazon: Processor Speculative Execution Research Disclosure in cui viene riportato:
    “All instances across the Amazon EC2 fleet are protected from all known threat vectors from the CVEs previously listed. Customers’ instances are protected against these threats from other instances. We have not observed meaningful performance impact for the overwhelming majority of EC2 workloads.
    While all customer instances are protected, we recommend that customers patch their instance operating systems. This will strengthen the protections that these operating systems provide to isolate software running within the same instance. For more details, refer to specific vendor guidance on patch availability and deployment.”
  • Google: What Google Cloud, G Suite and Chrome customers need to know about the industry-wide CPU vulnerability in cui viene riportato:
    “Google engineering teams have been working to protect our customers from the vulnerability across the entire suite of Google products, including Google Cloud Platform (GCP), G Suite applications, and the Google Chrome and Chrome OS products. We also collaborated with hardware and software manufacturers across the industry to help protect their users and the broader web. All G Suite applications have already been updated to prevent all known attack vectors. G Suite customers and users do not need to take any action to be protected from the vulnerability.”
  • Microsoft Azure: Securing Azure customers from CPU vulnerability in cui viene riportato:
    “The majority of Azure infrastructure has already been updated to address this vulnerability. Some aspects of Azure are still being updated and require a reboot of customer VMs for the security update to take effect. Many of you have received notification in recent weeks of a planned maintenance on Azure and have already rebooted your VMs to apply the fix, and no further action by you is required.”
    “The majority of Azure customers should not see a noticeable performance impact with this update. We’ve worked to optimize the CPU and disk I/O path and are not seeing noticeable performance impact after the fix has been applied. A small set of customers may experience some networking performance impact. This can be addressed by turning on Azure Accelerated Networking (Windows, Linux), which is a free capability available to all Azure customers.”
    .A riguardo si veda anche la KB4073235 Microsoft Cloud Protections Against Speculative Execution Side-Channel Vulnerabilities.

In sintesi i principali vendor di servizi cloud hanno già mitigato le vulnerabilità e a i client di servizi Cloud dovrebbero riavviare le VM, come indicato anche nell’Alert (TA18-004A) Meltdown and Spectre Side-Channel Vulnerability Guidance:

“Additionally, impacts to availability in some cloud service providers (CSPs) have been reported as a result of patches to host OSes. Users and administrators who rely on cloud infrastructure should work with their CSP to mitigate and resolve any impacts resulting from host OS patching and mandatory rebooting.”

Inoltre le vulnerabilità possono coinvolgere anche apparati di rete, si veda ad esempio la comunicazione di Cisco CPU Side-Channel Information Disclosure Vulnerabilities in cui viene riportato:
“Cisco is investigating its product line to determine which products may be affected by these vulnerabilities. As the investigation progresses, Cisco will update this advisory with information about affected products, including the Cisco Bug ID for each affected product.”

Per quanto riguarda i sistemi operativi Microsoft, come riportato nel Security Advisory ADV180002 | Guidance to mitigate speculative execution side-channel vulnerabilities, gli aggiornamenti per mitigare le vulnerabilità in oggetto sono state distribuite tramite gli aggiornamenti automatici il 3 gennaio 2018 ai sistemi che eseguivano software Antivirus compatibili, tali aggiornamenti sono purtroppo risultati incompatibili con taluni antivirus e tali incompatibilità dovranno essere risolte dai produttori di tali Antivirus con cui Microsoft sta collaborando, a riguardo si vela la KB4072699 Important information regarding the Windows security updates released on January 3, 2018 and anti-virus software.

Microsoft raccomanda oltre all’installazione dei January 2018 Windows security updates, anche di installare anche eventuali aggiornamenti firmware rilasciati dai produttori di hardware OEM, in particolare tale raccomandazione vale per gli utilizzatori di Microsoft Surface e Surface Book.

Riguardo agli impatti sulle performance Microsoft riporta che non dovrebbero notarsi cali di prestazioni:

“In testing Microsoft has seen some performance impact with these mitigations. For most consumer devices, the impact may not be noticeable, however, the specific impact varies by hardware generation and implementation by the chip manufacturer. Microsoft values the security of its software and services and has made the decision to implement certain mitigation strategies in an effort to better secure our products. We continue to work with hardware vendors to improve performance while maintaining a high level of security.”

Per maggiori dettagli su tali vulnerabilità Microsoft ha pubblicato la KB4073119 Windows Client Guidance for IT Pros to protect against speculative execution side-channel vulnerabilities per gli OS Client, la KB4072698 Windows Server guidance to protect against speculative execution side-channel vulnerabilities per gli OS Server e la KB4073225 Guide to protect SQL Server against speculative execution side-channel vulnerabilities per SQL Server in cui vengono fornite varie informazioni e viene indicato come verificare tramite PowerShell se le mitigazioni sono state abilitate.

Si veda anche il post CPU vulnerability & speculative execution side-channel attacks: impatto sui sistemi operativi Microsoft e sull’infrastruttura Azure pubblicato da Renato F. Giorgini sul blog Italy@TechNet

Per gli avvisi e le patch rilasciate da altri vendor hardware e software è possibile fare riferimento all’Alert (TA18-004A) Meltdown and Spectre Side-Channel Vulnerability Guidance in cui al momento sono stati raccolti i link delle comunicazioni rilasciate dai seguenti vendor:

  • Amazon
  • AMD
  • Android
  • Apple
  • ARM
  • CentOS
  • Chromium
  • Citrix
  • F5
  • Google
  • Huawei
  • IBM
  • Intel
  • Lenovo
  • Linux
  • Microsoft Azure
  • Microsoft
  • Mozilla
  • NVIDIA
  • OpenSuSE
  • Red Hat
  • SuSE
  • Trend Micro
  • VMware
  • Xen

In particolare le informazioni fornite dai vendor di processori si vedano:

Per ulteriori dettagli tecnici sulle vulnerabilità si vedano:

[Update 01]

Microsoft ha riportato che i January 2018 Windows security updates possono dare problemi sui computer con processori AMD causando un blocco al riavvio indipendentemente dal sistema operativo installato Windows 7, Windows 8/8.1 o Windows 10. Per il momento Microsoft ha bloccato la distribuzione di tale aggiornamento tramite gli aggiornamenti automatici e WSUS:

“Microsoft has reports of some customers with AMD devices getting into an unbootable state after installing this KB.  To prevent this issue, Microsoft will temporarily pause Windows OS updates to devices with impacted AMD processors at this time.”

Nel caso ci trovi nella situazione di un computer bloccato è possibile risolvere il problema eseguendo il restore del punto di ripristino creato prima dell’aggiornamento come indicato nella KB4073707 Windows operating system security update block for some AMD based devices.