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