Gary Morrison | d4d951a | 2021-11-10 14:40:15 -0600 | [diff] [blame] | 1 | Generic Threat Model |
Olivier Deprez | 86d1ffd | 2021-06-01 15:37:16 +0200 | [diff] [blame] | 2 | ******************** |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 3 | |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 4 | ************ |
Olivier Deprez | 86d1ffd | 2021-06-01 15:37:16 +0200 | [diff] [blame] | 5 | Introduction |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 6 | ************ |
| 7 | |
Olivier Deprez | 86d1ffd | 2021-06-01 15:37:16 +0200 | [diff] [blame] | 8 | This document provides a generic threat model for TF-A firmware. |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 9 | |
Sandrine Bailleux | 522185b | 2023-08-21 14:28:54 +0200 | [diff] [blame] | 10 | .. _Target of Evaluation: |
| 11 | |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 12 | ******************** |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 13 | Target of Evaluation |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 14 | ******************** |
| 15 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 16 | In this threat model, the target of evaluation is the Trusted |
| 17 | Firmware for A-class Processors (TF-A). This includes the boot ROM (BL1), |
| 18 | the trusted boot firmware (BL2) and the runtime EL3 firmware (BL31) as |
| 19 | shown on Figure 1. Everything else on Figure 1 is outside of the scope of |
| 20 | the evaluation. |
| 21 | |
| 22 | TF-A can be configured in various ways. In this threat model we consider |
| 23 | only the most basic configuration. To that end we make the following |
| 24 | assumptions: |
| 25 | |
| 26 | - All TF-A images are run from either ROM or on-chip trusted SRAM. This means |
| 27 | TF-A is not vulnerable to an attacker that can probe or tamper with off-chip |
| 28 | memory. |
Zelalem Aweke | 023b1a4 | 2021-10-21 13:59:45 -0500 | [diff] [blame] | 29 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 30 | - Trusted boot is enabled. This means an attacker can't boot arbitrary images |
| 31 | that are not approved by platform providers. |
Zelalem Aweke | 023b1a4 | 2021-10-21 13:59:45 -0500 | [diff] [blame] | 32 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 33 | - There is no Secure-EL2. We don't consider threats that may come with |
| 34 | Secure-EL2 software. |
| 35 | |
Sandrine Bailleux | e26ef3c | 2023-08-21 11:04:03 +0200 | [diff] [blame] | 36 | - There are no Root and Realm worlds. These are introduced by :ref:`Realm |
| 37 | Management Extension (RME)`. |
| 38 | |
Sandrine Bailleux | 545f4b6 | 2023-09-06 16:11:12 +0200 | [diff] [blame] | 39 | The :ref:`Threat Model for TF-A with Arm CCA support` covers these types of |
| 40 | configurations. |
| 41 | |
Sandrine Bailleux | 78cdfdd | 2022-05-12 14:57:26 +0200 | [diff] [blame] | 42 | - No experimental features are enabled. We do not consider threats that may come |
| 43 | from them. |
| 44 | |
Manish V Badarkhe | 985af7e | 2023-12-21 17:54:30 +0000 | [diff] [blame] | 45 | - The platform's hardware complies with the `PSR specification`_, defining the |
| 46 | bare-minimum security prerequisites for System-on-Chips (SoC). |
Manish V Badarkhe | 9d97122 | 2023-04-03 13:50:59 +0100 | [diff] [blame] | 47 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 48 | Data Flow Diagram |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 49 | ================= |
| 50 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 51 | Figure 1 shows a high-level data flow diagram for TF-A. The diagram |
| 52 | shows a model of the different components of a TF-A-based system and |
| 53 | their interactions with TF-A. A description of each diagram element |
| 54 | is given on Table 1. On the diagram, the red broken lines indicate |
| 55 | trust boundaries. Components outside of the broken lines |
| 56 | are considered untrusted by TF-A. |
| 57 | |
laurenw-arm | 5421208 | 2023-12-08 15:00:07 -0600 | [diff] [blame] | 58 | .. uml:: ../../resources/diagrams/plantuml/tfa_dfd.puml |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 59 | :caption: Figure 1: TF-A Data Flow Diagram |
| 60 | |
| 61 | .. table:: Table 1: TF-A Data Flow Diagram Description |
| 62 | |
| 63 | +-----------------+--------------------------------------------------------+ |
| 64 | | Diagram Element | Description | |
| 65 | +=================+========================================================+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 66 | | DF1 | | At boot time, images are loaded from non-volatile | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 67 | | | memory and verified by TF-A boot firmware. These | |
| 68 | | | images include TF-A BL2 and BL31 images, as well as | |
| 69 | | | other secure and non-secure images. | |
| 70 | +-----------------+--------------------------------------------------------+ |
Sandrine Bailleux | a384672 | 2023-10-11 08:27:43 +0200 | [diff] [blame] | 71 | | DF2 | | TF-A log system framework outputs debug or | |
| 72 | | | informative messages over a UART interface. | |
| 73 | | | | |
| 74 | | | | Also, characters can be read from a UART interface. | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 75 | +-----------------+--------------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 76 | | DF3 | | Debug and trace IP on a platform can allow access | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 77 | | | to registers and memory of TF-A. | |
| 78 | +-----------------+--------------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 79 | | DF4 | | Secure world software (e.g. trusted OS) interact | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 80 | | | with TF-A through SMC call interface and/or shared | |
| 81 | | | memory. | |
| 82 | +-----------------+--------------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 83 | | DF5 | | Non-secure world software (e.g. rich OS) interact | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 84 | | | with TF-A through SMC call interface and/or shared | |
| 85 | | | memory. | |
| 86 | +-----------------+--------------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 87 | | DF6 | | This path represents the interaction between TF-A and| |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 88 | | | various hardware IPs such as TrustZone controller | |
| 89 | | | and GIC. At boot time TF-A configures/initializes the| |
| 90 | | | IPs and interacts with them at runtime through | |
| 91 | | | interrupts and registers. | |
| 92 | +-----------------+--------------------------------------------------------+ |
| 93 | |
| 94 | |
Thaddeus Serna | 8709cc9 | 2023-08-14 13:28:59 -0500 | [diff] [blame] | 95 | .. _threat_analysis: |
| 96 | |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 97 | *************** |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 98 | Threat Analysis |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 99 | *************** |
| 100 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 101 | In this section we identify and provide assessment of potential threats to TF-A |
| 102 | firmware. The threats are identified for each diagram element on the |
| 103 | data flow diagram above. |
| 104 | |
| 105 | For each threat, we identify the *asset* that is under threat, the |
| 106 | *threat agent* and the *threat type*. Each threat is given a *risk rating* |
| 107 | that represents the impact and likelihood of that threat. We also discuss |
| 108 | potential mitigations. |
| 109 | |
| 110 | Assets |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 111 | ====== |
| 112 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 113 | We have identified the following assets for TF-A: |
| 114 | |
| 115 | .. table:: Table 2: TF-A Assets |
| 116 | |
| 117 | +--------------------+---------------------------------------------------+ |
| 118 | | Asset | Description | |
| 119 | +====================+===================================================+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 120 | | Sensitive Data | | These include sensitive data that an attacker | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 121 | | | must not be able to tamper with (e.g. the Root | |
| 122 | | | of Trust Public Key) or see (e.g. secure logs, | |
| 123 | | | debugging information such as crash reports). | |
| 124 | +--------------------+---------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 125 | | Code Execution | | This represents the requirement that the | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 126 | | | platform should run only TF-A code approved by | |
| 127 | | | the platform provider. | |
| 128 | +--------------------+---------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 129 | | Availability | | This represents the requirement that TF-A | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 130 | | | services should always be available for use. | |
| 131 | +--------------------+---------------------------------------------------+ |
| 132 | |
| 133 | Threat Agents |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 134 | ============= |
| 135 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 136 | To understand the attack surface, it is important to identify potential |
| 137 | attackers, i.e. attack entry points. The following threat agents are |
| 138 | in scope of this threat model. |
| 139 | |
| 140 | .. table:: Table 3: Threat Agents |
| 141 | |
| 142 | +-------------------+-------------------------------------------------------+ |
| 143 | | Threat Agent | Description | |
| 144 | +===================+=======================================================+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 145 | | NSCode | | Malicious or faulty code running in the Non-secure | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 146 | | | world, including NS-EL0 NS-EL1 and NS-EL2 levels | |
| 147 | +-------------------+-------------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 148 | | SecCode | | Malicious or faulty code running in the secure | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 149 | | | world, including S-EL0 and S-EL1 levels | |
| 150 | +-------------------+-------------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 151 | | AppDebug | | Physical attacker using debug signals to access | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 152 | | | TF-A resources | |
| 153 | +-------------------+-------------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 154 | | PhysicalAccess | | Physical attacker having access to external device | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 155 | | | communication bus and to external flash | |
| 156 | | | communication bus using common hardware | |
| 157 | +-------------------+-------------------------------------------------------+ |
| 158 | |
| 159 | .. note:: |
| 160 | |
| 161 | In this threat model an advanced physical attacker that has the capability |
| 162 | to tamper with a hardware (e.g. "rewiring" a chip using a focused |
| 163 | ion beam (FIB) workstation or decapsulate the chip using chemicals) is |
| 164 | considered out-of-scope. |
| 165 | |
Manish V Badarkhe | 370f3d1 | 2024-02-12 11:56:56 +0000 | [diff] [blame] | 166 | Certain non-invasive physical attacks that do not need modifications to the |
| 167 | chip, notably those like Power Analysis Attacks, are out-of-scope. Power |
| 168 | analysis side-channel attacks represent a category of security threats that |
| 169 | capitalize on information leakage through a device's power consumption during |
| 170 | its normal operation. These attacks leverage the correlation between a |
| 171 | device's power usage and its internal data processing activities. This |
| 172 | correlation provides attackers with the means to extract sensitive |
| 173 | information, including cryptographic keys. |
| 174 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 175 | Threat Types |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 176 | ============ |
| 177 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 178 | In this threat model we categorize threats using the `STRIDE threat |
| 179 | analysis technique`_. In this technique a threat is categorized as one |
| 180 | or more of these types: ``Spoofing``, ``Tampering``, ``Repudiation``, |
| 181 | ``Information disclosure``, ``Denial of service`` or |
| 182 | ``Elevation of privilege``. |
| 183 | |
| 184 | Threat Risk Ratings |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 185 | =================== |
| 186 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 187 | For each threat identified, a risk rating that ranges |
| 188 | from *informational* to *critical* is given based on the likelihood of the |
Tamas Ban | cf151b7 | 2022-11-30 17:06:05 +0100 | [diff] [blame] | 189 | threat occurring if a mitigation is not in place, and the impact of the |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 190 | threat (i.e. how severe the consequences could be). Table 4 explains each |
| 191 | rating in terms of score, impact and likelihood. |
| 192 | |
| 193 | .. table:: Table 4: Rating and score as applied to impact and likelihood |
| 194 | |
| 195 | +-----------------------+-------------------------+---------------------------+ |
| 196 | | **Rating (Score)** | **Impact** | **Likelihood** | |
| 197 | +=======================+=========================+===========================+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 198 | | Critical (5) | | Extreme impact to | | Threat is almost | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 199 | | | entire organization | certain to be exploited.| |
| 200 | | | if exploited. | | |
| 201 | | | | | Knowledge of the threat | |
| 202 | | | | and how to exploit it | |
| 203 | | | | are in the public | |
| 204 | | | | domain. | |
| 205 | +-----------------------+-------------------------+---------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 206 | | High (4) | | Major impact to entire| | Threat is relatively | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 207 | | | organization or single| easy to detect and | |
| 208 | | | line of business if | exploit by an attacker | |
| 209 | | | exploited | with little skill. | |
| 210 | +-----------------------+-------------------------+---------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 211 | | Medium (3) | | Noticeable impact to | | A knowledgeable insider | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 212 | | | line of business if | or expert attacker could| |
| 213 | | | exploited. | exploit the threat | |
| 214 | | | | without much difficulty.| |
| 215 | +-----------------------+-------------------------+---------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 216 | | Low (2) | | Minor damage if | | Exploiting the threat | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 217 | | | exploited or could | would require | |
| 218 | | | be used in conjunction| considerable expertise | |
| 219 | | | with other | and resources | |
| 220 | | | vulnerabilities to | | |
| 221 | | | perform a more serious| | |
| 222 | | | attack | | |
| 223 | +-----------------------+-------------------------+---------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 224 | | Informational (1) | | Poor programming | | Threat is not likely | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 225 | | | practice or poor | to be exploited on its | |
| 226 | | | design decision that | own, but may be used to | |
| 227 | | | may not represent an | gain information for | |
| 228 | | | immediate risk on its | launching another | |
| 229 | | | own, but may have | attack | |
| 230 | | | security implications | | |
| 231 | | | if multiplied and/or | | |
| 232 | | | combined with other | | |
| 233 | | | threats. | | |
| 234 | +-----------------------+-------------------------+---------------------------+ |
| 235 | |
| 236 | Aggregate risk scores are assigned to identified threats; |
| 237 | specifically, the impact score multiplied by the likelihood score. |
| 238 | For example, a threat with high likelihood and low impact would have an |
| 239 | aggregate risk score of eight (8); that is, four (4) for high likelihood |
| 240 | multiplied by two (2) for low impact. The aggregate risk score determines |
| 241 | the finding's overall risk level, as shown in the following table. |
| 242 | |
| 243 | .. table:: Table 5: Overall risk levels and corresponding aggregate scores |
| 244 | |
| 245 | +---------------------+-----------------------------------+ |
| 246 | | Overall Risk Level | Aggregate Risk Score | |
| 247 | | | (Impact multiplied by Likelihood) | |
| 248 | +=====================+===================================+ |
| 249 | | Critical | 20–25 | |
| 250 | +---------------------+-----------------------------------+ |
| 251 | | High | 12–19 | |
| 252 | +---------------------+-----------------------------------+ |
| 253 | | Medium | 6–11 | |
| 254 | +---------------------+-----------------------------------+ |
| 255 | | Low | 2–5 | |
| 256 | +---------------------+-----------------------------------+ |
| 257 | | Informational | 1 | |
| 258 | +---------------------+-----------------------------------+ |
| 259 | |
| 260 | The likelihood and impact of a threat depends on the |
| 261 | target environment in which TF-A is running. For example, attacks |
| 262 | that require physical access are unlikely in server environments while |
| 263 | they are more common in Internet of Things(IoT) environments. |
| 264 | In this threat model we consider three target environments: |
| 265 | ``Internet of Things(IoT)``, ``Mobile`` and ``Server``. |
| 266 | |
| 267 | Threat Assessment |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 268 | ================= |
| 269 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 270 | The following threats were identified by applying STRIDE analysis on |
| 271 | each diagram element of the data flow diagram. |
| 272 | |
Sandrine Bailleux | 94e7009 | 2022-05-13 12:39:56 +0200 | [diff] [blame] | 273 | For each threat, we strive to indicate whether the mitigations are currently |
| 274 | implemented or not. However, the answer to this question is not always straight |
| 275 | forward. Some mitigations are partially implemented in the generic code but also |
| 276 | rely on the platform code to implement some bits of it. This threat model aims |
| 277 | to be platform-independent and it is important to keep in mind that such threats |
| 278 | only get mitigated if the platform code properly fulfills its responsibilities. |
| 279 | |
| 280 | Also, some mitigations require enabling specific features, which must be |
| 281 | explicitly turned on via a build flag. |
| 282 | |
Sandrine Bailleux | 522185b | 2023-08-21 14:28:54 +0200 | [diff] [blame] | 283 | When such conditions must be met, these are highlighted in the ``Mitigations |
| 284 | implemented?`` box. |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 285 | |
Sandrine Bailleux | 522185b | 2023-08-21 14:28:54 +0200 | [diff] [blame] | 286 | As our :ref:`Target of Evaluation` is made of several, distinct firmware images, |
| 287 | some threats are confined in specific images, while others apply to each of |
| 288 | them. To help developers implement mitigations in the right place, threats below |
| 289 | are categorized based on the firmware image that should mitigate them. |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 290 | |
Sandrine Bailleux | 545f4b6 | 2023-09-06 16:11:12 +0200 | [diff] [blame] | 291 | .. _General Threats: |
| 292 | |
Sandrine Bailleux | 522185b | 2023-08-21 14:28:54 +0200 | [diff] [blame] | 293 | General Threats for All Firmware Images |
| 294 | --------------------------------------- |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 295 | |
| 296 | +------------------------+---------------------------------------------------+ |
| 297 | | ID | 05 | |
| 298 | +========================+===================================================+ |
Sandrine Bailleux | b8d854d | 2022-05-16 13:57:38 +0200 | [diff] [blame] | 299 | | Threat | | **Information leak via UART logs** | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 300 | | | | |
| 301 | | | | During the development stages of software it is | |
Sandrine Bailleux | b8d854d | 2022-05-16 13:57:38 +0200 | [diff] [blame] | 302 | | | common to print all sorts of information on the | |
| 303 | | | console, including sensitive or confidential | |
| 304 | | | information such as crash reports with detailed | |
| 305 | | | information of the CPU state, current registers | |
| 306 | | | values, privilege level or stack dumps. | |
| 307 | | | | |
| 308 | | | | This information is useful when debugging | |
| 309 | | | problems before releasing the production | |
| 310 | | | version but it could be used by an attacker | |
| 311 | | | to develop a working exploit if left enabled in | |
| 312 | | | the production version. | |
| 313 | | | | |
| 314 | | | | This happens when directly logging sensitive | |
| 315 | | | information and more subtly when logging | |
| 316 | | | side-channel information that can be used by an | |
| 317 | | | attacker to learn about sensitive information. | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 318 | +------------------------+---------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 319 | | Diagram Elements | DF2 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 320 | +------------------------+---------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 321 | | Affected TF-A | BL1, BL2, BL31 | |
| 322 | | Components | | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 323 | +------------------------+---------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 324 | | Assets | Sensitive Data | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 325 | +------------------------+---------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 326 | | Threat Agent | AppDebug | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 327 | +------------------------+---------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 328 | | Threat Type | Information Disclosure | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 329 | +------------------------+------------------+----------------+---------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 330 | | Application | Server | IoT | Mobile | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 331 | +------------------------+------------------+----------------+---------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 332 | | Impact | N/A | Low (2) | Low (2) | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 333 | +------------------------+------------------+----------------+---------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 334 | | Likelihood | N/A | High (4) | High (4) | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 335 | +------------------------+------------------+----------------+---------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 336 | | Total Risk Rating | N/A | Medium (8) | Medium (8) | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 337 | +------------------------+------------------+----------------+---------------+ |
Sandrine Bailleux | b8d854d | 2022-05-16 13:57:38 +0200 | [diff] [blame] | 338 | | Mitigations | | Remove sensitive information logging in | |
| 339 | | | production releases. | |
| 340 | | | | |
| 341 | | | | Do not conditionally log information depending | |
| 342 | | | on potentially sensitive data. | |
| 343 | | | | |
| 344 | | | | Do not log high precision timing information. | |
Sandrine Bailleux | 94e7009 | 2022-05-13 12:39:56 +0200 | [diff] [blame] | 345 | +------------------------+---------------------------------------------------+ |
| 346 | | Mitigations | | Yes / Platform Specific. | |
| 347 | | implemented? | Requires the right build options to be used. | |
| 348 | | | | |
| 349 | | | | Crash reporting is only enabled for debug | |
| 350 | | | builds by default, see ``CRASH_REPORTING`` | |
| 351 | | | build option. | |
| 352 | | | | |
| 353 | | | | The log level can be tuned at build time, from | |
| 354 | | | very verbose to no output at all. See | |
| 355 | | | ``LOG_LEVEL`` build option. By default, release | |
| 356 | | | builds are a lot less verbose than debug ones | |
| 357 | | | but still produce some output. | |
| 358 | | | | |
| 359 | | | | Messages produced by the platform code should | |
| 360 | | | use the appropriate level of verbosity so as | |
| 361 | | | not to leak sensitive information in production | |
| 362 | | | builds. | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 363 | +------------------------+---------------------------------------------------+ |
| 364 | |
| 365 | +------------------------+----------------------------------------------------+ |
| 366 | | ID | 06 | |
| 367 | +========================+====================================================+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 368 | | Threat | | **An attacker can read sensitive data and | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 369 | | | execute arbitrary code through the external | |
| 370 | | | debug and trace interface** | |
| 371 | | | | |
| 372 | | | | Arm processors include hardware-assisted debug | |
| 373 | | | and trace features that can be controlled without| |
| 374 | | | the need for software operating on the platform. | |
| 375 | | | If left enabled without authentication, this | |
| 376 | | | feature can be used by an attacker to inspect and| |
| 377 | | | modify TF-A registers and memory allowing the | |
| 378 | | | attacker to read sensitive data and execute | |
| 379 | | | arbitrary code. | |
| 380 | +------------------------+----------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 381 | | Diagram Elements | DF3 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 382 | +------------------------+----------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 383 | | Affected TF-A | BL1, BL2, BL31 | |
| 384 | | Components | | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 385 | +------------------------+----------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 386 | | Assets | Code Execution, Sensitive Data | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 387 | +------------------------+----------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 388 | | Threat Agent | AppDebug | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 389 | +------------------------+----------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 390 | | Threat Type | Tampering, Information Disclosure, | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 391 | | | Elevation of privilege | |
| 392 | +------------------------+------------------+---------------+-----------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 393 | | Application | Server | IoT | Mobile | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 394 | +------------------------+------------------+---------------+-----------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 395 | | Impact | N/A | High (4) | High (4) | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 396 | +------------------------+------------------+---------------+-----------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 397 | | Likelihood | N/A | Critical (5) | Critical (5) | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 398 | +------------------------+------------------+---------------+-----------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 399 | | Total Risk Rating | N/A | Critical (20) | Critical (20) | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 400 | +------------------------+------------------+---------------+-----------------+ |
Sandrine Bailleux | 94e7009 | 2022-05-13 12:39:56 +0200 | [diff] [blame] | 401 | | Mitigations | Disable the debug and trace capability for | |
| 402 | | | production releases or enable proper debug | |
| 403 | | | authentication as recommended by [`DEN0034`_]. | |
| 404 | +------------------------+----------------------------------------------------+ |
| 405 | | Mitigations | | Platform specific. | |
| 406 | | implemented? | | |
| 407 | | | | Configuration of debug and trace capabilities is | |
| 408 | | | entirely platform specific. | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 409 | +------------------------+----------------------------------------------------+ |
| 410 | |
| 411 | +------------------------+------------------------------------------------------+ |
Sandrine Bailleux | 522185b | 2023-08-21 14:28:54 +0200 | [diff] [blame] | 412 | | ID | 08 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 413 | +========================+======================================================+ |
Sandrine Bailleux | 522185b | 2023-08-21 14:28:54 +0200 | [diff] [blame] | 414 | | Threat | | **Memory corruption due to memory overflows and | |
| 415 | | | lack of boundary checking when accessing resources | |
| 416 | | | could allow an attacker to execute arbitrary code, | |
| 417 | | | modify some state variable to change the normal | |
| 418 | | | flow of the program, or leak sensitive | |
| 419 | | | information** | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 420 | | | | |
Sandrine Bailleux | 522185b | 2023-08-21 14:28:54 +0200 | [diff] [blame] | 421 | | | | Like in other software, TF-A has multiple points | |
| 422 | | | where memory corruption security errors can arise. | |
| 423 | | | | |
| 424 | | | | Some of the errors include integer overflow, | |
| 425 | | | buffer overflow, incorrect array boundary checks, | |
| 426 | | | and incorrect error management. | |
| 427 | | | Improper use of asserts instead of proper input | |
| 428 | | | validations might also result in these kinds of | |
| 429 | | | errors in release builds. | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 430 | +------------------------+------------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 431 | | Diagram Elements | DF4, DF5 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 432 | +------------------------+------------------------------------------------------+ |
Sandrine Bailleux | 522185b | 2023-08-21 14:28:54 +0200 | [diff] [blame] | 433 | | Affected TF-A | BL1, BL2, BL31 | |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 434 | | Components | | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 435 | +------------------------+------------------------------------------------------+ |
Sandrine Bailleux | 522185b | 2023-08-21 14:28:54 +0200 | [diff] [blame] | 436 | | Assets | Code Execution, Sensitive Data | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 437 | +------------------------+------------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 438 | | Threat Agent | NSCode, SecCode | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 439 | +------------------------+------------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 440 | | Threat Type | Tampering, Information Disclosure, | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 441 | | | Elevation of Privilege | |
| 442 | +------------------------+-------------------+-----------------+----------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 443 | | Application | Server | IoT | Mobile | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 444 | +------------------------+-------------------+-----------------+----------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 445 | | Impact | Critical (5) | Critical (5) | Critical (5) | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 446 | +------------------------+-------------------+-----------------+----------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 447 | | Likelihood | Medium (3 | Medium (3) | Medium (3) | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 448 | +------------------------+-------------------+-----------------+----------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 449 | | Total Risk Rating | High (15) | High (15) | High (15) | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 450 | +------------------------+-------------------+-----------------+----------------+ |
Sandrine Bailleux | 94e7009 | 2022-05-13 12:39:56 +0200 | [diff] [blame] | 451 | | Mitigations | | 1) Use proper input validation. | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 452 | | | | |
Sandrine Bailleux | 94e7009 | 2022-05-13 12:39:56 +0200 | [diff] [blame] | 453 | | | | 2) Code reviews, testing. | |
| 454 | +------------------------+------------------------------------------------------+ |
| 455 | | Mitigations | | 1) Yes. | |
| 456 | | implemented? | Data received from normal world, such as addresses | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 457 | | | and sizes identifying memory regions, are | |
| 458 | | | sanitized before being used. These security checks | |
| 459 | | | make sure that the normal world software does not | |
| 460 | | | access memory beyond its limit. | |
| 461 | | | | |
| 462 | | | | By default *asserts* are only used to check for | |
| 463 | | | programming errors in debug builds. Other types of | |
| 464 | | | errors are handled through condition checks that | |
| 465 | | | remain enabled in release builds. See | |
| 466 | | | `TF-A error handling policy`_. TF-A provides an | |
| 467 | | | option to use *asserts* in release builds, however | |
| 468 | | | we recommend using proper runtime checks instead | |
| 469 | | | of relying on asserts in release builds. | |
Sandrine Bailleux | 94e7009 | 2022-05-13 12:39:56 +0200 | [diff] [blame] | 470 | | | | |
| 471 | | | | 2) Yes. | |
| 472 | | | TF-A uses a combination of manual code reviews | |
| 473 | | | and automated program analysis and testing to | |
| 474 | | | detect and fix memory corruption bugs. All TF-A | |
| 475 | | | code including platform code go through manual | |
| 476 | | | code reviews. Additionally, static code analysis | |
| 477 | | | is performed using Coverity Scan on all TF-A code. | |
| 478 | | | The code is also tested with | |
| 479 | | | `Trusted Firmware-A Tests`_ on Juno and FVP | |
| 480 | | | platforms. | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 481 | +------------------------+------------------------------------------------------+ |
| 482 | |
Sandrine Bailleux | 522185b | 2023-08-21 14:28:54 +0200 | [diff] [blame] | 483 | |
| 484 | +------------------------+----------------------------------------------------+ |
| 485 | | ID | 11 | |
| 486 | +========================+====================================================+ |
| 487 | | Threat | | **Misconfiguration of the Memory Management Unit | |
| 488 | | | (MMU) may allow a normal world software to | |
| 489 | | | access sensitive data, execute arbitrary | |
| 490 | | | code or access otherwise restricted HW | |
| 491 | | | interface** | |
| 492 | | | | |
| 493 | | | | A misconfiguration of the MMU could | |
| 494 | | | lead to an open door for software running in the | |
| 495 | | | normal world to access sensitive data or even | |
| 496 | | | execute code if the proper security mechanisms | |
| 497 | | | are not in place. | |
| 498 | +------------------------+----------------------------------------------------+ |
| 499 | | Diagram Elements | DF5, DF6 | |
| 500 | +------------------------+----------------------------------------------------+ |
| 501 | | Affected TF-A | BL1, BL2, BL31 | |
| 502 | | Components | | |
| 503 | +------------------------+----------------------------------------------------+ |
| 504 | | Assets | Sensitive Data, Code execution | |
| 505 | +------------------------+----------------------------------------------------+ |
| 506 | | Threat Agent | NSCode | |
| 507 | +------------------------+----------------------------------------------------+ |
| 508 | | Threat Type | Information Disclosure, Elevation of Privilege | |
| 509 | +------------------------+-----------------+-----------------+----------------+ |
| 510 | | Application | Server | IoT | Mobile | |
| 511 | +------------------------+-----------------+-----------------+----------------+ |
| 512 | | Impact | Critical (5) | Critical (5) | Critical (5) | |
| 513 | +------------------------+-----------------+-----------------+----------------+ |
| 514 | | Likelihood | High (4) | High (4) | High (4) | |
| 515 | +------------------------+-----------------+-----------------+----------------+ |
| 516 | | Total Risk Rating | Critical (20) | Critical (20) | Critical (20) | |
| 517 | +------------------------+-----------------+-----------------+----------------+ |
| 518 | | Mitigations | When configuring access permissions, the | |
| 519 | | | principle of least privilege ought to be | |
| 520 | | | enforced. This means we should not grant more | |
| 521 | | | privileges than strictly needed, e.g. code | |
| 522 | | | should be read-only executable, read-only data | |
| 523 | | | should be read-only execute-never, and so on. | |
| 524 | +------------------------+----------------------------------------------------+ |
| 525 | | Mitigations | | Platform specific. | |
| 526 | | implemented? | | |
| 527 | | | | MMU configuration is platform specific, | |
| 528 | | | therefore platforms need to make sure that the | |
| 529 | | | correct attributes are assigned to memory | |
| 530 | | | regions. | |
| 531 | | | | |
| 532 | | | | TF-A provides a library which abstracts the | |
| 533 | | | low-level details of MMU configuration. It | |
| 534 | | | provides well-defined and tested APIs. | |
| 535 | | | Platforms are encouraged to use it to limit the | |
| 536 | | | risk of misconfiguration. | |
| 537 | +------------------------+----------------------------------------------------+ |
| 538 | |
| 539 | |
| 540 | +------------------------+-----------------------------------------------------+ |
| 541 | | ID | 13 | |
| 542 | +========================+=====================================================+ |
| 543 | | Threat | | **Leaving sensitive information in the memory, | |
| 544 | | | can allow an attacker to retrieve them.** | |
| 545 | | | | |
| 546 | | | | Accidentally leaving not-needed sensitive data in | |
| 547 | | | internal buffers can leak them if an attacker | |
| 548 | | | gains access to memory due to a vulnerability. | |
| 549 | +------------------------+-----------------------------------------------------+ |
| 550 | | Diagram Elements | DF4, DF5 | |
| 551 | +------------------------+-----------------------------------------------------+ |
| 552 | | Affected TF-A | BL1, BL2, BL31 | |
| 553 | | Components | | |
| 554 | +------------------------+-----------------------------------------------------+ |
| 555 | | Assets | Sensitive Data | |
| 556 | +------------------------+-----------------------------------------------------+ |
| 557 | | Threat Agent | NSCode, SecCode | |
| 558 | +------------------------+-----------------------------------------------------+ |
| 559 | | Threat Type | Information Disclosure | |
| 560 | +------------------------+-------------------+----------------+----------------+ |
| 561 | | Application | Server | IoT | Mobile | |
| 562 | +------------------------+-------------------+----------------+----------------+ |
| 563 | | Impact | Critical (5) | Critical (5) | Critical (5) | |
| 564 | +------------------------+-------------------+----------------+----------------+ |
| 565 | | Likelihood | Medium (3) | Medium (3) | Medium (3) | |
| 566 | +------------------------+-------------------+----------------+----------------+ |
| 567 | | Total Risk Rating | High (15) | High (15) | High (15) | |
| 568 | +------------------------+-------------------+----------------+----------------+ |
| 569 | | Mitigations | Clear the sensitive data from internal buffers as | |
| 570 | | | soon as they are not needed anymore. | |
| 571 | +------------------------+-----------------------------------------------------+ |
| 572 | | Mitigations | | Yes / Platform specific | |
Sandrine Bailleux | a384672 | 2023-10-11 08:27:43 +0200 | [diff] [blame] | 573 | | implemented? | | |
| 574 | +------------------------+-----------------------------------------------------+ |
| 575 | |
| 576 | |
| 577 | +------------------------+-----------------------------------------------------+ |
| 578 | | ID | 15 | |
| 579 | +========================+=====================================================+ |
| 580 | | Threat | | **Improper handling of input data received over | |
| 581 | | | a UART interface may allow an attacker to tamper | |
| 582 | | | with TF-A execution environment.** | |
| 583 | | | | |
| 584 | | | | The consequences of the attack depend on the | |
| 585 | | | the exact usage of input data received over UART. | |
| 586 | | | Examples are injection of arbitrary data, | |
| 587 | | | sensitive data tampering, influencing the | |
| 588 | | | execution path, denial of service (if using | |
| 589 | | | blocking I/O). This list may not be exhaustive. | |
| 590 | +------------------------+-----------------------------------------------------+ |
| 591 | | Diagram Elements | DF2, DF4, DF5 | |
| 592 | +------------------------+-----------------------------------------------------+ |
| 593 | | Affected TF-A | BL1, BL2, BL31 | |
| 594 | | Components | | |
| 595 | +------------------------+-----------------------------------------------------+ |
| 596 | | Assets | Sensitive Data, Code Execution, Availability | |
| 597 | +------------------------+-----------------------------------------------------+ |
| 598 | | Threat Agent | NSCode, SecCode | |
| 599 | +------------------------+-----------------------------------------------------+ |
| 600 | | Threat Type | Tampering, Information Disclosure, Denial of | |
| 601 | | | service, Elevation of privilege. | |
| 602 | +------------------------+-------------------+----------------+----------------+ |
| 603 | | Application | Server | IoT | Mobile | |
| 604 | +------------------------+-------------------+----------------+----------------+ |
| 605 | | Impact | Critical (5) | Critical (5) | Critical (5) | |
| 606 | +------------------------+-------------------+----------------+----------------+ |
| 607 | | Likelihood | Critical (5) | Critical (5) | Critical (5) | |
| 608 | +------------------------+-------------------+----------------+----------------+ |
| 609 | | Total Risk Rating | Critical (25) | Critical (25) | Critical (25) | |
| 610 | +------------------------+-------------------+----------------+----------------+ |
| 611 | | Mitigations | | By default, the code to read input data from UART | |
| 612 | | | interfaces is disabled (see `ENABLE_CONSOLE_GETC` | |
| 613 | | | build option). It should only be enabled on a | |
| 614 | | | need basis. | |
| 615 | | | | |
| 616 | | | | Data received over UART interfaces should be | |
| 617 | | | treated as untrusted data. As such, it should be | |
| 618 | | | properly sanitized and handled with caution. | |
| 619 | +------------------------+-----------------------------------------------------+ |
| 620 | | Mitigations | | Platform specific. | |
| 621 | | implemented? | | |
| 622 | | | | Generic code does not read any input data from | |
| 623 | | | UART interface(s). | |
Sandrine Bailleux | 522185b | 2023-08-21 14:28:54 +0200 | [diff] [blame] | 624 | +------------------------+-----------------------------------------------------+ |
| 625 | |
| 626 | |
Sandrine Bailleux | 545f4b6 | 2023-09-06 16:11:12 +0200 | [diff] [blame] | 627 | .. _Boot Firmware Threats: |
| 628 | |
Sandrine Bailleux | 522185b | 2023-08-21 14:28:54 +0200 | [diff] [blame] | 629 | Threats to be Mitigated by the Boot Firmware |
| 630 | -------------------------------------------- |
| 631 | |
| 632 | The boot firmware here refers to the boot ROM (BL1) and the trusted boot |
| 633 | firmware (BL2). Typically it does not stay resident in memory and it is |
| 634 | dismissed once execution has reached the runtime EL3 firmware (BL31). Thus, past |
| 635 | that point in time, the threats below can no longer be exploited. |
| 636 | |
| 637 | Note, however, that this is not necessarily true on all platforms. Platform |
| 638 | vendors should review these threats to make sure they cannot be exploited |
| 639 | nonetheless once execution has reached the runtime EL3 firmware. |
| 640 | |
| 641 | +------------------------+----------------------------------------------------+ |
| 642 | | ID | 01 | |
| 643 | +========================+====================================================+ |
| 644 | | Threat | | **An attacker can mangle firmware images to | |
| 645 | | | execute arbitrary code** | |
| 646 | | | | |
| 647 | | | | Some TF-A images are loaded from external | |
| 648 | | | storage. It is possible for an attacker to access| |
| 649 | | | the external flash memory and change its contents| |
| 650 | | | physically, through the Rich OS, or using the | |
| 651 | | | updating mechanism to modify the non-volatile | |
| 652 | | | images to execute arbitrary code. | |
| 653 | +------------------------+----------------------------------------------------+ |
| 654 | | Diagram Elements | DF1, DF4, DF5 | |
| 655 | +------------------------+----------------------------------------------------+ |
| 656 | | Affected TF-A | BL2, BL31 | |
| 657 | | Components | | |
| 658 | +------------------------+----------------------------------------------------+ |
| 659 | | Assets | Code Execution | |
| 660 | +------------------------+----------------------------------------------------+ |
| 661 | | Threat Agent | PhysicalAccess, NSCode, SecCode | |
| 662 | +------------------------+----------------------------------------------------+ |
| 663 | | Threat Type | Tampering, Elevation of Privilege | |
| 664 | +------------------------+------------------+-----------------+---------------+ |
| 665 | | Application | Server | IoT | Mobile | |
| 666 | +------------------------+------------------+-----------------+---------------+ |
| 667 | | Impact | Critical (5) | Critical (5) | Critical (5) | |
| 668 | +------------------------+------------------+-----------------+---------------+ |
| 669 | | Likelihood | Critical (5) | Critical (5) | Critical (5) | |
| 670 | +------------------------+------------------+-----------------+---------------+ |
| 671 | | Total Risk Rating | Critical (25) | Critical (25) | Critical (25) | |
| 672 | +------------------------+------------------+-----------------+---------------+ |
| 673 | | Mitigations | | 1) Implement the `Trusted Board Boot (TBB)`_ | |
| 674 | | | feature which prevents malicious firmware from | |
| 675 | | | running on the platform by authenticating all | |
| 676 | | | firmware images. | |
| 677 | | | | |
| 678 | | | | 2) Perform extra checks on unauthenticated data, | |
| 679 | | | such as FIP metadata, prior to use. | |
| 680 | +------------------------+----------------------------------------------------+ |
| 681 | | Mitigations | | 1) Yes, provided that the ``TRUSTED_BOARD_BOOT`` | |
| 682 | | implemented? | build option is set to 1. | |
| 683 | | | | |
| 684 | | | | 2) Yes. | |
| 685 | +------------------------+----------------------------------------------------+ |
| 686 | |
| 687 | +------------------------+----------------------------------------------------+ |
| 688 | | ID | 02 | |
| 689 | +========================+====================================================+ |
| 690 | | Threat | | **An attacker may attempt to boot outdated, | |
| 691 | | | potentially vulnerable firmware image** | |
| 692 | | | | |
| 693 | | | | When updating firmware, an attacker may attempt | |
| 694 | | | to rollback to an older version that has unfixed | |
| 695 | | | vulnerabilities. | |
| 696 | +------------------------+----------------------------------------------------+ |
| 697 | | Diagram Elements | DF1, DF4, DF5 | |
| 698 | +------------------------+----------------------------------------------------+ |
| 699 | | Affected TF-A | BL2, BL31 | |
| 700 | | Components | | |
| 701 | +------------------------+----------------------------------------------------+ |
| 702 | | Assets | Code Execution | |
| 703 | +------------------------+----------------------------------------------------+ |
| 704 | | Threat Agent | PhysicalAccess, NSCode, SecCode | |
| 705 | +------------------------+----------------------------------------------------+ |
| 706 | | Threat Type | Tampering | |
| 707 | +------------------------+------------------+-----------------+---------------+ |
| 708 | | Application | Server | IoT | Mobile | |
| 709 | +------------------------+------------------+-----------------+---------------+ |
| 710 | | Impact | Critical (5) | Critical (5) | Critical (5) | |
| 711 | +------------------------+------------------+-----------------+---------------+ |
| 712 | | Likelihood | Critical (5) | Critical (5) | Critical (5) | |
| 713 | +------------------------+------------------+-----------------+---------------+ |
| 714 | | Total Risk Rating | Critical (25) | Critical (25) | Critical (25) | |
| 715 | +------------------------+------------------+-----------------+---------------+ |
| 716 | | Mitigations | Implement anti-rollback protection using | |
| 717 | | | non-volatile counters (NV counters) as required | |
| 718 | | | by `TBBR-Client specification`_. | |
| 719 | +------------------------+----------------------------------------------------+ |
| 720 | | Mitigations | | Yes / Platform specific. | |
| 721 | | implemented? | | |
| 722 | | | | After a firmware image is validated, the image | |
| 723 | | | revision number taken from a certificate | |
| 724 | | | extension field is compared with the | |
| 725 | | | corresponding NV counter stored in hardware to | |
| 726 | | | make sure the new counter value is larger than | |
| 727 | | | the current counter value. | |
| 728 | | | | |
| 729 | | | | **Platforms must implement this protection using | |
| 730 | | | platform specific hardware NV counters.** | |
| 731 | +------------------------+----------------------------------------------------+ |
| 732 | |
| 733 | |
| 734 | +------------------------+-------------------------------------------------------+ |
| 735 | | ID | 03 | |
| 736 | +========================+=======================================================+ |
| 737 | | Threat | | **An attacker can use Time-of-Check-Time-of-Use | |
| 738 | | | (TOCTOU) attack to bypass image authentication | |
| 739 | | | during the boot process** | |
| 740 | | | | |
| 741 | | | | Time-of-Check-Time-of-Use (TOCTOU) threats occur | |
| 742 | | | when the security check is produced before the time | |
| 743 | | | the resource is accessed. If an attacker is sitting | |
| 744 | | | in the middle of the off-chip images, they could | |
| 745 | | | change the binary containing executable code right | |
| 746 | | | after the integrity and authentication check has | |
| 747 | | | been performed. | |
| 748 | +------------------------+-------------------------------------------------------+ |
| 749 | | Diagram Elements | DF1 | |
| 750 | +------------------------+-------------------------------------------------------+ |
| 751 | | Affected TF-A | BL1, BL2 | |
| 752 | | Components | | |
| 753 | +------------------------+-------------------------------------------------------+ |
| 754 | | Assets | Code Execution, Sensitive Data | |
| 755 | +------------------------+-------------------------------------------------------+ |
| 756 | | Threat Agent | PhysicalAccess | |
| 757 | +------------------------+-------------------------------------------------------+ |
| 758 | | Threat Type | Elevation of Privilege | |
| 759 | +------------------------+---------------------+-----------------+---------------+ |
| 760 | | Application | Server | IoT | Mobile | |
| 761 | +------------------------+---------------------+-----------------+---------------+ |
| 762 | | Impact | N/A | Critical (5) | Critical (5) | |
| 763 | +------------------------+---------------------+-----------------+---------------+ |
| 764 | | Likelihood | N/A | Medium (3) | Medium (3) | |
| 765 | +------------------------+---------------------+-----------------+---------------+ |
| 766 | | Total Risk Rating | N/A | High (15) | High (15) | |
| 767 | +------------------------+---------------------+-----------------+---------------+ |
| 768 | | Mitigations | Copy image to on-chip memory before authenticating | |
| 769 | | | it. | |
| 770 | +------------------------+-------------------------------------------------------+ |
| 771 | | Mitigations | | Platform specific. | |
| 772 | | implemented? | | |
| 773 | | | | The list of images to load and their location is | |
| 774 | | | platform specific. Platforms are responsible for | |
| 775 | | | arranging images to be loaded in on-chip memory. | |
| 776 | +------------------------+-------------------------------------------------------+ |
| 777 | |
| 778 | |
| 779 | +------------------------+-------------------------------------------------------+ |
| 780 | | ID | 04 | |
| 781 | +========================+=======================================================+ |
| 782 | | Threat | | **An attacker with physical access can execute | |
| 783 | | | arbitrary image by bypassing the signature | |
| 784 | | | verification stage using glitching techniques** | |
| 785 | | | | |
| 786 | | | | Glitching (Fault injection) attacks attempt to put | |
| 787 | | | a hardware into a undefined state by manipulating an| |
| 788 | | | environmental variable such as power supply. | |
| 789 | | | | |
| 790 | | | | TF-A relies on a chain of trust that starts with the| |
| 791 | | | ROTPK, which is the key stored inside the chip and | |
| 792 | | | the root of all validation processes. If an attacker| |
| 793 | | | can break this chain of trust, they could execute | |
| 794 | | | arbitrary code on the device. This could be | |
| 795 | | | achieved with physical access to the device by | |
| 796 | | | attacking the normal execution flow of the | |
| 797 | | | process using glitching techniques that target | |
| 798 | | | points where the image is validated against the | |
| 799 | | | signature. | |
| 800 | +------------------------+-------------------------------------------------------+ |
| 801 | | Diagram Elements | DF1 | |
| 802 | +------------------------+-------------------------------------------------------+ |
| 803 | | Affected TF-A | BL1, BL2 | |
| 804 | | Components | | |
| 805 | +------------------------+-------------------------------------------------------+ |
| 806 | | Assets | Code Execution | |
| 807 | +------------------------+-------------------------------------------------------+ |
| 808 | | Threat Agent | PhysicalAccess | |
| 809 | +------------------------+-------------------------------------------------------+ |
| 810 | | Threat Type | Tampering, Elevation of Privilege | |
| 811 | +------------------------+---------------------+-----------------+---------------+ |
| 812 | | Application | Server | IoT | Mobile | |
| 813 | +------------------------+---------------------+-----------------+---------------+ |
| 814 | | Impact | N/A | Critical (5) | Critical (5) | |
| 815 | +------------------------+---------------------+-----------------+---------------+ |
| 816 | | Likelihood | N/A | Medium (3) | Medium (3) | |
| 817 | +------------------------+---------------------+-----------------+---------------+ |
| 818 | | Total Risk Rating | N/A | High (15) | High (15) | |
| 819 | +------------------------+---------------------+-----------------+---------------+ |
| 820 | | Mitigations | Mechanisms to detect clock glitch and power | |
| 821 | | | variations. | |
| 822 | +------------------------+-------------------------------------------------------+ |
| 823 | | Mitigations | | No. | |
| 824 | | implemented? | | |
| 825 | | | | The most effective mitigation is adding glitching | |
| 826 | | | detection and mitigation circuit at the hardware | |
| 827 | | | level. | |
| 828 | | | | |
| 829 | | | | However, software techniques, such as adding | |
| 830 | | | redundant checks when performing conditional | |
| 831 | | | branches that are security sensitive, can be used | |
| 832 | | | to harden TF-A against such attacks. | |
| 833 | | | **At the moment TF-A doesn't implement such | |
| 834 | | | mitigations.** | |
| 835 | +------------------------+-------------------------------------------------------+ |
| 836 | |
| 837 | .. topic:: Measured Boot Threats (or lack of) |
| 838 | |
| 839 | In the current Measured Boot design, BL1, BL2, and BL31, as well as the |
| 840 | secure world components, form the |SRTM|. Measurement data is currently |
| 841 | considered an asset to be protected against attack, and this is achieved |
| 842 | by storing them in the Secure Memory. |
| 843 | Beyond the measurements stored inside the TCG-compliant Event Log buffer, |
| 844 | there are no other assets to protect or threats to defend against that |
| 845 | could compromise |TF-A| execution environment's security. |
| 846 | |
| 847 | There are general security assets and threats associated with remote/delegated |
| 848 | attestation. However, these are outside the |TF-A| security boundary and |
| 849 | should be dealt with by the appropriate agent in the platform/system. |
| 850 | Since current Measured Boot design does not use local attestation, there would |
| 851 | be no further assets to protect(like unsealed keys). |
| 852 | |
| 853 | A limitation of the current Measured Boot design is that it is dependent upon |
| 854 | Secure Boot as implementation of Measured Boot does not extend measurements |
| 855 | into a discrete |TPM|, where they would be securely stored and protected |
| 856 | against tampering. This implies that if Secure-Boot is compromised, Measured |
| 857 | Boot may also be compromised. |
| 858 | |
| 859 | Platforms must carefully evaluate the security of the default implementation |
| 860 | since the |SRTM| includes all secure world components. |
| 861 | |
| 862 | |
Sandrine Bailleux | 545f4b6 | 2023-09-06 16:11:12 +0200 | [diff] [blame] | 863 | .. _Runtime Firmware Threats: |
| 864 | |
Sandrine Bailleux | 522185b | 2023-08-21 14:28:54 +0200 | [diff] [blame] | 865 | Threats to be Mitigated by the Runtime EL3 Firmware |
| 866 | --------------------------------------------------- |
| 867 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 868 | +------------------------+------------------------------------------------------+ |
Sandrine Bailleux | 522185b | 2023-08-21 14:28:54 +0200 | [diff] [blame] | 869 | | ID | 07 | |
| 870 | +========================+======================================================+ |
| 871 | | Threat | | **An attacker can perform a denial-of-service | |
| 872 | | | attack by using a broken SMC call that causes the | |
| 873 | | | system to reboot or enter into unknown state.** | |
| 874 | | | | |
| 875 | | | | Secure and non-secure clients access TF-A services | |
| 876 | | | through SMC calls. Malicious code can attempt to | |
| 877 | | | place the TF-A runtime into an inconsistent state | |
| 878 | | | by calling unimplemented SMC call or by passing | |
| 879 | | | invalid arguments. | |
| 880 | +------------------------+------------------------------------------------------+ |
| 881 | | Diagram Elements | DF4, DF5 | |
| 882 | +------------------------+------------------------------------------------------+ |
| 883 | | Affected TF-A | BL31 | |
| 884 | | Components | | |
| 885 | +------------------------+------------------------------------------------------+ |
| 886 | | Assets | Availability | |
| 887 | +------------------------+------------------------------------------------------+ |
| 888 | | Threat Agent | NSCode, SecCode | |
| 889 | +------------------------+------------------------------------------------------+ |
| 890 | | Threat Type | Denial of Service | |
| 891 | +------------------------+-------------------+----------------+-----------------+ |
| 892 | | Application | Server | IoT | Mobile | |
| 893 | +------------------------+-------------------+----------------+-----------------+ |
| 894 | | Impact | Medium (3) | Medium (3) | Medium (3) | |
| 895 | +------------------------+-------------------+----------------+-----------------+ |
| 896 | | Likelihood | High (4) | High (4) | High (4) | |
| 897 | +------------------------+-------------------+----------------+-----------------+ |
| 898 | | Total Risk Rating | High (12) | High (12) | High (12) | |
| 899 | +------------------------+-------------------+----------------+-----------------+ |
| 900 | | Mitigations | Validate SMC function ids and arguments before using | |
| 901 | | | them. | |
| 902 | +------------------------+------------------------------------------------------+ |
| 903 | | Mitigations | | Yes / Platform specific. | |
| 904 | | implemented? | | |
| 905 | | | | For standard services, all input is validated. | |
| 906 | | | | |
| 907 | | | | Platforms that implement SiP services must also | |
| 908 | | | validate SMC call arguments. | |
| 909 | +------------------------+------------------------------------------------------+ |
| 910 | |
| 911 | |
| 912 | +------------------------+------------------------------------------------------+ |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 913 | | ID | 09 | |
| 914 | +========================+======================================================+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 915 | | Threat | | **Improperly handled SMC calls can leak register | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 916 | | | contents** | |
| 917 | | | | |
Sandrine Bailleux | 1c7d74e | 2022-05-12 16:37:18 +0200 | [diff] [blame] | 918 | | | | When switching between worlds, TF-A register state | |
| 919 | | | can leak to software in different security | |
| 920 | | | contexts. | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 921 | +------------------------+------------------------------------------------------+ |
Sandrine Bailleux | 1c7d74e | 2022-05-12 16:37:18 +0200 | [diff] [blame] | 922 | | Diagram Elements | DF4, DF5 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 923 | +------------------------+------------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 924 | | Affected TF-A | BL31 | |
| 925 | | Components | | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 926 | +------------------------+------------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 927 | | Assets | Sensitive Data | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 928 | +------------------------+------------------------------------------------------+ |
Sandrine Bailleux | 1c7d74e | 2022-05-12 16:37:18 +0200 | [diff] [blame] | 929 | | Threat Agent | NSCode, SecCode | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 930 | +------------------------+------------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 931 | | Threat Type | Information Disclosure | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 932 | +------------------------+-------------------+----------------+-----------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 933 | | Application | Server | IoT | Mobile | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 934 | +------------------------+-------------------+----------------+-----------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 935 | | Impact | Medium (3) | Medium (3) | Medium (3) | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 936 | +------------------------+-------------------+----------------+-----------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 937 | | Likelihood | High (4) | High (4) | High (4) | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 938 | +------------------------+-------------------+----------------+-----------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 939 | | Total Risk Rating | High (12) | High (12) | High (12) | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 940 | +------------------------+-------------------+----------------+-----------------+ |
Sandrine Bailleux | 94e7009 | 2022-05-13 12:39:56 +0200 | [diff] [blame] | 941 | | Mitigations | Save and restore registers when switching contexts. | |
| 942 | +------------------------+------------------------------------------------------+ |
| 943 | | Mitigations | | Yes. | |
| 944 | | implemented? | | |
| 945 | | | | This is the default behaviour in TF-A. | |
| 946 | | | Build options are also provided to save/restore | |
| 947 | | | additional registers such as floating-point | |
| 948 | | | registers. These should be enabled if required. | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 949 | +------------------------+------------------------------------------------------+ |
| 950 | |
| 951 | +------------------------+-----------------------------------------------------+ |
| 952 | | ID | 10 | |
| 953 | +========================+=====================================================+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 954 | | Threat | | **SMC calls can leak sensitive information from | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 955 | | | TF-A memory via microarchitectural side channels**| |
| 956 | | | | |
| 957 | | | | Microarchitectural side-channel attacks such as | |
| 958 | | | `Spectre`_ can be used to leak data across | |
| 959 | | | security boundaries. An attacker might attempt to | |
| 960 | | | use this kind of attack to leak sensitive | |
| 961 | | | data from TF-A memory. | |
| 962 | +------------------------+-----------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 963 | | Diagram Elements | DF4, DF5 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 964 | +------------------------+-----------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 965 | | Affected TF-A | BL31 | |
| 966 | | Components | | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 967 | +------------------------+-----------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 968 | | Assets | Sensitive Data | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 969 | +------------------------+-----------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 970 | | Threat Agent | SecCode, NSCode | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 971 | +------------------------+-----------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 972 | | Threat Type | Information Disclosure | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 973 | +------------------------+-------------------+----------------+----------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 974 | | Application | Server | IoT | Mobile | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 975 | +------------------------+-------------------+----------------+----------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 976 | | Impact | Medium (3) | Medium (3) | Medium (3) | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 977 | +------------------------+-------------------+----------------+----------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 978 | | Likelihood | Medium (3) | Medium (3) | Medium (3) | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 979 | +------------------------+-------------------+----------------+----------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 980 | | Total Risk Rating | Medium (9) | Medium (9) | Medium (9) | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 981 | +------------------------+-------------------+----------------+----------------+ |
Sandrine Bailleux | 94e7009 | 2022-05-13 12:39:56 +0200 | [diff] [blame] | 982 | | Mitigations | Enable appropriate side-channel protections. | |
| 983 | +------------------------+-----------------------------------------------------+ |
| 984 | | Mitigations | | Yes / Platform specific. | |
| 985 | | implemented? | | |
| 986 | | | | TF-A implements software mitigations for Spectre | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 987 | | | type attacks as recommended by `Cache Speculation | |
Sandrine Bailleux | 94e7009 | 2022-05-13 12:39:56 +0200 | [diff] [blame] | 988 | | | Side-channels`_ for the generic code. | |
| 989 | | | | |
| 990 | | | | SiPs should implement similar mitigations for | |
| 991 | | | code that is deemed to be vulnerable to such | |
| 992 | | | attacks. | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 993 | +------------------------+-----------------------------------------------------+ |
| 994 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 995 | |
| 996 | +------------------------+-----------------------------------------------------+ |
| 997 | | ID | 12 | |
| 998 | +========================+=====================================================+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 999 | | Threat | | **Incorrect configuration of Performance Monitor | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 1000 | | | Unit (PMU) counters can allow an attacker to | |
| 1001 | | | mount side-channel attacks using information | |
| 1002 | | | exposed by the counters** | |
| 1003 | | | | |
| 1004 | | | | Non-secure software can configure PMU registers | |
| 1005 | | | to count events at any exception level and in | |
| 1006 | | | both Secure and Non-secure states. This allows | |
| 1007 | | | a Non-secure software (or a lower-level Secure | |
Sandrine Bailleux | 94e7009 | 2022-05-13 12:39:56 +0200 | [diff] [blame] | 1008 | | | software) to potentially carry out | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 1009 | | | side-channel timing attacks against TF-A. | |
| 1010 | +------------------------+-----------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 1011 | | Diagram Elements | DF5, DF6 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 1012 | +------------------------+-----------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 1013 | | Affected TF-A | BL31 | |
| 1014 | | Components | | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 1015 | +------------------------+-----------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 1016 | | Assets | Sensitive Data | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 1017 | +------------------------+-----------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 1018 | | Threat Agent | NSCode | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 1019 | +------------------------+-----------------------------------------------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 1020 | | Threat Type | Information Disclosure | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 1021 | +------------------------+-------------------+----------------+----------------+ |
Tamas Ban | cf151b7 | 2022-11-30 17:06:05 +0100 | [diff] [blame] | 1022 | | Application | Server | IoT | Mobile | |
| 1023 | +------------------------+-------------------+----------------+----------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 1024 | | Impact | Medium (3) | Medium (3) | Medium (3) | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 1025 | +------------------------+-------------------+----------------+----------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 1026 | | Likelihood | Low (2) | Low (2) | Low (2) | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 1027 | +------------------------+-------------------+----------------+----------------+ |
Sandrine Bailleux | 6e5c218 | 2022-05-10 14:55:01 +0200 | [diff] [blame] | 1028 | | Total Risk Rating | Medium (6) | Medium (6) | Medium (6) | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 1029 | +------------------------+-------------------+----------------+----------------+ |
Sandrine Bailleux | 94e7009 | 2022-05-13 12:39:56 +0200 | [diff] [blame] | 1030 | | Mitigations | Follow mitigation strategies as described in | |
| 1031 | | | `Secure Development Guidelines`_. | |
| 1032 | +------------------------+-----------------------------------------------------+ |
| 1033 | | Mitigations | | Yes / platform specific. | |
| 1034 | | implemented? | | |
| 1035 | | | | General events and cycle counting in the Secure | |
| 1036 | | | world is prohibited by default when applicable. | |
| 1037 | | | | |
| 1038 | | | | However, on some implementations (e.g. PMUv3) | |
| 1039 | | | Secure world event counting depends on external | |
| 1040 | | | debug interface signals, i.e. Secure world event | |
| 1041 | | | counting is enabled if external debug is enabled. | |
| 1042 | | | | |
| 1043 | | | | Configuration of debug signals is platform | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 1044 | | | specific, therefore platforms need to make sure | |
| 1045 | | | that external debug is disabled in production or | |
Sandrine Bailleux | 94e7009 | 2022-05-13 12:39:56 +0200 | [diff] [blame] | 1046 | | | proper debug authentication is in place. This | |
| 1047 | | | should be the case if threat #06 is properly | |
| 1048 | | | mitigated. | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 1049 | +------------------------+-----------------------------------------------------+ |
| 1050 | |
Sandrine Bailleux | 522185b | 2023-08-21 14:28:54 +0200 | [diff] [blame] | 1051 | |
| 1052 | Threats to be Mitigated by an External Agent Outside of TF-A |
| 1053 | ------------------------------------------------------------ |
Tamas Ban | cf151b7 | 2022-11-30 17:06:05 +0100 | [diff] [blame] | 1054 | |
Jeffrey Kardatzke | 7e6b09a | 2022-10-03 15:50:21 -0700 | [diff] [blame] | 1055 | +------------------------+-----------------------------------------------------+ |
| 1056 | | ID | 14 | |
| 1057 | +========================+=====================================================+ |
Jeffrey Kardatzke | ab7e557 | 2023-02-09 11:03:17 -0800 | [diff] [blame] | 1058 | | Threat | | **Attacker wants to execute an arbitrary or | |
| 1059 | | | untrusted binary as the secure OS.** | |
Jeffrey Kardatzke | 7e6b09a | 2022-10-03 15:50:21 -0700 | [diff] [blame] | 1060 | | | | |
Jeffrey Kardatzke | ab7e557 | 2023-02-09 11:03:17 -0800 | [diff] [blame] | 1061 | | | | When the option OPTEE_ALLOW_SMC_LOAD is enabled, | |
| 1062 | | | this trusts the non-secure world up until the | |
| 1063 | | | point it issues the SMC call to load the Secure | |
| 1064 | | | BL32 payload. If a compromise occurs before the | |
| 1065 | | | SMC call is invoked, then arbitrary code execution| |
| 1066 | | | in S-EL1 can occur or arbitrary memory in EL3 can | |
| 1067 | | | be overwritten. | |
Jeffrey Kardatzke | 7e6b09a | 2022-10-03 15:50:21 -0700 | [diff] [blame] | 1068 | +------------------------+-----------------------------------------------------+ |
| 1069 | | Diagram Elements | DF5 | |
| 1070 | +------------------------+-----------------------------------------------------+ |
| 1071 | | Affected TF-A | BL31, BL32 | |
| 1072 | | Components | | |
| 1073 | +------------------------+-----------------------------------------------------+ |
| 1074 | | Assets | Code Execution, Sensitive Data | |
| 1075 | +------------------------+-----------------------------------------------------+ |
| 1076 | | Threat Agent | NSCode | |
| 1077 | +------------------------+-----------------------------------------------------+ |
| 1078 | | Threat Type | Tampering, Information Disclosure, | |
| 1079 | | | Elevation of privilege | |
| 1080 | +------------------------+-----------------+-----------------+-----------------+ |
| 1081 | | Application | Server | IoT | Mobile | |
| 1082 | +------------------------+-----------------+-----------------+-----------------+ |
| 1083 | | Impact | Critical (5) | Critical (5) | Critical (5) | |
| 1084 | +------------------------+-----------------+-----------------+-----------------+ |
Jeffrey Kardatzke | ab7e557 | 2023-02-09 11:03:17 -0800 | [diff] [blame] | 1085 | | Likelihood | High (4) | High (4) | High (4) | |
Jeffrey Kardatzke | 7e6b09a | 2022-10-03 15:50:21 -0700 | [diff] [blame] | 1086 | +------------------------+-----------------+-----------------+-----------------+ |
Jeffrey Kardatzke | ab7e557 | 2023-02-09 11:03:17 -0800 | [diff] [blame] | 1087 | | Total Risk Rating | Critical (20) | Critical (20) | Critical (20) | |
Jeffrey Kardatzke | 7e6b09a | 2022-10-03 15:50:21 -0700 | [diff] [blame] | 1088 | +------------------------+-----------------+-----------------+-----------------+ |
| 1089 | | Mitigations | When enabling the option OPTEE_ALLOW_SMC_LOAD, | |
| 1090 | | | the non-secure OS must be considered a closed | |
| 1091 | | | platform up until the point the SMC can be invoked | |
| 1092 | | | to load OP-TEE. | |
| 1093 | +------------------------+-----------------------------------------------------+ |
| 1094 | | Mitigations | | None in TF-A itself. This option is only used by | |
| 1095 | | implemented? | ChromeOS currently which has other mechanisms to | |
| 1096 | | | to mitigate this threat which are described in | |
| 1097 | | | `OP-TEE Dispatcher`_. | |
| 1098 | +------------------------+-----------------------------------------------------+ |
| 1099 | |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 1100 | -------------- |
| 1101 | |
laurenw-arm | 5421208 | 2023-12-08 15:00:07 -0600 | [diff] [blame] | 1102 | *Copyright (c) 2021-2024, Arm Limited. All rights reserved.* |
Zelalem | 05fed52 | 2021-02-24 19:20:09 -0600 | [diff] [blame] | 1103 | |
| 1104 | |
| 1105 | .. _STRIDE threat analysis technique: https://docs.microsoft.com/en-us/azure/security/develop/threat-modeling-tool-threats#stride-model |
| 1106 | .. _DEN0034: https://developer.arm.com/documentation/den0034/latest |
| 1107 | .. _Cache Speculation Side-channels: https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability |
| 1108 | .. _Spectre: https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability |
| 1109 | .. _TBBR-Client specification: https://developer.arm.com/documentation/den0006/d/ |
| 1110 | .. _Trusted Board Boot (TBB): https://trustedfirmware-a.readthedocs.io/en/latest/design/trusted-board-boot.html |
| 1111 | .. _TF-A error handling policy: https://trustedfirmware-a.readthedocs.io/en/latest/process/coding-guidelines.html#error-handling-and-robustness |
| 1112 | .. _Secure Development Guidelines: https://trustedfirmware-a.readthedocs.io/en/latest/process/security-hardening.html#secure-development-guidelines |
Olivier Deprez | 86d1ffd | 2021-06-01 15:37:16 +0200 | [diff] [blame] | 1113 | .. _Trusted Firmware-A Tests: https://git.trustedfirmware.org/TF-A/tf-a-tests.git/about/ |
Jeffrey Kardatzke | 7e6b09a | 2022-10-03 15:50:21 -0700 | [diff] [blame] | 1114 | .. _OP-TEE Dispatcher: https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/components/spd/optee-dispatcher.rst |
Manish V Badarkhe | 985af7e | 2023-12-21 17:54:30 +0000 | [diff] [blame] | 1115 | .. _PSR Specification: https://developer.arm.com/documentation/den0106/0100 |