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