Actions

Firmware Security and Updates

From Whonix


Introduction[edit]

Info This chapter contains general security advice and is unspecific to Whonix ™.

Due to the difficulty of this topic and the specificity of hardware and host OS firmware, this issue is generally outside the scope of Whonix ™ documentation. The links provided further below may not be the most relevant to the end user, necessitating further individual research.

Firmware on Personal Computers[edit]

Firmware is generally defined as the type of software that provides control, monitoring and data manipulation of engineered products. [1] In the case of computers, firmware is held in non-volatile memory devices such as ROM [archive], EPROM [archive] or flash memory [archive] and is associated with: [2] [3] [4] [5]

Firmware Updating and Security Problems[edit]

Introduction[edit]

The major problem with updating firmware is that it cannot be done automatically in most cases. Therefore, it is difficult to fix functionality or security issues after the hardware has shipped. While utility programs are often available to update BIOS, firmware in other devices is rarely updated and mechanisms for detecting and updating firmware is not standardized. [2]

If firmware can be upgraded, this is usually possible via a program created by the provider. Old firmware should always be saved before upgrading. If the process fails or the newer version performs worse, the process can be reverted. [6] Updating firmware may or may not improve security. On the one hand it may fix vulnerabilities, but on the other hand an update may introduce a new backdoor.

Unfortunately most end users must blindly trust the hardware producer, so it probably better to install non-free updates rather than risk being vulnerable to known attacks in the wild. [7] Until these re-writable firmware areas are locked down or the code is open-sourced and vastly simplified, it is likely to remain a rich environment for malicious adversaries. [8] [9]

The reality is that advanced adversaries are routinely hacking the firmware of Internet routers, switches and firewalls [archive], along with harddrive firmware [archive], and UEFI/EFI and ethernet adapters [archive]. The number of targets is already in the tens of thousands on an annual basis. Subverting firmware in this manner provides a stealthy and persistent presence that can eavesdrop on or re-route all network data, or access information in invisible storage areas that are unecrypted (bypassing disk encryption). Worst of all, firmware sabotage is believed to survive software updates or complete OS re-installations. Attacks may also be designed to corrupt firmware so machines are prevented from booting, even with an external drive. [10]

Supply Chain Attacks[edit]

Compromising a computing company's infrastructure is an advanced attack methodology that has risen to prominence over the last ten years: [11]

Supply chain attacks can happen when hackers gain access to a software company's infrastructure—development environment, build servers, update servers, etc.—and are able to inject malware into new software releases or security updates.

A recent example of malware that successfully targeted computer firmware is the late-2018 "Operation ShadowHammer" attack, which affected an estimated half a million Windows users utilizing ASUS hardware. In this case, the ASUS Live Update Utility [archive] -- which is responsible for automatically updating components like BIOS, UEFI, drivers and applications -- was compromised.

It was discovered that the backdoored utility actually targeted the MAC addresses of a few hundred users, which were actually hard-coded into the trojan samples analyzed. The implication is that an advanced nation state attacker was willing to infect an untold number of innocent users for their targeted operations on a far smaller subset. [12] This sophisticated supply chain attack involved several steps: [13]

  • The ASUS server which served the live update tool was compromised.
  • The malicious file was signed with legitimate ASUS digital certificates so the software appeared genuine. [14] The file was actually a three-year old binary containing harmful code.
  • Users downloaded the malicious, backdoored utility through the ASUS update server.
  • The trojan utility searched for targets using a set of unique MAC addresses. [15]
  • Once located, a command-and-control server under the attacker's control installed additional malware on the machine.

This attack is concerning because it reveals adversaries are prepared to undermine the security underpinning the entire supply chain for their purposes, whether it is manufactured/assembled components or via breaches of trusted vendor software channels. As most users of specific computer hardware trust the manufacturing company, this is a very difficult problem to address, particularly since it can remain undiscovered for a long period.

In addition, this mode of attack suggests that overall improvements in computing security are forcing sophisticated attackers to "raise their game," because in general they choose the path of least resistance when attempting to infiltrate the systems of targets. [11]

For further reading on this topic, see:

Processor Microcode Updates[edit]

One recent example of a firmware vulnerability is the processor microcode update for modern chips to address speculative [archive] execution flaws [archive]. The Debian package [archive] is non-free software, therefore only available in the Debian nonfree repository, meaning it is not installed by default in all Whonix variants. [16] [17] Whonix recommends to avoid nonfree software but in this case idealism would result in insecurity.

It is unnecessary to apply these updates in standard Non-Qubes-Whonix ™ and Qubes-Whonix ™ guest VMs, as they do not have the ability to alter the microcode. However, processor microcode updates should always be applied on the host operating system (for processors by Intel or AMD) [18] and baremetal configurations like Physical Isolation. [19]

Microcode Package Check[edit]

In the following checks, the package is not installed if there is no output.

To check whether the microcode package is installed.

Debian based[edit]

On the host. Run.

dpkg -l | grep microcode

Qubes[edit]

In dom0. Run.

dnf list | grep microcode

The Qubes check should confirm the microcode_ctl.x86_64 package is already installed. [20]

Install Microcode Package[edit]

Intel[edit]

For Debian hosts

Package intel-microcode [archive] can be installed from Debian backports. This is non-ideal, see footnote. [21]

Note: the following instructions apply only to the Debian buster host operating system using Whonix 15.0.0.4.9. Other host operating systems and other Whonix versions may use a codename different to buster.

1. Open a terminal on the host.

2. Add the current Debian stable backports codename buster-backports to Debian apt sources. [22]

sudo su -c "echo -e 'deb http://http.debian.net/debian buster-backports main contrib non-free' > /etc/apt/sources.list.d/backports.list"

3. Update the package lists.

sudo apt-get update

4. Install the selected software.

sudo apt-get -t buster-backports install intel-microcode

The procedure is now complete.

5. Undo.

On occasion it is necessary to undo this configuration, for example when upgrading from Debian buster to bullseye. [23] To proceed, run.

sudo rm /etc/apt/sources.list.d/backports.list

AMD[edit]

For Debian hosts

Package amd64-microcode [archive] can be installed from Debian backports. This is non-ideal, see footnote. [21]

Note: the following instructions apply only to the Debian buster host operating system using Whonix 15.0.0.4.9. Other host operating systems and other Whonix versions may use a codename different to buster.

1. Open a terminal on the host.

2. Add the current Debian stable backports codename buster-backports to Debian apt sources. [24]

sudo su -c "echo -e 'deb http://http.debian.net/debian buster-backports main contrib non-free' > /etc/apt/sources.list.d/backports.list"

3. Update the package lists.

sudo apt-get update

4. Install the selected software.

sudo apt-get -t buster-backports install amd64-microcode

The procedure is now complete.

5. Undo.

On occasion it is necessary to undo this configuration, for example when upgrading from Debian buster to bullseye. [25] To proceed, run.

sudo rm /etc/apt/sources.list.d/backports.list

spectre-meltdown-checker[edit]

It is possible to check if the system is vulnerable to the Spectre [archive] and Meltdown [archive] attacks, which use flaws in modern chip design to bypass system protections.

Installation[edit]

Package spectre-meltdown-checker [archive] can be installed from Debian backports. This is non-ideal, see footnote. [26]

1. Boot Whonix-Workstation ™ (whonix-ws-15) TemplateVM.

2. Add the current Debian stable backports codename buster-backports to Debian apt sources.

Note: this applies to Whonix 15.0.0.4.9. Later Whonix versions may use a codename different to buster.

In Whonix-Workstation ™ (whonix-ws-15) TemplateVM, run.

sudo su -c "echo -e 'deb https://deb.debian.org/debian buster-backports main contrib non-free' > /etc/apt/sources.list.d/backports.list"

Alternatively, users who like Onionizing Repositories can set the .onion mirror.

sudo su -c "echo -e 'deb tor+http://vwakviie2ienjx6t.onion/debian buster-backports main contrib non-free' > /etc/apt/sources.list.d/backports.list"

3. Update the package lists.

sudo apt-get update

4. Install the select software.

sudo apt-get -t buster-backports install spectre-meltdown-checker

The procedure is now complete.

5. Undo.

On occasion it is necessary to undo this configuration, for example when upgrading from Debian buster to bullseye. [27] To proceed, run.

sudo rm /etc/apt/sources.list.d/backports.list

Usage[edit]

sudo spectre-meltdown-checker --paranoid ; echo $?

Forum Discussion[edit]

See: https://forums.whonix.org/t/whonix-vulerable-due-to-missing-processor-microcode-packages/5739 [archive]

References[edit]

  1. https://en.wikipedia.org/wiki/Firmware [archive]
  2. 2.0 2.1 https://en.wikipedia.org/wiki/Firmware#Personal_computers [archive]
  3. https://en.wikipedia.org/wiki/Firmware#Examples [archive]
  4. http://www.darkreading.com/partner-perspectives/intel/raising-the-stakes-when-software-attacks-hardware/a/d-id/1319423 [archive]
  5. https://www.fsf.org/campaigns/priority-projects/hardware-firmware-drivers [archive]
  6. https://en.wikipedia.org/wiki/Firmware#Flashing [archive]
  7. Also see this debian-security mailing list thread: How secure is an installation with no non-free packages? [archive]
  8. http://www.darkreading.com/partner-perspectives/intel/raising-the-stakes-when-software-attacks-hardware/a/d-id/1319423 [archive]
  9. Mark Shuttleworth, founder of the Ubuntu Linux distribution, has described proprietary firmware as a security risk [archive], stating "firmware on your device is the NSA's best friend" and calling firmware "a trojan horse of monumental proportions".
  10. http://www.darkreading.com/partner-perspectives/intel/raising-the-stakes-when-software-attacks-hardware/a/d-id/1319423 [archive]
  11. 11.0 11.1 https://motherboard.vice.com/en_us/article/d3y48v/what-is-a-supply-chain-attack [archive]
  12. https://securelist.com/operation-shadowhammer/89992/ [archive]
  13. https://motherboard.vice.com/en_us/article/pan9wn/hackers-hijacked-asus-software-updates-to-install-backdoors-on-thousands-of-computers [archive]
  14. Reinforcing the notion that digital certificates are an imperfect security mechanism.
  15. MD5 hash values were hard-coded and found to correspond to unique MAC addresses for network adapter cards. This indicates the attackers knew the MAC addresses of their targets in advance.
  16. Relevant Debian packages for processor microcode: Intel [archive] and amd64 [archive].
  17. Installing these updates by default would require the Debian nonfree repository, and logically also make Whonix images nonfree.
  18. ARM is less affected than Intel architecture.
  19. See: https://forums.whonix.org/t/whonix-vulerable-due-to-missing-processor-microcode-packages/5739 [archive]
  20. This package is installed by default in Qubes to automatically protect users against hardware threats.
  21. 21.0 21.1 Users should Prefer Packages from Debian Stable Repository, but using backports is better than manual software installation or using third party package managers since this prefers APT. To contain the risk, Non-Qubes-Whonix ™ users might want to consider using Multiple Whonix-Workstation ™ and Qubes-Whonix ™ users might want to consider using Multiple Qubes-Whonix ™ TemplateVMs or Software Installation in a TemplateBasedVM.
  22. Or alternatively use the .onion mirror.
    sudo su -c "echo -e 'deb tor+http://vwakviie2ienjx6t.onion/debian buster-backports main contrib non-free' > /etc/apt/sources.list.d/backports.list"
  23. Most often this step applies before attempting major Whonix upgrades; upgrade instructions are also made available at that time (see Stay Tuned).
  24. Or alternatively use the .onion mirror.
    sudo su -c "echo -e 'deb tor+http://vwakviie2ienjx6t.onion/debian buster-backports main contrib non-free' > /etc/apt/sources.list.d/backports.list"
  25. Most often this step applies before attempting major Whonix upgrades; upgrade instructions are also made available at that time (see Stay Tuned).
  26. Users should Prefer Packages from Debian Stable Repository, but using backports is better than manual software installation or using third party package managers since this prefers APT. To contain the risk, Non-Qubes-Whonix ™ users might want to consider using Multiple Whonix-Workstation ™ and Qubes-Whonix ™ users might want to consider using Multiple Qubes-Whonix ™ TemplateVMs or Software Installation in a TemplateBasedVM.
  27. Most often this step applies before attempting major Whonix upgrades; upgrade instructions are also made available at that time (see Stay Tuned).


Join us in testing our new AppArmor profiles [archive] for improved security! (forum discussion [archive])

https [archive] | (forcing) onion [archive]
Follow: Twitter.png Facebook.png 1280px-Gab text logo.svg.png Rss.png 1024px-Telegram 2019 Logo.svg.png Discourse logo.svg

Donate: Donate Bank Wire Paypal Bitcoin accepted here Monero accepted here Contriute

Whonix donate bitcoin.png

Share: Twitter | Facebook

This is a wiki. Want to improve this page? Help is welcome and volunteer contributions are happily considered! Read, understand and agree to Conditions for Contributions to Whonix ™, then Edit! Edits are held for moderation.

Copyright (C) 2012 - 2019 ENCRYPTED SUPPORT LP. Whonix ™ is a trademark. Whonix ™ is a licensee [archive] of the Open Invention Network [archive]. Unless otherwise noted, the content of this page is copyrighted and licensed under the same Freedom Software license as Whonix ™ itself. (Why?)

Whonix ™ is a derivative of and not affiliated with Debian [archive]. Debian is a registered trademark [archive] owned by Software in the Public Interest, Inc [archive].

Whonix ™ is produced independently from the Tor® [archive] anonymity software and carries no guarantee from The Tor Project [archive] about quality, suitability or anything else.

By using our website, you acknowledge that you have read, understood and agreed to our Privacy Policy, Cookie Policy, Terms of Service, and E-Sign Consent. Whonix ™ is provided by ENCRYPTED SUPPORT LP. See Imprint.

Monero donate whonix.png