blob: d1a77f5875d62e5692d1af908c74890c2a8adfac [file] [log] [blame]
Gary Morrisondc669222021-11-10 14:40:15 -06001Generic Threat Model
Olivier Deprez3af9b3f2021-06-01 15:37:16 +02002********************
Zelalem7006f202021-02-24 19:20:09 -06003
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +02004************
Olivier Deprez3af9b3f2021-06-01 15:37:16 +02005Introduction
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +02006************
7
Olivier Deprez3af9b3f2021-06-01 15:37:16 +02008This document provides a generic threat model for TF-A firmware.
Zelalem7006f202021-02-24 19:20:09 -06009
Sandrine Bailleuxa1e121b2023-08-21 14:28:54 +020010.. _Target of Evaluation:
11
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +020012********************
Zelalem7006f202021-02-24 19:20:09 -060013Target of Evaluation
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +020014********************
15
Zelalem7006f202021-02-24 19:20:09 -060016In this threat model, the target of evaluation is the Trusted
17Firmware for A-class Processors (TF-A). This includes the boot ROM (BL1),
18the trusted boot firmware (BL2) and the runtime EL3 firmware (BL31) as
19shown on Figure 1. Everything else on Figure 1 is outside of the scope of
20the evaluation.
21
22TF-A can be configured in various ways. In this threat model we consider
23only the most basic configuration. To that end we make the following
24assumptions:
25
26- All TF-A images are run from either ROM or on-chip trusted SRAM. This means
27 TF-A is not vulnerable to an attacker that can probe or tamper with off-chip
28 memory.
Zelalem Aweke7446c262021-10-21 13:59:45 -050029
Zelalem7006f202021-02-24 19:20:09 -060030- Trusted boot is enabled. This means an attacker can't boot arbitrary images
31 that are not approved by platform providers.
Zelalem Aweke7446c262021-10-21 13:59:45 -050032
Zelalem7006f202021-02-24 19:20:09 -060033- There is no Secure-EL2. We don't consider threats that may come with
34 Secure-EL2 software.
35
Sandrine Bailleuxb7216482023-08-21 11:04:03 +020036- There are no Root and Realm worlds. These are introduced by :ref:`Realm
37 Management Extension (RME)`.
38
Sandrine Bailleux4365b302022-05-12 14:57:26 +020039- No experimental features are enabled. We do not consider threats that may come
40 from them.
41
Manish V Badarkhe7ccefbc2023-04-03 13:50:59 +010042
Zelalem7006f202021-02-24 19:20:09 -060043Data Flow Diagram
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +020044=================
45
Zelalem7006f202021-02-24 19:20:09 -060046Figure 1 shows a high-level data flow diagram for TF-A. The diagram
47shows a model of the different components of a TF-A-based system and
48their interactions with TF-A. A description of each diagram element
49is given on Table 1. On the diagram, the red broken lines indicate
50trust boundaries. Components outside of the broken lines
51are considered untrusted by TF-A.
52
53.. uml:: ../resources/diagrams/plantuml/tfa_dfd.puml
54 :caption: Figure 1: TF-A Data Flow Diagram
55
56.. table:: Table 1: TF-A Data Flow Diagram Description
57
58 +-----------------+--------------------------------------------------------+
59 | Diagram Element | Description |
60 +=================+========================================================+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +020061 | DF1 | | At boot time, images are loaded from non-volatile |
Zelalem7006f202021-02-24 19:20:09 -060062 | | memory and verified by TF-A boot firmware. These |
63 | | images include TF-A BL2 and BL31 images, as well as |
64 | | other secure and non-secure images. |
65 +-----------------+--------------------------------------------------------+
Sandrine Bailleux348446a2023-10-11 08:27:43 +020066 | DF2 | | TF-A log system framework outputs debug or |
67 | | informative messages over a UART interface. |
68 | | |
69 | | | Also, characters can be read from a UART interface. |
Zelalem7006f202021-02-24 19:20:09 -060070 +-----------------+--------------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +020071 | DF3 | | Debug and trace IP on a platform can allow access |
Zelalem7006f202021-02-24 19:20:09 -060072 | | to registers and memory of TF-A. |
73 +-----------------+--------------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +020074 | DF4 | | Secure world software (e.g. trusted OS) interact |
Zelalem7006f202021-02-24 19:20:09 -060075 | | with TF-A through SMC call interface and/or shared |
76 | | memory. |
77 +-----------------+--------------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +020078 | DF5 | | Non-secure world software (e.g. rich OS) interact |
Zelalem7006f202021-02-24 19:20:09 -060079 | | with TF-A through SMC call interface and/or shared |
80 | | memory. |
81 +-----------------+--------------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +020082 | DF6 | | This path represents the interaction between TF-A and|
Zelalem7006f202021-02-24 19:20:09 -060083 | | various hardware IPs such as TrustZone controller |
84 | | and GIC. At boot time TF-A configures/initializes the|
85 | | IPs and interacts with them at runtime through |
86 | | interrupts and registers. |
87 +-----------------+--------------------------------------------------------+
88
89
Thaddeus Serna5fdf1982023-08-14 13:28:59 -050090.. _threat_analysis:
91
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +020092***************
Zelalem7006f202021-02-24 19:20:09 -060093Threat Analysis
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +020094***************
95
Zelalem7006f202021-02-24 19:20:09 -060096In this section we identify and provide assessment of potential threats to TF-A
97firmware. The threats are identified for each diagram element on the
98data flow diagram above.
99
100For each threat, we identify the *asset* that is under threat, the
101*threat agent* and the *threat type*. Each threat is given a *risk rating*
102that represents the impact and likelihood of that threat. We also discuss
103potential mitigations.
104
105Assets
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200106======
107
Zelalem7006f202021-02-24 19:20:09 -0600108We have identified the following assets for TF-A:
109
110.. table:: Table 2: TF-A Assets
111
112 +--------------------+---------------------------------------------------+
113 | Asset | Description |
114 +====================+===================================================+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200115 | Sensitive Data | | These include sensitive data that an attacker |
Zelalem7006f202021-02-24 19:20:09 -0600116 | | must not be able to tamper with (e.g. the Root |
117 | | of Trust Public Key) or see (e.g. secure logs, |
118 | | debugging information such as crash reports). |
119 +--------------------+---------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200120 | Code Execution | | This represents the requirement that the |
Zelalem7006f202021-02-24 19:20:09 -0600121 | | platform should run only TF-A code approved by |
122 | | the platform provider. |
123 +--------------------+---------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200124 | Availability | | This represents the requirement that TF-A |
Zelalem7006f202021-02-24 19:20:09 -0600125 | | services should always be available for use. |
126 +--------------------+---------------------------------------------------+
127
128Threat Agents
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200129=============
130
Zelalem7006f202021-02-24 19:20:09 -0600131To understand the attack surface, it is important to identify potential
132attackers, i.e. attack entry points. The following threat agents are
133in scope of this threat model.
134
135.. table:: Table 3: Threat Agents
136
137 +-------------------+-------------------------------------------------------+
138 | Threat Agent | Description |
139 +===================+=======================================================+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200140 | NSCode | | Malicious or faulty code running in the Non-secure |
Zelalem7006f202021-02-24 19:20:09 -0600141 | | world, including NS-EL0 NS-EL1 and NS-EL2 levels |
142 +-------------------+-------------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200143 | SecCode | | Malicious or faulty code running in the secure |
Zelalem7006f202021-02-24 19:20:09 -0600144 | | world, including S-EL0 and S-EL1 levels |
145 +-------------------+-------------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200146 | AppDebug | | Physical attacker using debug signals to access |
Zelalem7006f202021-02-24 19:20:09 -0600147 | | TF-A resources |
148 +-------------------+-------------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200149 | PhysicalAccess | | Physical attacker having access to external device |
Zelalem7006f202021-02-24 19:20:09 -0600150 | | communication bus and to external flash |
151 | | communication bus using common hardware |
152 +-------------------+-------------------------------------------------------+
153
154.. note::
155
156 In this threat model an advanced physical attacker that has the capability
157 to tamper with a hardware (e.g. "rewiring" a chip using a focused
158 ion beam (FIB) workstation or decapsulate the chip using chemicals) is
159 considered out-of-scope.
160
161Threat Types
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200162============
163
Zelalem7006f202021-02-24 19:20:09 -0600164In this threat model we categorize threats using the `STRIDE threat
165analysis technique`_. In this technique a threat is categorized as one
166or more of these types: ``Spoofing``, ``Tampering``, ``Repudiation``,
167``Information disclosure``, ``Denial of service`` or
168``Elevation of privilege``.
169
170Threat Risk Ratings
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200171===================
172
Zelalem7006f202021-02-24 19:20:09 -0600173For each threat identified, a risk rating that ranges
174from *informational* to *critical* is given based on the likelihood of the
Tamas Ban1fba1a82022-11-30 17:06:05 +0100175threat occurring if a mitigation is not in place, and the impact of the
Zelalem7006f202021-02-24 19:20:09 -0600176threat (i.e. how severe the consequences could be). Table 4 explains each
177rating in terms of score, impact and likelihood.
178
179.. table:: Table 4: Rating and score as applied to impact and likelihood
180
181 +-----------------------+-------------------------+---------------------------+
182 | **Rating (Score)** | **Impact** | **Likelihood** |
183 +=======================+=========================+===========================+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200184 | Critical (5) | | Extreme impact to | | Threat is almost |
Zelalem7006f202021-02-24 19:20:09 -0600185 | | entire organization | certain to be exploited.|
186 | | if exploited. | |
187 | | | | Knowledge of the threat |
188 | | | and how to exploit it |
189 | | | are in the public |
190 | | | domain. |
191 +-----------------------+-------------------------+---------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200192 | High (4) | | Major impact to entire| | Threat is relatively |
Zelalem7006f202021-02-24 19:20:09 -0600193 | | organization or single| easy to detect and |
194 | | line of business if | exploit by an attacker |
195 | | exploited | with little skill. |
196 +-----------------------+-------------------------+---------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200197 | Medium (3) | | Noticeable impact to | | A knowledgeable insider |
Zelalem7006f202021-02-24 19:20:09 -0600198 | | line of business if | or expert attacker could|
199 | | exploited. | exploit the threat |
200 | | | without much difficulty.|
201 +-----------------------+-------------------------+---------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200202 | Low (2) | | Minor damage if | | Exploiting the threat |
Zelalem7006f202021-02-24 19:20:09 -0600203 | | exploited or could | would require |
204 | | be used in conjunction| considerable expertise |
205 | | with other | and resources |
206 | | vulnerabilities to | |
207 | | perform a more serious| |
208 | | attack | |
209 +-----------------------+-------------------------+---------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200210 | Informational (1) | | Poor programming | | Threat is not likely |
Zelalem7006f202021-02-24 19:20:09 -0600211 | | practice or poor | to be exploited on its |
212 | | design decision that | own, but may be used to |
213 | | may not represent an | gain information for |
214 | | immediate risk on its | launching another |
215 | | own, but may have | attack |
216 | | security implications | |
217 | | if multiplied and/or | |
218 | | combined with other | |
219 | | threats. | |
220 +-----------------------+-------------------------+---------------------------+
221
222Aggregate risk scores are assigned to identified threats;
223specifically, the impact score multiplied by the likelihood score.
224For example, a threat with high likelihood and low impact would have an
225aggregate risk score of eight (8); that is, four (4) for high likelihood
226multiplied by two (2) for low impact. The aggregate risk score determines
227the finding's overall risk level, as shown in the following table.
228
229.. table:: Table 5: Overall risk levels and corresponding aggregate scores
230
231 +---------------------+-----------------------------------+
232 | Overall Risk Level | Aggregate Risk Score |
233 | | (Impact multiplied by Likelihood) |
234 +=====================+===================================+
235 | Critical | 20–25 |
236 +---------------------+-----------------------------------+
237 | High | 12–19 |
238 +---------------------+-----------------------------------+
239 | Medium | 6–11 |
240 +---------------------+-----------------------------------+
241 | Low | 2–5 |
242 +---------------------+-----------------------------------+
243 | Informational | 1 |
244 +---------------------+-----------------------------------+
245
246The likelihood and impact of a threat depends on the
247target environment in which TF-A is running. For example, attacks
248that require physical access are unlikely in server environments while
249they are more common in Internet of Things(IoT) environments.
250In this threat model we consider three target environments:
251``Internet of Things(IoT)``, ``Mobile`` and ``Server``.
252
253Threat Assessment
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200254=================
255
Zelalem7006f202021-02-24 19:20:09 -0600256The following threats were identified by applying STRIDE analysis on
257each diagram element of the data flow diagram.
258
Sandrine Bailleux7e32cdb2022-05-13 12:39:56 +0200259For each threat, we strive to indicate whether the mitigations are currently
260implemented or not. However, the answer to this question is not always straight
261forward. Some mitigations are partially implemented in the generic code but also
262rely on the platform code to implement some bits of it. This threat model aims
263to be platform-independent and it is important to keep in mind that such threats
264only get mitigated if the platform code properly fulfills its responsibilities.
265
266Also, some mitigations require enabling specific features, which must be
267explicitly turned on via a build flag.
268
Sandrine Bailleuxa1e121b2023-08-21 14:28:54 +0200269When such conditions must be met, these are highlighted in the ``Mitigations
270implemented?`` box.
Sandrine Bailleux7e32cdb2022-05-13 12:39:56 +0200271
Sandrine Bailleuxa1e121b2023-08-21 14:28:54 +0200272As our :ref:`Target of Evaluation` is made of several, distinct firmware images,
273some threats are confined in specific images, while others apply to each of
274them. To help developers implement mitigations in the right place, threats below
275are categorized based on the firmware image that should mitigate them.
Zelalem7006f202021-02-24 19:20:09 -0600276
Sandrine Bailleuxa1e121b2023-08-21 14:28:54 +0200277General Threats for All Firmware Images
278---------------------------------------
Zelalem7006f202021-02-24 19:20:09 -0600279
280+------------------------+---------------------------------------------------+
281| ID | 05 |
282+========================+===================================================+
Sandrine Bailleux06777962022-05-16 13:57:38 +0200283| Threat | | **Information leak via UART logs** |
Zelalem7006f202021-02-24 19:20:09 -0600284| | |
285| | | During the development stages of software it is |
Sandrine Bailleux06777962022-05-16 13:57:38 +0200286| | common to print all sorts of information on the |
287| | console, including sensitive or confidential |
288| | information such as crash reports with detailed |
289| | information of the CPU state, current registers |
290| | values, privilege level or stack dumps. |
291| | |
292| | | This information is useful when debugging |
293| | problems before releasing the production |
294| | version but it could be used by an attacker |
295| | to develop a working exploit if left enabled in |
296| | the production version. |
297| | |
298| | | This happens when directly logging sensitive |
299| | information and more subtly when logging |
300| | side-channel information that can be used by an |
301| | attacker to learn about sensitive information. |
Zelalem7006f202021-02-24 19:20:09 -0600302+------------------------+---------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200303| Diagram Elements | DF2 |
Zelalem7006f202021-02-24 19:20:09 -0600304+------------------------+---------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200305| Affected TF-A | BL1, BL2, BL31 |
306| Components | |
Zelalem7006f202021-02-24 19:20:09 -0600307+------------------------+---------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200308| Assets | Sensitive Data |
Zelalem7006f202021-02-24 19:20:09 -0600309+------------------------+---------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200310| Threat Agent | AppDebug |
Zelalem7006f202021-02-24 19:20:09 -0600311+------------------------+---------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200312| Threat Type | Information Disclosure |
Zelalem7006f202021-02-24 19:20:09 -0600313+------------------------+------------------+----------------+---------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200314| Application | Server | IoT | Mobile |
Zelalem7006f202021-02-24 19:20:09 -0600315+------------------------+------------------+----------------+---------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200316| Impact | N/A | Low (2) | Low (2) |
Zelalem7006f202021-02-24 19:20:09 -0600317+------------------------+------------------+----------------+---------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200318| Likelihood | N/A | High (4) | High (4) |
Zelalem7006f202021-02-24 19:20:09 -0600319+------------------------+------------------+----------------+---------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200320| Total Risk Rating | N/A | Medium (8) | Medium (8) |
Zelalem7006f202021-02-24 19:20:09 -0600321+------------------------+------------------+----------------+---------------+
Sandrine Bailleux06777962022-05-16 13:57:38 +0200322| Mitigations | | Remove sensitive information logging in |
323| | production releases. |
324| | |
325| | | Do not conditionally log information depending |
326| | on potentially sensitive data. |
327| | |
328| | | Do not log high precision timing information. |
Sandrine Bailleux7e32cdb2022-05-13 12:39:56 +0200329+------------------------+---------------------------------------------------+
330| Mitigations | | Yes / Platform Specific. |
331| implemented? | Requires the right build options to be used. |
332| | |
333| | | Crash reporting is only enabled for debug |
334| | builds by default, see ``CRASH_REPORTING`` |
335| | build option. |
336| | |
337| | | The log level can be tuned at build time, from |
338| | very verbose to no output at all. See |
339| | ``LOG_LEVEL`` build option. By default, release |
340| | builds are a lot less verbose than debug ones |
341| | but still produce some output. |
342| | |
343| | | Messages produced by the platform code should |
344| | use the appropriate level of verbosity so as |
345| | not to leak sensitive information in production |
346| | builds. |
Zelalem7006f202021-02-24 19:20:09 -0600347+------------------------+---------------------------------------------------+
348
349+------------------------+----------------------------------------------------+
350| ID | 06 |
351+========================+====================================================+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200352| Threat | | **An attacker can read sensitive data and |
Zelalem7006f202021-02-24 19:20:09 -0600353| | execute arbitrary code through the external |
354| | debug and trace interface** |
355| | |
356| | | Arm processors include hardware-assisted debug |
357| | and trace features that can be controlled without|
358| | the need for software operating on the platform. |
359| | If left enabled without authentication, this |
360| | feature can be used by an attacker to inspect and|
361| | modify TF-A registers and memory allowing the |
362| | attacker to read sensitive data and execute |
363| | arbitrary code. |
364+------------------------+----------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200365| Diagram Elements | DF3 |
Zelalem7006f202021-02-24 19:20:09 -0600366+------------------------+----------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200367| Affected TF-A | BL1, BL2, BL31 |
368| Components | |
Zelalem7006f202021-02-24 19:20:09 -0600369+------------------------+----------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200370| Assets | Code Execution, Sensitive Data |
Zelalem7006f202021-02-24 19:20:09 -0600371+------------------------+----------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200372| Threat Agent | AppDebug |
Zelalem7006f202021-02-24 19:20:09 -0600373+------------------------+----------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200374| Threat Type | Tampering, Information Disclosure, |
Zelalem7006f202021-02-24 19:20:09 -0600375| | Elevation of privilege |
376+------------------------+------------------+---------------+-----------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200377| Application | Server | IoT | Mobile |
Zelalem7006f202021-02-24 19:20:09 -0600378+------------------------+------------------+---------------+-----------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200379| Impact | N/A | High (4) | High (4) |
Zelalem7006f202021-02-24 19:20:09 -0600380+------------------------+------------------+---------------+-----------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200381| Likelihood | N/A | Critical (5) | Critical (5) |
Zelalem7006f202021-02-24 19:20:09 -0600382+------------------------+------------------+---------------+-----------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200383| Total Risk Rating | N/A | Critical (20) | Critical (20) |
Zelalem7006f202021-02-24 19:20:09 -0600384+------------------------+------------------+---------------+-----------------+
Sandrine Bailleux7e32cdb2022-05-13 12:39:56 +0200385| Mitigations | Disable the debug and trace capability for |
386| | production releases or enable proper debug |
387| | authentication as recommended by [`DEN0034`_]. |
388+------------------------+----------------------------------------------------+
389| Mitigations | | Platform specific. |
390| implemented? | |
391| | | Configuration of debug and trace capabilities is |
392| | entirely platform specific. |
Zelalem7006f202021-02-24 19:20:09 -0600393+------------------------+----------------------------------------------------+
394
395+------------------------+------------------------------------------------------+
Zelalem7006f202021-02-24 19:20:09 -0600396| ID | 08 |
397+========================+======================================================+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200398| Threat | | **Memory corruption due to memory overflows and |
Zelalem7006f202021-02-24 19:20:09 -0600399| | lack of boundary checking when accessing resources |
400| | could allow an attacker to execute arbitrary code, |
401| | modify some state variable to change the normal |
402| | flow of the program, or leak sensitive |
403| | information** |
404| | |
Sandrine Bailleux1b7c82c2022-05-13 12:40:22 +0200405| | | Like in other software, TF-A has multiple points |
406| | where memory corruption security errors can arise. |
Zelalem7006f202021-02-24 19:20:09 -0600407| | |
408| | | Some of the errors include integer overflow, |
409| | buffer overflow, incorrect array boundary checks, |
410| | and incorrect error management. |
411| | Improper use of asserts instead of proper input |
412| | validations might also result in these kinds of |
413| | errors in release builds. |
414+------------------------+------------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200415| Diagram Elements | DF4, DF5 |
Zelalem7006f202021-02-24 19:20:09 -0600416+------------------------+------------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200417| Affected TF-A | BL1, BL2, BL31 |
418| Components | |
Zelalem7006f202021-02-24 19:20:09 -0600419+------------------------+------------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200420| Assets | Code Execution, Sensitive Data |
Zelalem7006f202021-02-24 19:20:09 -0600421+------------------------+------------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200422| Threat Agent | NSCode, SecCode |
Zelalem7006f202021-02-24 19:20:09 -0600423+------------------------+------------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200424| Threat Type | Tampering, Information Disclosure, |
Zelalem7006f202021-02-24 19:20:09 -0600425| | Elevation of Privilege |
426+------------------------+-------------------+-----------------+----------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200427| Application | Server | IoT | Mobile |
Zelalem7006f202021-02-24 19:20:09 -0600428+------------------------+-------------------+-----------------+----------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200429| Impact | Critical (5) | Critical (5) | Critical (5) |
Zelalem7006f202021-02-24 19:20:09 -0600430+------------------------+-------------------+-----------------+----------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200431| Likelihood | Medium (3 | Medium (3) | Medium (3) |
Zelalem7006f202021-02-24 19:20:09 -0600432+------------------------+-------------------+-----------------+----------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200433| Total Risk Rating | High (15) | High (15) | High (15) |
Zelalem7006f202021-02-24 19:20:09 -0600434+------------------------+-------------------+-----------------+----------------+
Sandrine Bailleux7e32cdb2022-05-13 12:39:56 +0200435| Mitigations | | 1) Use proper input validation. |
Zelalem7006f202021-02-24 19:20:09 -0600436| | |
Sandrine Bailleux7e32cdb2022-05-13 12:39:56 +0200437| | | 2) Code reviews, testing. |
438+------------------------+------------------------------------------------------+
439| Mitigations | | 1) Yes. |
440| implemented? | Data received from normal world, such as addresses |
Zelalem7006f202021-02-24 19:20:09 -0600441| | and sizes identifying memory regions, are |
442| | sanitized before being used. These security checks |
443| | make sure that the normal world software does not |
444| | access memory beyond its limit. |
445| | |
446| | | By default *asserts* are only used to check for |
447| | programming errors in debug builds. Other types of |
448| | errors are handled through condition checks that |
449| | remain enabled in release builds. See |
450| | `TF-A error handling policy`_. TF-A provides an |
451| | option to use *asserts* in release builds, however |
452| | we recommend using proper runtime checks instead |
453| | of relying on asserts in release builds. |
Sandrine Bailleux7e32cdb2022-05-13 12:39:56 +0200454| | |
455| | | 2) Yes. |
456| | TF-A uses a combination of manual code reviews |
457| | and automated program analysis and testing to |
458| | detect and fix memory corruption bugs. All TF-A |
459| | code including platform code go through manual |
460| | code reviews. Additionally, static code analysis |
461| | is performed using Coverity Scan on all TF-A code. |
462| | The code is also tested with |
463| | `Trusted Firmware-A Tests`_ on Juno and FVP |
464| | platforms. |
Zelalem7006f202021-02-24 19:20:09 -0600465+------------------------+------------------------------------------------------+
466
Sandrine Bailleuxa1e121b2023-08-21 14:28:54 +0200467
468+------------------------+----------------------------------------------------+
469| ID | 11 |
470+========================+====================================================+
471| Threat | | **Misconfiguration of the Memory Management Unit |
472| | (MMU) may allow a normal world software to |
473| | access sensitive data, execute arbitrary |
474| | code or access otherwise restricted HW |
475| | interface** |
476| | |
477| | | A misconfiguration of the MMU could |
478| | lead to an open door for software running in the |
479| | normal world to access sensitive data or even |
480| | execute code if the proper security mechanisms |
481| | are not in place. |
482+------------------------+----------------------------------------------------+
483| Diagram Elements | DF5, DF6 |
484+------------------------+----------------------------------------------------+
485| Affected TF-A | BL1, BL2, BL31 |
486| Components | |
487+------------------------+----------------------------------------------------+
488| Assets | Sensitive Data, Code execution |
489+------------------------+----------------------------------------------------+
490| Threat Agent | NSCode |
491+------------------------+----------------------------------------------------+
492| Threat Type | Information Disclosure, Elevation of Privilege |
493+------------------------+-----------------+-----------------+----------------+
494| Application | Server | IoT | Mobile |
495+------------------------+-----------------+-----------------+----------------+
496| Impact | Critical (5) | Critical (5) | Critical (5) |
497+------------------------+-----------------+-----------------+----------------+
498| Likelihood | High (4) | High (4) | High (4) |
499+------------------------+-----------------+-----------------+----------------+
500| Total Risk Rating | Critical (20) | Critical (20) | Critical (20) |
501+------------------------+-----------------+-----------------+----------------+
502| Mitigations | When configuring access permissions, the |
503| | principle of least privilege ought to be |
504| | enforced. This means we should not grant more |
505| | privileges than strictly needed, e.g. code |
506| | should be read-only executable, read-only data |
507| | should be read-only execute-never, and so on. |
508+------------------------+----------------------------------------------------+
509| Mitigations | | Platform specific. |
510| implemented? | |
511| | | MMU configuration is platform specific, |
512| | therefore platforms need to make sure that the |
513| | correct attributes are assigned to memory |
514| | regions. |
515| | |
516| | | TF-A provides a library which abstracts the |
517| | low-level details of MMU configuration. It |
518| | provides well-defined and tested APIs. |
519| | Platforms are encouraged to use it to limit the |
520| | risk of misconfiguration. |
521+------------------------+----------------------------------------------------+
522
523
524+------------------------+-----------------------------------------------------+
525| ID | 13 |
526+========================+=====================================================+
527| Threat | | **Leaving sensitive information in the memory, |
528| | can allow an attacker to retrieve them.** |
529| | |
530| | | Accidentally leaving not-needed sensitive data in |
531| | internal buffers can leak them if an attacker |
532| | gains access to memory due to a vulnerability. |
533+------------------------+-----------------------------------------------------+
534| Diagram Elements | DF4, DF5 |
535+------------------------+-----------------------------------------------------+
536| Affected TF-A | BL1, BL2, BL31 |
537| Components | |
538+------------------------+-----------------------------------------------------+
539| Assets | Sensitive Data |
540+------------------------+-----------------------------------------------------+
541| Threat Agent | NSCode, SecCode |
542+------------------------+-----------------------------------------------------+
543| Threat Type | Information Disclosure |
544+------------------------+-------------------+----------------+----------------+
545| Application | Server | IoT | Mobile |
546+------------------------+-------------------+----------------+----------------+
547| Impact | Critical (5) | Critical (5) | Critical (5) |
548+------------------------+-------------------+----------------+----------------+
549| Likelihood | Medium (3) | Medium (3) | Medium (3) |
550+------------------------+-------------------+----------------+----------------+
551| Total Risk Rating | High (15) | High (15) | High (15) |
552+------------------------+-------------------+----------------+----------------+
553| Mitigations | Clear the sensitive data from internal buffers as |
554| | soon as they are not needed anymore. |
555+------------------------+-----------------------------------------------------+
556| Mitigations | | Yes / Platform specific |
Sandrine Bailleux348446a2023-10-11 08:27:43 +0200557| implemented? | |
558+------------------------+-----------------------------------------------------+
559
560
561+------------------------+-----------------------------------------------------+
562| ID | 15 |
563+========================+=====================================================+
564| Threat | | **Improper handling of input data received over |
565| | a UART interface may allow an attacker to tamper |
566| | with TF-A execution environment.** |
567| | |
568| | | The consequences of the attack depend on the |
569| | the exact usage of input data received over UART. |
570| | Examples are injection of arbitrary data, |
571| | sensitive data tampering, influencing the |
572| | execution path, denial of service (if using |
573| | blocking I/O). This list may not be exhaustive. |
574+------------------------+-----------------------------------------------------+
575| Diagram Elements | DF2, DF4, DF5 |
576+------------------------+-----------------------------------------------------+
577| Affected TF-A | BL1, BL2, BL31 |
578| Components | |
579+------------------------+-----------------------------------------------------+
580| Assets | Sensitive Data, Code Execution, Availability |
581+------------------------+-----------------------------------------------------+
582| Threat Agent | NSCode, SecCode |
583+------------------------+-----------------------------------------------------+
584| Threat Type | Tampering, Information Disclosure, Denial of |
585| | service, Elevation of privilege. |
586+------------------------+-------------------+----------------+----------------+
587| Application | Server | IoT | Mobile |
588+------------------------+-------------------+----------------+----------------+
589| Impact | Critical (5) | Critical (5) | Critical (5) |
590+------------------------+-------------------+----------------+----------------+
591| Likelihood | Critical (5) | Critical (5) | Critical (5) |
592+------------------------+-------------------+----------------+----------------+
593| Total Risk Rating | Critical (25) | Critical (25) | Critical (25) |
594+------------------------+-------------------+----------------+----------------+
595| Mitigations | | By default, the code to read input data from UART |
596| | interfaces is disabled (see `ENABLE_CONSOLE_GETC` |
597| | build option). It should only be enabled on a |
598| | need basis. |
599| | |
600| | | Data received over UART interfaces should be |
601| | treated as untrusted data. As such, it should be |
602| | properly sanitized and handled with caution. |
603+------------------------+-----------------------------------------------------+
604| Mitigations | | Platform specific. |
605| implemented? | |
606| | | Generic code does not read any input data from |
607| | UART interface(s). |
Sandrine Bailleuxa1e121b2023-08-21 14:28:54 +0200608+------------------------+-----------------------------------------------------+
609
610
611Threats to be Mitigated by the Boot Firmware
612--------------------------------------------
613
614The boot firmware here refers to the boot ROM (BL1) and the trusted boot
615firmware (BL2). Typically it does not stay resident in memory and it is
616dismissed once execution has reached the runtime EL3 firmware (BL31). Thus, past
617that point in time, the threats below can no longer be exploited.
618
619Note, however, that this is not necessarily true on all platforms. Platform
620vendors should review these threats to make sure they cannot be exploited
621nonetheless once execution has reached the runtime EL3 firmware.
622
623+------------------------+----------------------------------------------------+
624| ID | 01 |
625+========================+====================================================+
626| Threat | | **An attacker can mangle firmware images to |
627| | execute arbitrary code** |
628| | |
629| | | Some TF-A images are loaded from external |
630| | storage. It is possible for an attacker to access|
631| | the external flash memory and change its contents|
632| | physically, through the Rich OS, or using the |
633| | updating mechanism to modify the non-volatile |
634| | images to execute arbitrary code. |
635+------------------------+----------------------------------------------------+
636| Diagram Elements | DF1, DF4, DF5 |
637+------------------------+----------------------------------------------------+
638| Affected TF-A | BL2, BL31 |
639| Components | |
640+------------------------+----------------------------------------------------+
641| Assets | Code Execution |
642+------------------------+----------------------------------------------------+
643| Threat Agent | PhysicalAccess, NSCode, SecCode |
644+------------------------+----------------------------------------------------+
645| Threat Type | Tampering, Elevation of Privilege |
646+------------------------+------------------+-----------------+---------------+
647| Application | Server | IoT | Mobile |
648+------------------------+------------------+-----------------+---------------+
649| Impact | Critical (5) | Critical (5) | Critical (5) |
650+------------------------+------------------+-----------------+---------------+
651| Likelihood | Critical (5) | Critical (5) | Critical (5) |
652+------------------------+------------------+-----------------+---------------+
653| Total Risk Rating | Critical (25) | Critical (25) | Critical (25) |
654+------------------------+------------------+-----------------+---------------+
655| Mitigations | | 1) Implement the `Trusted Board Boot (TBB)`_ |
656| | feature which prevents malicious firmware from |
657| | running on the platform by authenticating all |
658| | firmware images. |
659| | |
660| | | 2) Perform extra checks on unauthenticated data, |
661| | such as FIP metadata, prior to use. |
662+------------------------+----------------------------------------------------+
663| Mitigations | | 1) Yes, provided that the ``TRUSTED_BOARD_BOOT`` |
664| implemented? | build option is set to 1. |
665| | |
666| | | 2) Yes. |
667+------------------------+----------------------------------------------------+
668
669+------------------------+----------------------------------------------------+
670| ID | 02 |
671+========================+====================================================+
672| Threat | | **An attacker may attempt to boot outdated, |
673| | potentially vulnerable firmware image** |
674| | |
675| | | When updating firmware, an attacker may attempt |
676| | to rollback to an older version that has unfixed |
677| | vulnerabilities. |
678+------------------------+----------------------------------------------------+
679| Diagram Elements | DF1, DF4, DF5 |
680+------------------------+----------------------------------------------------+
681| Affected TF-A | BL2, BL31 |
682| Components | |
683+------------------------+----------------------------------------------------+
684| Assets | Code Execution |
685+------------------------+----------------------------------------------------+
686| Threat Agent | PhysicalAccess, NSCode, SecCode |
687+------------------------+----------------------------------------------------+
688| Threat Type | Tampering |
689+------------------------+------------------+-----------------+---------------+
690| Application | Server | IoT | Mobile |
691+------------------------+------------------+-----------------+---------------+
692| Impact | Critical (5) | Critical (5) | Critical (5) |
693+------------------------+------------------+-----------------+---------------+
694| Likelihood | Critical (5) | Critical (5) | Critical (5) |
695+------------------------+------------------+-----------------+---------------+
696| Total Risk Rating | Critical (25) | Critical (25) | Critical (25) |
697+------------------------+------------------+-----------------+---------------+
698| Mitigations | Implement anti-rollback protection using |
699| | non-volatile counters (NV counters) as required |
700| | by `TBBR-Client specification`_. |
701+------------------------+----------------------------------------------------+
702| Mitigations | | Yes / Platform specific. |
703| implemented? | |
704| | | After a firmware image is validated, the image |
705| | revision number taken from a certificate |
706| | extension field is compared with the |
707| | corresponding NV counter stored in hardware to |
708| | make sure the new counter value is larger than |
709| | the current counter value. |
710| | |
711| | | **Platforms must implement this protection using |
712| | platform specific hardware NV counters.** |
713+------------------------+----------------------------------------------------+
714
715
716+------------------------+-------------------------------------------------------+
717| ID | 03 |
718+========================+=======================================================+
719| Threat | | **An attacker can use Time-of-Check-Time-of-Use |
720| | (TOCTOU) attack to bypass image authentication |
721| | during the boot process** |
722| | |
723| | | Time-of-Check-Time-of-Use (TOCTOU) threats occur |
724| | when the security check is produced before the time |
725| | the resource is accessed. If an attacker is sitting |
726| | in the middle of the off-chip images, they could |
727| | change the binary containing executable code right |
728| | after the integrity and authentication check has |
729| | been performed. |
730+------------------------+-------------------------------------------------------+
731| Diagram Elements | DF1 |
732+------------------------+-------------------------------------------------------+
733| Affected TF-A | BL1, BL2 |
734| Components | |
735+------------------------+-------------------------------------------------------+
736| Assets | Code Execution, Sensitive Data |
737+------------------------+-------------------------------------------------------+
738| Threat Agent | PhysicalAccess |
739+------------------------+-------------------------------------------------------+
740| Threat Type | Elevation of Privilege |
741+------------------------+---------------------+-----------------+---------------+
742| Application | Server | IoT | Mobile |
743+------------------------+---------------------+-----------------+---------------+
744| Impact | N/A | Critical (5) | Critical (5) |
745+------------------------+---------------------+-----------------+---------------+
746| Likelihood | N/A | Medium (3) | Medium (3) |
747+------------------------+---------------------+-----------------+---------------+
748| Total Risk Rating | N/A | High (15) | High (15) |
749+------------------------+---------------------+-----------------+---------------+
750| Mitigations | Copy image to on-chip memory before authenticating |
751| | it. |
752+------------------------+-------------------------------------------------------+
753| Mitigations | | Platform specific. |
754| implemented? | |
755| | | The list of images to load and their location is |
756| | platform specific. Platforms are responsible for |
757| | arranging images to be loaded in on-chip memory. |
758+------------------------+-------------------------------------------------------+
759
760
761+------------------------+-------------------------------------------------------+
762| ID | 04 |
763+========================+=======================================================+
764| Threat | | **An attacker with physical access can execute |
765| | arbitrary image by bypassing the signature |
766| | verification stage using glitching techniques** |
767| | |
768| | | Glitching (Fault injection) attacks attempt to put |
769| | a hardware into a undefined state by manipulating an|
770| | environmental variable such as power supply. |
771| | |
772| | | TF-A relies on a chain of trust that starts with the|
773| | ROTPK, which is the key stored inside the chip and |
774| | the root of all validation processes. If an attacker|
775| | can break this chain of trust, they could execute |
776| | arbitrary code on the device. This could be |
777| | achieved with physical access to the device by |
778| | attacking the normal execution flow of the |
779| | process using glitching techniques that target |
780| | points where the image is validated against the |
781| | signature. |
782+------------------------+-------------------------------------------------------+
783| Diagram Elements | DF1 |
784+------------------------+-------------------------------------------------------+
785| Affected TF-A | BL1, BL2 |
786| Components | |
787+------------------------+-------------------------------------------------------+
788| Assets | Code Execution |
789+------------------------+-------------------------------------------------------+
790| Threat Agent | PhysicalAccess |
791+------------------------+-------------------------------------------------------+
792| Threat Type | Tampering, Elevation of Privilege |
793+------------------------+---------------------+-----------------+---------------+
794| Application | Server | IoT | Mobile |
795+------------------------+---------------------+-----------------+---------------+
796| Impact | N/A | Critical (5) | Critical (5) |
797+------------------------+---------------------+-----------------+---------------+
798| Likelihood | N/A | Medium (3) | Medium (3) |
799+------------------------+---------------------+-----------------+---------------+
800| Total Risk Rating | N/A | High (15) | High (15) |
801+------------------------+---------------------+-----------------+---------------+
802| Mitigations | Mechanisms to detect clock glitch and power |
803| | variations. |
804+------------------------+-------------------------------------------------------+
805| Mitigations | | No. |
806| implemented? | |
807| | | The most effective mitigation is adding glitching |
808| | detection and mitigation circuit at the hardware |
809| | level. |
810| | |
811| | | However, software techniques, such as adding |
812| | redundant checks when performing conditional |
813| | branches that are security sensitive, can be used |
814| | to harden TF-A against such attacks. |
815| | **At the moment TF-A doesn't implement such |
816| | mitigations.** |
817+------------------------+-------------------------------------------------------+
818
819.. topic:: Measured Boot Threats (or lack of)
820
821 In the current Measured Boot design, BL1, BL2, and BL31, as well as the
822 secure world components, form the |SRTM|. Measurement data is currently
823 considered an asset to be protected against attack, and this is achieved
824 by storing them in the Secure Memory.
825 Beyond the measurements stored inside the TCG-compliant Event Log buffer,
826 there are no other assets to protect or threats to defend against that
827 could compromise |TF-A| execution environment's security.
828
829 There are general security assets and threats associated with remote/delegated
830 attestation. However, these are outside the |TF-A| security boundary and
831 should be dealt with by the appropriate agent in the platform/system.
832 Since current Measured Boot design does not use local attestation, there would
833 be no further assets to protect(like unsealed keys).
834
835 A limitation of the current Measured Boot design is that it is dependent upon
836 Secure Boot as implementation of Measured Boot does not extend measurements
837 into a discrete |TPM|, where they would be securely stored and protected
838 against tampering. This implies that if Secure-Boot is compromised, Measured
839 Boot may also be compromised.
840
841 Platforms must carefully evaluate the security of the default implementation
842 since the |SRTM| includes all secure world components.
843
844
845Threats to be Mitigated by the Runtime EL3 Firmware
846---------------------------------------------------
847
848+------------------------+------------------------------------------------------+
849| ID | 07 |
850+========================+======================================================+
851| Threat | | **An attacker can perform a denial-of-service |
852| | attack by using a broken SMC call that causes the |
853| | system to reboot or enter into unknown state.** |
854| | |
855| | | Secure and non-secure clients access TF-A services |
856| | through SMC calls. Malicious code can attempt to |
857| | place the TF-A runtime into an inconsistent state |
858| | by calling unimplemented SMC call or by passing |
859| | invalid arguments. |
860+------------------------+------------------------------------------------------+
861| Diagram Elements | DF4, DF5 |
862+------------------------+------------------------------------------------------+
863| Affected TF-A | BL31 |
864| Components | |
865+------------------------+------------------------------------------------------+
866| Assets | Availability |
867+------------------------+------------------------------------------------------+
868| Threat Agent | NSCode, SecCode |
869+------------------------+------------------------------------------------------+
870| Threat Type | Denial of Service |
871+------------------------+-------------------+----------------+-----------------+
872| Application | Server | IoT | Mobile |
873+------------------------+-------------------+----------------+-----------------+
874| Impact | Medium (3) | Medium (3) | Medium (3) |
875+------------------------+-------------------+----------------+-----------------+
876| Likelihood | High (4) | High (4) | High (4) |
877+------------------------+-------------------+----------------+-----------------+
878| Total Risk Rating | High (12) | High (12) | High (12) |
879+------------------------+-------------------+----------------+-----------------+
880| Mitigations | Validate SMC function ids and arguments before using |
881| | them. |
882+------------------------+------------------------------------------------------+
883| Mitigations | | Yes / Platform specific. |
884| implemented? | |
885| | | For standard services, all input is validated. |
886| | |
887| | | Platforms that implement SiP services must also |
888| | validate SMC call arguments. |
889+------------------------+------------------------------------------------------+
890
891
Zelalem7006f202021-02-24 19:20:09 -0600892+------------------------+------------------------------------------------------+
893| ID | 09 |
894+========================+======================================================+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200895| Threat | | **Improperly handled SMC calls can leak register |
Zelalem7006f202021-02-24 19:20:09 -0600896| | contents** |
897| | |
Sandrine Bailleux3d6cc212022-05-12 16:37:18 +0200898| | | When switching between worlds, TF-A register state |
899| | can leak to software in different security |
900| | contexts. |
Zelalem7006f202021-02-24 19:20:09 -0600901+------------------------+------------------------------------------------------+
Sandrine Bailleux3d6cc212022-05-12 16:37:18 +0200902| Diagram Elements | DF4, DF5 |
Zelalem7006f202021-02-24 19:20:09 -0600903+------------------------+------------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200904| Affected TF-A | BL31 |
905| Components | |
Zelalem7006f202021-02-24 19:20:09 -0600906+------------------------+------------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200907| Assets | Sensitive Data |
Zelalem7006f202021-02-24 19:20:09 -0600908+------------------------+------------------------------------------------------+
Sandrine Bailleux3d6cc212022-05-12 16:37:18 +0200909| Threat Agent | NSCode, SecCode |
Zelalem7006f202021-02-24 19:20:09 -0600910+------------------------+------------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200911| Threat Type | Information Disclosure |
Zelalem7006f202021-02-24 19:20:09 -0600912+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200913| Application | Server | IoT | Mobile |
Zelalem7006f202021-02-24 19:20:09 -0600914+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200915| Impact | Medium (3) | Medium (3) | Medium (3) |
Zelalem7006f202021-02-24 19:20:09 -0600916+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200917| Likelihood | High (4) | High (4) | High (4) |
Zelalem7006f202021-02-24 19:20:09 -0600918+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200919| Total Risk Rating | High (12) | High (12) | High (12) |
Zelalem7006f202021-02-24 19:20:09 -0600920+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleux7e32cdb2022-05-13 12:39:56 +0200921| Mitigations | Save and restore registers when switching contexts. |
922+------------------------+------------------------------------------------------+
923| Mitigations | | Yes. |
924| implemented? | |
925| | | This is the default behaviour in TF-A. |
926| | Build options are also provided to save/restore |
927| | additional registers such as floating-point |
928| | registers. These should be enabled if required. |
Zelalem7006f202021-02-24 19:20:09 -0600929+------------------------+------------------------------------------------------+
930
931+------------------------+-----------------------------------------------------+
932| ID | 10 |
933+========================+=====================================================+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200934| Threat | | **SMC calls can leak sensitive information from |
Zelalem7006f202021-02-24 19:20:09 -0600935| | TF-A memory via microarchitectural side channels**|
936| | |
937| | | Microarchitectural side-channel attacks such as |
938| | `Spectre`_ can be used to leak data across |
939| | security boundaries. An attacker might attempt to |
940| | use this kind of attack to leak sensitive |
941| | data from TF-A memory. |
942+------------------------+-----------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200943| Diagram Elements | DF4, DF5 |
Zelalem7006f202021-02-24 19:20:09 -0600944+------------------------+-----------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200945| Affected TF-A | BL31 |
946| Components | |
Zelalem7006f202021-02-24 19:20:09 -0600947+------------------------+-----------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200948| Assets | Sensitive Data |
Zelalem7006f202021-02-24 19:20:09 -0600949+------------------------+-----------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200950| Threat Agent | SecCode, NSCode |
Zelalem7006f202021-02-24 19:20:09 -0600951+------------------------+-----------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200952| Threat Type | Information Disclosure |
Zelalem7006f202021-02-24 19:20:09 -0600953+------------------------+-------------------+----------------+----------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200954| Application | Server | IoT | Mobile |
Zelalem7006f202021-02-24 19:20:09 -0600955+------------------------+-------------------+----------------+----------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200956| Impact | Medium (3) | Medium (3) | Medium (3) |
Zelalem7006f202021-02-24 19:20:09 -0600957+------------------------+-------------------+----------------+----------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200958| Likelihood | Medium (3) | Medium (3) | Medium (3) |
Zelalem7006f202021-02-24 19:20:09 -0600959+------------------------+-------------------+----------------+----------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200960| Total Risk Rating | Medium (9) | Medium (9) | Medium (9) |
Zelalem7006f202021-02-24 19:20:09 -0600961+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux7e32cdb2022-05-13 12:39:56 +0200962| Mitigations | Enable appropriate side-channel protections. |
963+------------------------+-----------------------------------------------------+
964| Mitigations | | Yes / Platform specific. |
965| implemented? | |
966| | | TF-A implements software mitigations for Spectre |
Zelalem7006f202021-02-24 19:20:09 -0600967| | type attacks as recommended by `Cache Speculation |
Sandrine Bailleux7e32cdb2022-05-13 12:39:56 +0200968| | Side-channels`_ for the generic code. |
969| | |
970| | | SiPs should implement similar mitigations for |
971| | code that is deemed to be vulnerable to such |
972| | attacks. |
Zelalem7006f202021-02-24 19:20:09 -0600973+------------------------+-----------------------------------------------------+
974
Zelalem7006f202021-02-24 19:20:09 -0600975
976+------------------------+-----------------------------------------------------+
977| ID | 12 |
978+========================+=====================================================+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200979| Threat | | **Incorrect configuration of Performance Monitor |
Zelalem7006f202021-02-24 19:20:09 -0600980| | Unit (PMU) counters can allow an attacker to |
981| | mount side-channel attacks using information |
982| | exposed by the counters** |
983| | |
984| | | Non-secure software can configure PMU registers |
985| | to count events at any exception level and in |
986| | both Secure and Non-secure states. This allows |
987| | a Non-secure software (or a lower-level Secure |
Sandrine Bailleux7e32cdb2022-05-13 12:39:56 +0200988| | software) to potentially carry out |
Zelalem7006f202021-02-24 19:20:09 -0600989| | side-channel timing attacks against TF-A. |
990+------------------------+-----------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200991| Diagram Elements | DF5, DF6 |
Zelalem7006f202021-02-24 19:20:09 -0600992+------------------------+-----------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200993| Affected TF-A | BL31 |
994| Components | |
Zelalem7006f202021-02-24 19:20:09 -0600995+------------------------+-----------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200996| Assets | Sensitive Data |
Zelalem7006f202021-02-24 19:20:09 -0600997+------------------------+-----------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +0200998| Threat Agent | NSCode |
Zelalem7006f202021-02-24 19:20:09 -0600999+------------------------+-----------------------------------------------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +02001000| Threat Type | Information Disclosure |
Zelalem7006f202021-02-24 19:20:09 -06001001+------------------------+-------------------+----------------+----------------+
Tamas Ban1fba1a82022-11-30 17:06:05 +01001002| Application | Server | IoT | Mobile |
1003+------------------------+-------------------+----------------+----------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +02001004| Impact | Medium (3) | Medium (3) | Medium (3) |
Zelalem7006f202021-02-24 19:20:09 -06001005+------------------------+-------------------+----------------+----------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +02001006| Likelihood | Low (2) | Low (2) | Low (2) |
Zelalem7006f202021-02-24 19:20:09 -06001007+------------------------+-------------------+----------------+----------------+
Sandrine Bailleuxf10dd3e2022-05-10 14:55:01 +02001008| Total Risk Rating | Medium (6) | Medium (6) | Medium (6) |
Zelalem7006f202021-02-24 19:20:09 -06001009+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux7e32cdb2022-05-13 12:39:56 +02001010| Mitigations | Follow mitigation strategies as described in |
1011| | `Secure Development Guidelines`_. |
1012+------------------------+-----------------------------------------------------+
1013| Mitigations | | Yes / platform specific. |
1014| implemented? | |
1015| | | General events and cycle counting in the Secure |
1016| | world is prohibited by default when applicable. |
1017| | |
1018| | | However, on some implementations (e.g. PMUv3) |
1019| | Secure world event counting depends on external |
1020| | debug interface signals, i.e. Secure world event |
1021| | counting is enabled if external debug is enabled. |
1022| | |
1023| | | Configuration of debug signals is platform |
Zelalem7006f202021-02-24 19:20:09 -06001024| | specific, therefore platforms need to make sure |
1025| | that external debug is disabled in production or |
Sandrine Bailleux7e32cdb2022-05-13 12:39:56 +02001026| | proper debug authentication is in place. This |
1027| | should be the case if threat #06 is properly |
1028| | mitigated. |
Zelalem7006f202021-02-24 19:20:09 -06001029+------------------------+-----------------------------------------------------+
1030
Sandrine Bailleuxa1e121b2023-08-21 14:28:54 +02001031
1032Threats to be Mitigated by an External Agent Outside of TF-A
1033------------------------------------------------------------
Tamas Ban1fba1a82022-11-30 17:06:05 +01001034
Jeffrey Kardatzke05c69cf2022-10-03 15:50:21 -07001035+------------------------+-----------------------------------------------------+
1036| ID | 14 |
1037+========================+=====================================================+
Jeffrey Kardatzke8d7c80f2023-02-09 11:03:17 -08001038| Threat | | **Attacker wants to execute an arbitrary or |
1039| | untrusted binary as the secure OS.** |
Jeffrey Kardatzke05c69cf2022-10-03 15:50:21 -07001040| | |
Jeffrey Kardatzke8d7c80f2023-02-09 11:03:17 -08001041| | | When the option OPTEE_ALLOW_SMC_LOAD is enabled, |
1042| | this trusts the non-secure world up until the |
1043| | point it issues the SMC call to load the Secure |
1044| | BL32 payload. If a compromise occurs before the |
1045| | SMC call is invoked, then arbitrary code execution|
1046| | in S-EL1 can occur or arbitrary memory in EL3 can |
1047| | be overwritten. |
Jeffrey Kardatzke05c69cf2022-10-03 15:50:21 -07001048+------------------------+-----------------------------------------------------+
1049| Diagram Elements | DF5 |
1050+------------------------+-----------------------------------------------------+
1051| Affected TF-A | BL31, BL32 |
1052| Components | |
1053+------------------------+-----------------------------------------------------+
1054| Assets | Code Execution, Sensitive Data |
1055+------------------------+-----------------------------------------------------+
1056| Threat Agent | NSCode |
1057+------------------------+-----------------------------------------------------+
1058| Threat Type | Tampering, Information Disclosure, |
1059| | Elevation of privilege |
1060+------------------------+-----------------+-----------------+-----------------+
1061| Application | Server | IoT | Mobile |
1062+------------------------+-----------------+-----------------+-----------------+
1063| Impact | Critical (5) | Critical (5) | Critical (5) |
1064+------------------------+-----------------+-----------------+-----------------+
Jeffrey Kardatzke8d7c80f2023-02-09 11:03:17 -08001065| Likelihood | High (4) | High (4) | High (4) |
Jeffrey Kardatzke05c69cf2022-10-03 15:50:21 -07001066+------------------------+-----------------+-----------------+-----------------+
Jeffrey Kardatzke8d7c80f2023-02-09 11:03:17 -08001067| Total Risk Rating | Critical (20) | Critical (20) | Critical (20) |
Jeffrey Kardatzke05c69cf2022-10-03 15:50:21 -07001068+------------------------+-----------------+-----------------+-----------------+
1069| Mitigations | When enabling the option OPTEE_ALLOW_SMC_LOAD, |
1070| | the non-secure OS must be considered a closed |
1071| | platform up until the point the SMC can be invoked |
1072| | to load OP-TEE. |
1073+------------------------+-----------------------------------------------------+
1074| Mitigations | | None in TF-A itself. This option is only used by |
1075| implemented? | ChromeOS currently which has other mechanisms to |
1076| | to mitigate this threat which are described in |
1077| | `OP-TEE Dispatcher`_. |
1078+------------------------+-----------------------------------------------------+
1079
Zelalem7006f202021-02-24 19:20:09 -06001080--------------
1081
Jeffrey Kardatzke05c69cf2022-10-03 15:50:21 -07001082*Copyright (c) 2021-2023, Arm Limited. All rights reserved.*
Zelalem7006f202021-02-24 19:20:09 -06001083
1084
1085.. _STRIDE threat analysis technique: https://docs.microsoft.com/en-us/azure/security/develop/threat-modeling-tool-threats#stride-model
1086.. _DEN0034: https://developer.arm.com/documentation/den0034/latest
1087.. _Cache Speculation Side-channels: https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability
1088.. _Spectre: https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability
1089.. _TBBR-Client specification: https://developer.arm.com/documentation/den0006/d/
1090.. _Trusted Board Boot (TBB): https://trustedfirmware-a.readthedocs.io/en/latest/design/trusted-board-boot.html
1091.. _TF-A error handling policy: https://trustedfirmware-a.readthedocs.io/en/latest/process/coding-guidelines.html#error-handling-and-robustness
1092.. _Secure Development Guidelines: https://trustedfirmware-a.readthedocs.io/en/latest/process/security-hardening.html#secure-development-guidelines
Olivier Deprez3af9b3f2021-06-01 15:37:16 +02001093.. _Trusted Firmware-A Tests: https://git.trustedfirmware.org/TF-A/tf-a-tests.git/about/
Jeffrey Kardatzke05c69cf2022-10-03 15:50:21 -07001094.. _OP-TEE Dispatcher: https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/components/spd/optee-dispatcher.rst