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