# Flashing Malicious Firmware

A flash attack is a type of attack that targets the firmware of a crypto hardware wallet. In this attack, the attacker replaces the legitimate firmware of the device with a malicious version, which can allow them to gain access to the user's private keys and other sensitive information.

The attack typically works by exploiting vulnerabilities in the device's firmware update process. The attacker may use social engineering or other tactics to trick the user into installing a fake firmware update, or they may intercept the firmware update process and replace the legitimate firmware with their own version. Once the malicious firmware is installed on the device, the attacker can then use it to extract the user's private keys or perform other malicious actions.

There are multiple safeguards Cypherock has taken to mitigate the risks of the Evil Maid Attack:&#x20;

1. X1 Vault comes with an immutable bootloader code, which is responsible for keeping track of the history of firmware versions installed on the device. Therefore, it stores information regarding the latest firmware version installed on the device. The firmware version history is protected against any factory resets that users may perform during their usage. During each firmware upgrade, the bootloader compares the firmware version of the new firmware against the last installed version. If the new version is lower than the last installed version, then the firmware update is aborted. The firmware version of the incoming firmware is checked only if the signature of the firmware header is verified.
2. The bootloader of the X1 Vault does not allow flashing unsigned firmware onto the hardware. The firmware upgrade package consists of three parts, a signed header, two signatures of the firmware binary, and the firmware binary. The firmware upgrade is incomplete until the signatures are verified with either two of the bootloader's four public keys. If any signature is unverified, the programmed binary is wiped from the flash, and the upgrade is aborted.
3. Cypherock uses a provisioning mechanism that ensures the integrity of the wallet. The provisioning process ensures that the X1 Vault and X1 Cards are authentic and untampered. To learn more about the provisioning process, read more about how to ensure that your [Cypherock X1 is authentic](/getting-started/how-do-i-know-my-cypherock-x1-is-genuine.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cypherock.com/security-overview/physical-attacks/flashing-malicious-firmware.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
