blob: c50ed8e8c684e54bd7f77bc434b28c56542cc194 [file] [log] [blame]
Gary Morrisond4d951a2021-11-10 14:40:15 -06001Generic Threat Model
Olivier Deprez86d1ffd2021-06-01 15:37:16 +02002********************
Zelalem05fed522021-02-24 19:20:09 -06003
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +02004************
Olivier Deprez86d1ffd2021-06-01 15:37:16 +02005Introduction
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +02006************
7
Olivier Deprez86d1ffd2021-06-01 15:37:16 +02008This document provides a generic threat model for TF-A firmware.
Zelalem05fed522021-02-24 19:20:09 -06009
Sandrine Bailleux522185b2023-08-21 14:28:54 +020010.. _Target of Evaluation:
11
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +020012********************
Zelalem05fed522021-02-24 19:20:09 -060013Target of Evaluation
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +020014********************
15
Zelalem05fed522021-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 Aweke023b1a42021-10-21 13:59:45 -050029
Zelalem05fed522021-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 Aweke023b1a42021-10-21 13:59:45 -050032
Zelalem05fed522021-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 Bailleuxe26ef3c2023-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 Bailleux78cdfdd2022-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 Badarkhe9d971222023-04-03 13:50:59 +010042
Zelalem05fed522021-02-24 19:20:09 -060043Data Flow Diagram
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +020044=================
45
Zelalem05fed522021-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 Bailleux6e5c2182022-05-10 14:55:01 +020061 | DF1 | | At boot time, images are loaded from non-volatile |
Zelalem05fed522021-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 Bailleux6e5c2182022-05-10 14:55:01 +020066 | DF2 | | TF-A log system framework outputs debug messages |
Zelalem05fed522021-02-24 19:20:09 -060067 | | over a UART interface. |
68 +-----------------+--------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +020069 | DF3 | | Debug and trace IP on a platform can allow access |
Zelalem05fed522021-02-24 19:20:09 -060070 | | to registers and memory of TF-A. |
71 +-----------------+--------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +020072 | DF4 | | Secure world software (e.g. trusted OS) interact |
Zelalem05fed522021-02-24 19:20:09 -060073 | | with TF-A through SMC call interface and/or shared |
74 | | memory. |
75 +-----------------+--------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +020076 | DF5 | | Non-secure world software (e.g. rich OS) interact |
Zelalem05fed522021-02-24 19:20:09 -060077 | | with TF-A through SMC call interface and/or shared |
78 | | memory. |
79 +-----------------+--------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +020080 | DF6 | | This path represents the interaction between TF-A and|
Zelalem05fed522021-02-24 19:20:09 -060081 | | various hardware IPs such as TrustZone controller |
82 | | and GIC. At boot time TF-A configures/initializes the|
83 | | IPs and interacts with them at runtime through |
84 | | interrupts and registers. |
85 +-----------------+--------------------------------------------------------+
86
87
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +020088***************
Zelalem05fed522021-02-24 19:20:09 -060089Threat Analysis
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +020090***************
91
Zelalem05fed522021-02-24 19:20:09 -060092In this section we identify and provide assessment of potential threats to TF-A
93firmware. The threats are identified for each diagram element on the
94data flow diagram above.
95
96For each threat, we identify the *asset* that is under threat, the
97*threat agent* and the *threat type*. Each threat is given a *risk rating*
98that represents the impact and likelihood of that threat. We also discuss
99potential mitigations.
100
101Assets
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200102======
103
Zelalem05fed522021-02-24 19:20:09 -0600104We have identified the following assets for TF-A:
105
106.. table:: Table 2: TF-A Assets
107
108 +--------------------+---------------------------------------------------+
109 | Asset | Description |
110 +====================+===================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200111 | Sensitive Data | | These include sensitive data that an attacker |
Zelalem05fed522021-02-24 19:20:09 -0600112 | | must not be able to tamper with (e.g. the Root |
113 | | of Trust Public Key) or see (e.g. secure logs, |
114 | | debugging information such as crash reports). |
115 +--------------------+---------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200116 | Code Execution | | This represents the requirement that the |
Zelalem05fed522021-02-24 19:20:09 -0600117 | | platform should run only TF-A code approved by |
118 | | the platform provider. |
119 +--------------------+---------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200120 | Availability | | This represents the requirement that TF-A |
Zelalem05fed522021-02-24 19:20:09 -0600121 | | services should always be available for use. |
122 +--------------------+---------------------------------------------------+
123
124Threat Agents
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200125=============
126
Zelalem05fed522021-02-24 19:20:09 -0600127To understand the attack surface, it is important to identify potential
128attackers, i.e. attack entry points. The following threat agents are
129in scope of this threat model.
130
131.. table:: Table 3: Threat Agents
132
133 +-------------------+-------------------------------------------------------+
134 | Threat Agent | Description |
135 +===================+=======================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200136 | NSCode | | Malicious or faulty code running in the Non-secure |
Zelalem05fed522021-02-24 19:20:09 -0600137 | | world, including NS-EL0 NS-EL1 and NS-EL2 levels |
138 +-------------------+-------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200139 | SecCode | | Malicious or faulty code running in the secure |
Zelalem05fed522021-02-24 19:20:09 -0600140 | | world, including S-EL0 and S-EL1 levels |
141 +-------------------+-------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200142 | AppDebug | | Physical attacker using debug signals to access |
Zelalem05fed522021-02-24 19:20:09 -0600143 | | TF-A resources |
144 +-------------------+-------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200145 | PhysicalAccess | | Physical attacker having access to external device |
Zelalem05fed522021-02-24 19:20:09 -0600146 | | communication bus and to external flash |
147 | | communication bus using common hardware |
148 +-------------------+-------------------------------------------------------+
149
150.. note::
151
152 In this threat model an advanced physical attacker that has the capability
153 to tamper with a hardware (e.g. "rewiring" a chip using a focused
154 ion beam (FIB) workstation or decapsulate the chip using chemicals) is
155 considered out-of-scope.
156
157Threat Types
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200158============
159
Zelalem05fed522021-02-24 19:20:09 -0600160In this threat model we categorize threats using the `STRIDE threat
161analysis technique`_. In this technique a threat is categorized as one
162or more of these types: ``Spoofing``, ``Tampering``, ``Repudiation``,
163``Information disclosure``, ``Denial of service`` or
164``Elevation of privilege``.
165
166Threat Risk Ratings
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200167===================
168
Zelalem05fed522021-02-24 19:20:09 -0600169For each threat identified, a risk rating that ranges
170from *informational* to *critical* is given based on the likelihood of the
Tamas Bancf151b72022-11-30 17:06:05 +0100171threat occurring if a mitigation is not in place, and the impact of the
Zelalem05fed522021-02-24 19:20:09 -0600172threat (i.e. how severe the consequences could be). Table 4 explains each
173rating in terms of score, impact and likelihood.
174
175.. table:: Table 4: Rating and score as applied to impact and likelihood
176
177 +-----------------------+-------------------------+---------------------------+
178 | **Rating (Score)** | **Impact** | **Likelihood** |
179 +=======================+=========================+===========================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200180 | Critical (5) | | Extreme impact to | | Threat is almost |
Zelalem05fed522021-02-24 19:20:09 -0600181 | | entire organization | certain to be exploited.|
182 | | if exploited. | |
183 | | | | Knowledge of the threat |
184 | | | and how to exploit it |
185 | | | are in the public |
186 | | | domain. |
187 +-----------------------+-------------------------+---------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200188 | High (4) | | Major impact to entire| | Threat is relatively |
Zelalem05fed522021-02-24 19:20:09 -0600189 | | organization or single| easy to detect and |
190 | | line of business if | exploit by an attacker |
191 | | exploited | with little skill. |
192 +-----------------------+-------------------------+---------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200193 | Medium (3) | | Noticeable impact to | | A knowledgeable insider |
Zelalem05fed522021-02-24 19:20:09 -0600194 | | line of business if | or expert attacker could|
195 | | exploited. | exploit the threat |
196 | | | without much difficulty.|
197 +-----------------------+-------------------------+---------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200198 | Low (2) | | Minor damage if | | Exploiting the threat |
Zelalem05fed522021-02-24 19:20:09 -0600199 | | exploited or could | would require |
200 | | be used in conjunction| considerable expertise |
201 | | with other | and resources |
202 | | vulnerabilities to | |
203 | | perform a more serious| |
204 | | attack | |
205 +-----------------------+-------------------------+---------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200206 | Informational (1) | | Poor programming | | Threat is not likely |
Zelalem05fed522021-02-24 19:20:09 -0600207 | | practice or poor | to be exploited on its |
208 | | design decision that | own, but may be used to |
209 | | may not represent an | gain information for |
210 | | immediate risk on its | launching another |
211 | | own, but may have | attack |
212 | | security implications | |
213 | | if multiplied and/or | |
214 | | combined with other | |
215 | | threats. | |
216 +-----------------------+-------------------------+---------------------------+
217
218Aggregate risk scores are assigned to identified threats;
219specifically, the impact score multiplied by the likelihood score.
220For example, a threat with high likelihood and low impact would have an
221aggregate risk score of eight (8); that is, four (4) for high likelihood
222multiplied by two (2) for low impact. The aggregate risk score determines
223the finding's overall risk level, as shown in the following table.
224
225.. table:: Table 5: Overall risk levels and corresponding aggregate scores
226
227 +---------------------+-----------------------------------+
228 | Overall Risk Level | Aggregate Risk Score |
229 | | (Impact multiplied by Likelihood) |
230 +=====================+===================================+
231 | Critical | 20–25 |
232 +---------------------+-----------------------------------+
233 | High | 12–19 |
234 +---------------------+-----------------------------------+
235 | Medium | 6–11 |
236 +---------------------+-----------------------------------+
237 | Low | 2–5 |
238 +---------------------+-----------------------------------+
239 | Informational | 1 |
240 +---------------------+-----------------------------------+
241
242The likelihood and impact of a threat depends on the
243target environment in which TF-A is running. For example, attacks
244that require physical access are unlikely in server environments while
245they are more common in Internet of Things(IoT) environments.
246In this threat model we consider three target environments:
247``Internet of Things(IoT)``, ``Mobile`` and ``Server``.
248
249Threat Assessment
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200250=================
251
Zelalem05fed522021-02-24 19:20:09 -0600252The following threats were identified by applying STRIDE analysis on
253each diagram element of the data flow diagram.
254
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200255For each threat, we strive to indicate whether the mitigations are currently
256implemented or not. However, the answer to this question is not always straight
257forward. Some mitigations are partially implemented in the generic code but also
258rely on the platform code to implement some bits of it. This threat model aims
259to be platform-independent and it is important to keep in mind that such threats
260only get mitigated if the platform code properly fulfills its responsibilities.
261
262Also, some mitigations require enabling specific features, which must be
263explicitly turned on via a build flag.
264
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200265When such conditions must be met, these are highlighted in the ``Mitigations
266implemented?`` box.
Zelalem05fed522021-02-24 19:20:09 -0600267
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200268As our :ref:`Target of Evaluation` is made of several, distinct firmware images,
269some threats are confined in specific images, while others apply to each of
270them. To help developers implement mitigations in the right place, threats below
271are categorized based on the firmware image that should mitigate them.
Zelalem05fed522021-02-24 19:20:09 -0600272
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200273General Threats for All Firmware Images
274---------------------------------------
Zelalem05fed522021-02-24 19:20:09 -0600275
276+------------------------+---------------------------------------------------+
277| ID | 05 |
278+========================+===================================================+
Sandrine Bailleuxb8d854d2022-05-16 13:57:38 +0200279| Threat | | **Information leak via UART logs** |
Zelalem05fed522021-02-24 19:20:09 -0600280| | |
281| | | During the development stages of software it is |
Sandrine Bailleuxb8d854d2022-05-16 13:57:38 +0200282| | common to print all sorts of information on the |
283| | console, including sensitive or confidential |
284| | information such as crash reports with detailed |
285| | information of the CPU state, current registers |
286| | values, privilege level or stack dumps. |
287| | |
288| | | This information is useful when debugging |
289| | problems before releasing the production |
290| | version but it could be used by an attacker |
291| | to develop a working exploit if left enabled in |
292| | the production version. |
293| | |
294| | | This happens when directly logging sensitive |
295| | information and more subtly when logging |
296| | side-channel information that can be used by an |
297| | attacker to learn about sensitive information. |
Zelalem05fed522021-02-24 19:20:09 -0600298+------------------------+---------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200299| Diagram Elements | DF2 |
Zelalem05fed522021-02-24 19:20:09 -0600300+------------------------+---------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200301| Affected TF-A | BL1, BL2, BL31 |
302| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600303+------------------------+---------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200304| Assets | Sensitive Data |
Zelalem05fed522021-02-24 19:20:09 -0600305+------------------------+---------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200306| Threat Agent | AppDebug |
Zelalem05fed522021-02-24 19:20:09 -0600307+------------------------+---------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200308| Threat Type | Information Disclosure |
Zelalem05fed522021-02-24 19:20:09 -0600309+------------------------+------------------+----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200310| Application | Server | IoT | Mobile |
Zelalem05fed522021-02-24 19:20:09 -0600311+------------------------+------------------+----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200312| Impact | N/A | Low (2) | Low (2) |
Zelalem05fed522021-02-24 19:20:09 -0600313+------------------------+------------------+----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200314| Likelihood | N/A | High (4) | High (4) |
Zelalem05fed522021-02-24 19:20:09 -0600315+------------------------+------------------+----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200316| Total Risk Rating | N/A | Medium (8) | Medium (8) |
Zelalem05fed522021-02-24 19:20:09 -0600317+------------------------+------------------+----------------+---------------+
Sandrine Bailleuxb8d854d2022-05-16 13:57:38 +0200318| Mitigations | | Remove sensitive information logging in |
319| | production releases. |
320| | |
321| | | Do not conditionally log information depending |
322| | on potentially sensitive data. |
323| | |
324| | | Do not log high precision timing information. |
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200325+------------------------+---------------------------------------------------+
326| Mitigations | | Yes / Platform Specific. |
327| implemented? | Requires the right build options to be used. |
328| | |
329| | | Crash reporting is only enabled for debug |
330| | builds by default, see ``CRASH_REPORTING`` |
331| | build option. |
332| | |
333| | | The log level can be tuned at build time, from |
334| | very verbose to no output at all. See |
335| | ``LOG_LEVEL`` build option. By default, release |
336| | builds are a lot less verbose than debug ones |
337| | but still produce some output. |
338| | |
339| | | Messages produced by the platform code should |
340| | use the appropriate level of verbosity so as |
341| | not to leak sensitive information in production |
342| | builds. |
Zelalem05fed522021-02-24 19:20:09 -0600343+------------------------+---------------------------------------------------+
344
345+------------------------+----------------------------------------------------+
346| ID | 06 |
347+========================+====================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200348| Threat | | **An attacker can read sensitive data and |
Zelalem05fed522021-02-24 19:20:09 -0600349| | execute arbitrary code through the external |
350| | debug and trace interface** |
351| | |
352| | | Arm processors include hardware-assisted debug |
353| | and trace features that can be controlled without|
354| | the need for software operating on the platform. |
355| | If left enabled without authentication, this |
356| | feature can be used by an attacker to inspect and|
357| | modify TF-A registers and memory allowing the |
358| | attacker to read sensitive data and execute |
359| | arbitrary code. |
360+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200361| Diagram Elements | DF3 |
Zelalem05fed522021-02-24 19:20:09 -0600362+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200363| Affected TF-A | BL1, BL2, BL31 |
364| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600365+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200366| Assets | Code Execution, Sensitive Data |
Zelalem05fed522021-02-24 19:20:09 -0600367+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200368| Threat Agent | AppDebug |
Zelalem05fed522021-02-24 19:20:09 -0600369+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200370| Threat Type | Tampering, Information Disclosure, |
Zelalem05fed522021-02-24 19:20:09 -0600371| | Elevation of privilege |
372+------------------------+------------------+---------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200373| Application | Server | IoT | Mobile |
Zelalem05fed522021-02-24 19:20:09 -0600374+------------------------+------------------+---------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200375| Impact | N/A | High (4) | High (4) |
Zelalem05fed522021-02-24 19:20:09 -0600376+------------------------+------------------+---------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200377| Likelihood | N/A | Critical (5) | Critical (5) |
Zelalem05fed522021-02-24 19:20:09 -0600378+------------------------+------------------+---------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200379| Total Risk Rating | N/A | Critical (20) | Critical (20) |
Zelalem05fed522021-02-24 19:20:09 -0600380+------------------------+------------------+---------------+-----------------+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200381| Mitigations | Disable the debug and trace capability for |
382| | production releases or enable proper debug |
383| | authentication as recommended by [`DEN0034`_]. |
384+------------------------+----------------------------------------------------+
385| Mitigations | | Platform specific. |
386| implemented? | |
387| | | Configuration of debug and trace capabilities is |
388| | entirely platform specific. |
Zelalem05fed522021-02-24 19:20:09 -0600389+------------------------+----------------------------------------------------+
390
391+------------------------+------------------------------------------------------+
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200392| ID | 08 |
Zelalem05fed522021-02-24 19:20:09 -0600393+========================+======================================================+
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200394| Threat | | **Memory corruption due to memory overflows and |
395| | lack of boundary checking when accessing resources |
396| | could allow an attacker to execute arbitrary code, |
397| | modify some state variable to change the normal |
398| | flow of the program, or leak sensitive |
399| | information** |
Zelalem05fed522021-02-24 19:20:09 -0600400| | |
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200401| | | Like in other software, TF-A has multiple points |
402| | where memory corruption security errors can arise. |
403| | |
404| | | Some of the errors include integer overflow, |
405| | buffer overflow, incorrect array boundary checks, |
406| | and incorrect error management. |
407| | Improper use of asserts instead of proper input |
408| | validations might also result in these kinds of |
409| | errors in release builds. |
Zelalem05fed522021-02-24 19:20:09 -0600410+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200411| Diagram Elements | DF4, DF5 |
Zelalem05fed522021-02-24 19:20:09 -0600412+------------------------+------------------------------------------------------+
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200413| Affected TF-A | BL1, BL2, BL31 |
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200414| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600415+------------------------+------------------------------------------------------+
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200416| Assets | Code Execution, Sensitive Data |
Zelalem05fed522021-02-24 19:20:09 -0600417+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200418| Threat Agent | NSCode, SecCode |
Zelalem05fed522021-02-24 19:20:09 -0600419+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200420| Threat Type | Tampering, Information Disclosure, |
Zelalem05fed522021-02-24 19:20:09 -0600421| | Elevation of Privilege |
422+------------------------+-------------------+-----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200423| Application | Server | IoT | Mobile |
Zelalem05fed522021-02-24 19:20:09 -0600424+------------------------+-------------------+-----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200425| Impact | Critical (5) | Critical (5) | Critical (5) |
Zelalem05fed522021-02-24 19:20:09 -0600426+------------------------+-------------------+-----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200427| Likelihood | Medium (3 | Medium (3) | Medium (3) |
Zelalem05fed522021-02-24 19:20:09 -0600428+------------------------+-------------------+-----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200429| Total Risk Rating | High (15) | High (15) | High (15) |
Zelalem05fed522021-02-24 19:20:09 -0600430+------------------------+-------------------+-----------------+----------------+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200431| Mitigations | | 1) Use proper input validation. |
Zelalem05fed522021-02-24 19:20:09 -0600432| | |
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200433| | | 2) Code reviews, testing. |
434+------------------------+------------------------------------------------------+
435| Mitigations | | 1) Yes. |
436| implemented? | Data received from normal world, such as addresses |
Zelalem05fed522021-02-24 19:20:09 -0600437| | and sizes identifying memory regions, are |
438| | sanitized before being used. These security checks |
439| | make sure that the normal world software does not |
440| | access memory beyond its limit. |
441| | |
442| | | By default *asserts* are only used to check for |
443| | programming errors in debug builds. Other types of |
444| | errors are handled through condition checks that |
445| | remain enabled in release builds. See |
446| | `TF-A error handling policy`_. TF-A provides an |
447| | option to use *asserts* in release builds, however |
448| | we recommend using proper runtime checks instead |
449| | of relying on asserts in release builds. |
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200450| | |
451| | | 2) Yes. |
452| | TF-A uses a combination of manual code reviews |
453| | and automated program analysis and testing to |
454| | detect and fix memory corruption bugs. All TF-A |
455| | code including platform code go through manual |
456| | code reviews. Additionally, static code analysis |
457| | is performed using Coverity Scan on all TF-A code. |
458| | The code is also tested with |
459| | `Trusted Firmware-A Tests`_ on Juno and FVP |
460| | platforms. |
Zelalem05fed522021-02-24 19:20:09 -0600461+------------------------+------------------------------------------------------+
462
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200463
464+------------------------+----------------------------------------------------+
465| ID | 11 |
466+========================+====================================================+
467| Threat | | **Misconfiguration of the Memory Management Unit |
468| | (MMU) may allow a normal world software to |
469| | access sensitive data, execute arbitrary |
470| | code or access otherwise restricted HW |
471| | interface** |
472| | |
473| | | A misconfiguration of the MMU could |
474| | lead to an open door for software running in the |
475| | normal world to access sensitive data or even |
476| | execute code if the proper security mechanisms |
477| | are not in place. |
478+------------------------+----------------------------------------------------+
479| Diagram Elements | DF5, DF6 |
480+------------------------+----------------------------------------------------+
481| Affected TF-A | BL1, BL2, BL31 |
482| Components | |
483+------------------------+----------------------------------------------------+
484| Assets | Sensitive Data, Code execution |
485+------------------------+----------------------------------------------------+
486| Threat Agent | NSCode |
487+------------------------+----------------------------------------------------+
488| Threat Type | Information Disclosure, Elevation of Privilege |
489+------------------------+-----------------+-----------------+----------------+
490| Application | Server | IoT | Mobile |
491+------------------------+-----------------+-----------------+----------------+
492| Impact | Critical (5) | Critical (5) | Critical (5) |
493+------------------------+-----------------+-----------------+----------------+
494| Likelihood | High (4) | High (4) | High (4) |
495+------------------------+-----------------+-----------------+----------------+
496| Total Risk Rating | Critical (20) | Critical (20) | Critical (20) |
497+------------------------+-----------------+-----------------+----------------+
498| Mitigations | When configuring access permissions, the |
499| | principle of least privilege ought to be |
500| | enforced. This means we should not grant more |
501| | privileges than strictly needed, e.g. code |
502| | should be read-only executable, read-only data |
503| | should be read-only execute-never, and so on. |
504+------------------------+----------------------------------------------------+
505| Mitigations | | Platform specific. |
506| implemented? | |
507| | | MMU configuration is platform specific, |
508| | therefore platforms need to make sure that the |
509| | correct attributes are assigned to memory |
510| | regions. |
511| | |
512| | | TF-A provides a library which abstracts the |
513| | low-level details of MMU configuration. It |
514| | provides well-defined and tested APIs. |
515| | Platforms are encouraged to use it to limit the |
516| | risk of misconfiguration. |
517+------------------------+----------------------------------------------------+
518
519
520+------------------------+-----------------------------------------------------+
521| ID | 13 |
522+========================+=====================================================+
523| Threat | | **Leaving sensitive information in the memory, |
524| | can allow an attacker to retrieve them.** |
525| | |
526| | | Accidentally leaving not-needed sensitive data in |
527| | internal buffers can leak them if an attacker |
528| | gains access to memory due to a vulnerability. |
529+------------------------+-----------------------------------------------------+
530| Diagram Elements | DF4, DF5 |
531+------------------------+-----------------------------------------------------+
532| Affected TF-A | BL1, BL2, BL31 |
533| Components | |
534+------------------------+-----------------------------------------------------+
535| Assets | Sensitive Data |
536+------------------------+-----------------------------------------------------+
537| Threat Agent | NSCode, SecCode |
538+------------------------+-----------------------------------------------------+
539| Threat Type | Information Disclosure |
540+------------------------+-------------------+----------------+----------------+
541| Application | Server | IoT | Mobile |
542+------------------------+-------------------+----------------+----------------+
543| Impact | Critical (5) | Critical (5) | Critical (5) |
544+------------------------+-------------------+----------------+----------------+
545| Likelihood | Medium (3) | Medium (3) | Medium (3) |
546+------------------------+-------------------+----------------+----------------+
547| Total Risk Rating | High (15) | High (15) | High (15) |
548+------------------------+-------------------+----------------+----------------+
549| Mitigations | Clear the sensitive data from internal buffers as |
550| | soon as they are not needed anymore. |
551+------------------------+-----------------------------------------------------+
552| Mitigations | | Yes / Platform specific |
553+------------------------+-----------------------------------------------------+
554
555
556Threats to be Mitigated by the Boot Firmware
557--------------------------------------------
558
559The boot firmware here refers to the boot ROM (BL1) and the trusted boot
560firmware (BL2). Typically it does not stay resident in memory and it is
561dismissed once execution has reached the runtime EL3 firmware (BL31). Thus, past
562that point in time, the threats below can no longer be exploited.
563
564Note, however, that this is not necessarily true on all platforms. Platform
565vendors should review these threats to make sure they cannot be exploited
566nonetheless once execution has reached the runtime EL3 firmware.
567
568+------------------------+----------------------------------------------------+
569| ID | 01 |
570+========================+====================================================+
571| Threat | | **An attacker can mangle firmware images to |
572| | execute arbitrary code** |
573| | |
574| | | Some TF-A images are loaded from external |
575| | storage. It is possible for an attacker to access|
576| | the external flash memory and change its contents|
577| | physically, through the Rich OS, or using the |
578| | updating mechanism to modify the non-volatile |
579| | images to execute arbitrary code. |
580+------------------------+----------------------------------------------------+
581| Diagram Elements | DF1, DF4, DF5 |
582+------------------------+----------------------------------------------------+
583| Affected TF-A | BL2, BL31 |
584| Components | |
585+------------------------+----------------------------------------------------+
586| Assets | Code Execution |
587+------------------------+----------------------------------------------------+
588| Threat Agent | PhysicalAccess, NSCode, SecCode |
589+------------------------+----------------------------------------------------+
590| Threat Type | Tampering, Elevation of Privilege |
591+------------------------+------------------+-----------------+---------------+
592| Application | Server | IoT | Mobile |
593+------------------------+------------------+-----------------+---------------+
594| Impact | Critical (5) | Critical (5) | Critical (5) |
595+------------------------+------------------+-----------------+---------------+
596| Likelihood | Critical (5) | Critical (5) | Critical (5) |
597+------------------------+------------------+-----------------+---------------+
598| Total Risk Rating | Critical (25) | Critical (25) | Critical (25) |
599+------------------------+------------------+-----------------+---------------+
600| Mitigations | | 1) Implement the `Trusted Board Boot (TBB)`_ |
601| | feature which prevents malicious firmware from |
602| | running on the platform by authenticating all |
603| | firmware images. |
604| | |
605| | | 2) Perform extra checks on unauthenticated data, |
606| | such as FIP metadata, prior to use. |
607+------------------------+----------------------------------------------------+
608| Mitigations | | 1) Yes, provided that the ``TRUSTED_BOARD_BOOT`` |
609| implemented? | build option is set to 1. |
610| | |
611| | | 2) Yes. |
612+------------------------+----------------------------------------------------+
613
614+------------------------+----------------------------------------------------+
615| ID | 02 |
616+========================+====================================================+
617| Threat | | **An attacker may attempt to boot outdated, |
618| | potentially vulnerable firmware image** |
619| | |
620| | | When updating firmware, an attacker may attempt |
621| | to rollback to an older version that has unfixed |
622| | vulnerabilities. |
623+------------------------+----------------------------------------------------+
624| Diagram Elements | DF1, DF4, DF5 |
625+------------------------+----------------------------------------------------+
626| Affected TF-A | BL2, BL31 |
627| Components | |
628+------------------------+----------------------------------------------------+
629| Assets | Code Execution |
630+------------------------+----------------------------------------------------+
631| Threat Agent | PhysicalAccess, NSCode, SecCode |
632+------------------------+----------------------------------------------------+
633| Threat Type | Tampering |
634+------------------------+------------------+-----------------+---------------+
635| Application | Server | IoT | Mobile |
636+------------------------+------------------+-----------------+---------------+
637| Impact | Critical (5) | Critical (5) | Critical (5) |
638+------------------------+------------------+-----------------+---------------+
639| Likelihood | Critical (5) | Critical (5) | Critical (5) |
640+------------------------+------------------+-----------------+---------------+
641| Total Risk Rating | Critical (25) | Critical (25) | Critical (25) |
642+------------------------+------------------+-----------------+---------------+
643| Mitigations | Implement anti-rollback protection using |
644| | non-volatile counters (NV counters) as required |
645| | by `TBBR-Client specification`_. |
646+------------------------+----------------------------------------------------+
647| Mitigations | | Yes / Platform specific. |
648| implemented? | |
649| | | After a firmware image is validated, the image |
650| | revision number taken from a certificate |
651| | extension field is compared with the |
652| | corresponding NV counter stored in hardware to |
653| | make sure the new counter value is larger than |
654| | the current counter value. |
655| | |
656| | | **Platforms must implement this protection using |
657| | platform specific hardware NV counters.** |
658+------------------------+----------------------------------------------------+
659
660
661+------------------------+-------------------------------------------------------+
662| ID | 03 |
663+========================+=======================================================+
664| Threat | | **An attacker can use Time-of-Check-Time-of-Use |
665| | (TOCTOU) attack to bypass image authentication |
666| | during the boot process** |
667| | |
668| | | Time-of-Check-Time-of-Use (TOCTOU) threats occur |
669| | when the security check is produced before the time |
670| | the resource is accessed. If an attacker is sitting |
671| | in the middle of the off-chip images, they could |
672| | change the binary containing executable code right |
673| | after the integrity and authentication check has |
674| | been performed. |
675+------------------------+-------------------------------------------------------+
676| Diagram Elements | DF1 |
677+------------------------+-------------------------------------------------------+
678| Affected TF-A | BL1, BL2 |
679| Components | |
680+------------------------+-------------------------------------------------------+
681| Assets | Code Execution, Sensitive Data |
682+------------------------+-------------------------------------------------------+
683| Threat Agent | PhysicalAccess |
684+------------------------+-------------------------------------------------------+
685| Threat Type | Elevation of Privilege |
686+------------------------+---------------------+-----------------+---------------+
687| Application | Server | IoT | Mobile |
688+------------------------+---------------------+-----------------+---------------+
689| Impact | N/A | Critical (5) | Critical (5) |
690+------------------------+---------------------+-----------------+---------------+
691| Likelihood | N/A | Medium (3) | Medium (3) |
692+------------------------+---------------------+-----------------+---------------+
693| Total Risk Rating | N/A | High (15) | High (15) |
694+------------------------+---------------------+-----------------+---------------+
695| Mitigations | Copy image to on-chip memory before authenticating |
696| | it. |
697+------------------------+-------------------------------------------------------+
698| Mitigations | | Platform specific. |
699| implemented? | |
700| | | The list of images to load and their location is |
701| | platform specific. Platforms are responsible for |
702| | arranging images to be loaded in on-chip memory. |
703+------------------------+-------------------------------------------------------+
704
705
706+------------------------+-------------------------------------------------------+
707| ID | 04 |
708+========================+=======================================================+
709| Threat | | **An attacker with physical access can execute |
710| | arbitrary image by bypassing the signature |
711| | verification stage using glitching techniques** |
712| | |
713| | | Glitching (Fault injection) attacks attempt to put |
714| | a hardware into a undefined state by manipulating an|
715| | environmental variable such as power supply. |
716| | |
717| | | TF-A relies on a chain of trust that starts with the|
718| | ROTPK, which is the key stored inside the chip and |
719| | the root of all validation processes. If an attacker|
720| | can break this chain of trust, they could execute |
721| | arbitrary code on the device. This could be |
722| | achieved with physical access to the device by |
723| | attacking the normal execution flow of the |
724| | process using glitching techniques that target |
725| | points where the image is validated against the |
726| | signature. |
727+------------------------+-------------------------------------------------------+
728| Diagram Elements | DF1 |
729+------------------------+-------------------------------------------------------+
730| Affected TF-A | BL1, BL2 |
731| Components | |
732+------------------------+-------------------------------------------------------+
733| Assets | Code Execution |
734+------------------------+-------------------------------------------------------+
735| Threat Agent | PhysicalAccess |
736+------------------------+-------------------------------------------------------+
737| Threat Type | Tampering, Elevation of Privilege |
738+------------------------+---------------------+-----------------+---------------+
739| Application | Server | IoT | Mobile |
740+------------------------+---------------------+-----------------+---------------+
741| Impact | N/A | Critical (5) | Critical (5) |
742+------------------------+---------------------+-----------------+---------------+
743| Likelihood | N/A | Medium (3) | Medium (3) |
744+------------------------+---------------------+-----------------+---------------+
745| Total Risk Rating | N/A | High (15) | High (15) |
746+------------------------+---------------------+-----------------+---------------+
747| Mitigations | Mechanisms to detect clock glitch and power |
748| | variations. |
749+------------------------+-------------------------------------------------------+
750| Mitigations | | No. |
751| implemented? | |
752| | | The most effective mitigation is adding glitching |
753| | detection and mitigation circuit at the hardware |
754| | level. |
755| | |
756| | | However, software techniques, such as adding |
757| | redundant checks when performing conditional |
758| | branches that are security sensitive, can be used |
759| | to harden TF-A against such attacks. |
760| | **At the moment TF-A doesn't implement such |
761| | mitigations.** |
762+------------------------+-------------------------------------------------------+
763
764.. topic:: Measured Boot Threats (or lack of)
765
766 In the current Measured Boot design, BL1, BL2, and BL31, as well as the
767 secure world components, form the |SRTM|. Measurement data is currently
768 considered an asset to be protected against attack, and this is achieved
769 by storing them in the Secure Memory.
770 Beyond the measurements stored inside the TCG-compliant Event Log buffer,
771 there are no other assets to protect or threats to defend against that
772 could compromise |TF-A| execution environment's security.
773
774 There are general security assets and threats associated with remote/delegated
775 attestation. However, these are outside the |TF-A| security boundary and
776 should be dealt with by the appropriate agent in the platform/system.
777 Since current Measured Boot design does not use local attestation, there would
778 be no further assets to protect(like unsealed keys).
779
780 A limitation of the current Measured Boot design is that it is dependent upon
781 Secure Boot as implementation of Measured Boot does not extend measurements
782 into a discrete |TPM|, where they would be securely stored and protected
783 against tampering. This implies that if Secure-Boot is compromised, Measured
784 Boot may also be compromised.
785
786 Platforms must carefully evaluate the security of the default implementation
787 since the |SRTM| includes all secure world components.
788
789
790Threats to be Mitigated by the Runtime EL3 Firmware
791---------------------------------------------------
792
Zelalem05fed522021-02-24 19:20:09 -0600793+------------------------+------------------------------------------------------+
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200794| ID | 07 |
795+========================+======================================================+
796| Threat | | **An attacker can perform a denial-of-service |
797| | attack by using a broken SMC call that causes the |
798| | system to reboot or enter into unknown state.** |
799| | |
800| | | Secure and non-secure clients access TF-A services |
801| | through SMC calls. Malicious code can attempt to |
802| | place the TF-A runtime into an inconsistent state |
803| | by calling unimplemented SMC call or by passing |
804| | invalid arguments. |
805+------------------------+------------------------------------------------------+
806| Diagram Elements | DF4, DF5 |
807+------------------------+------------------------------------------------------+
808| Affected TF-A | BL31 |
809| Components | |
810+------------------------+------------------------------------------------------+
811| Assets | Availability |
812+------------------------+------------------------------------------------------+
813| Threat Agent | NSCode, SecCode |
814+------------------------+------------------------------------------------------+
815| Threat Type | Denial of Service |
816+------------------------+-------------------+----------------+-----------------+
817| Application | Server | IoT | Mobile |
818+------------------------+-------------------+----------------+-----------------+
819| Impact | Medium (3) | Medium (3) | Medium (3) |
820+------------------------+-------------------+----------------+-----------------+
821| Likelihood | High (4) | High (4) | High (4) |
822+------------------------+-------------------+----------------+-----------------+
823| Total Risk Rating | High (12) | High (12) | High (12) |
824+------------------------+-------------------+----------------+-----------------+
825| Mitigations | Validate SMC function ids and arguments before using |
826| | them. |
827+------------------------+------------------------------------------------------+
828| Mitigations | | Yes / Platform specific. |
829| implemented? | |
830| | | For standard services, all input is validated. |
831| | |
832| | | Platforms that implement SiP services must also |
833| | validate SMC call arguments. |
834+------------------------+------------------------------------------------------+
835
836
837+------------------------+------------------------------------------------------+
Zelalem05fed522021-02-24 19:20:09 -0600838| ID | 09 |
839+========================+======================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200840| Threat | | **Improperly handled SMC calls can leak register |
Zelalem05fed522021-02-24 19:20:09 -0600841| | contents** |
842| | |
Sandrine Bailleux1c7d74e2022-05-12 16:37:18 +0200843| | | When switching between worlds, TF-A register state |
844| | can leak to software in different security |
845| | contexts. |
Zelalem05fed522021-02-24 19:20:09 -0600846+------------------------+------------------------------------------------------+
Sandrine Bailleux1c7d74e2022-05-12 16:37:18 +0200847| Diagram Elements | DF4, DF5 |
Zelalem05fed522021-02-24 19:20:09 -0600848+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200849| Affected TF-A | BL31 |
850| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600851+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200852| Assets | Sensitive Data |
Zelalem05fed522021-02-24 19:20:09 -0600853+------------------------+------------------------------------------------------+
Sandrine Bailleux1c7d74e2022-05-12 16:37:18 +0200854| Threat Agent | NSCode, SecCode |
Zelalem05fed522021-02-24 19:20:09 -0600855+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200856| Threat Type | Information Disclosure |
Zelalem05fed522021-02-24 19:20:09 -0600857+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200858| Application | Server | IoT | Mobile |
Zelalem05fed522021-02-24 19:20:09 -0600859+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200860| Impact | Medium (3) | Medium (3) | Medium (3) |
Zelalem05fed522021-02-24 19:20:09 -0600861+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200862| Likelihood | High (4) | High (4) | High (4) |
Zelalem05fed522021-02-24 19:20:09 -0600863+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200864| Total Risk Rating | High (12) | High (12) | High (12) |
Zelalem05fed522021-02-24 19:20:09 -0600865+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200866| Mitigations | Save and restore registers when switching contexts. |
867+------------------------+------------------------------------------------------+
868| Mitigations | | Yes. |
869| implemented? | |
870| | | This is the default behaviour in TF-A. |
871| | Build options are also provided to save/restore |
872| | additional registers such as floating-point |
873| | registers. These should be enabled if required. |
Zelalem05fed522021-02-24 19:20:09 -0600874+------------------------+------------------------------------------------------+
875
876+------------------------+-----------------------------------------------------+
877| ID | 10 |
878+========================+=====================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200879| Threat | | **SMC calls can leak sensitive information from |
Zelalem05fed522021-02-24 19:20:09 -0600880| | TF-A memory via microarchitectural side channels**|
881| | |
882| | | Microarchitectural side-channel attacks such as |
883| | `Spectre`_ can be used to leak data across |
884| | security boundaries. An attacker might attempt to |
885| | use this kind of attack to leak sensitive |
886| | data from TF-A memory. |
887+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200888| Diagram Elements | DF4, DF5 |
Zelalem05fed522021-02-24 19:20:09 -0600889+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200890| Affected TF-A | BL31 |
891| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600892+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200893| Assets | Sensitive Data |
Zelalem05fed522021-02-24 19:20:09 -0600894+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200895| Threat Agent | SecCode, NSCode |
Zelalem05fed522021-02-24 19:20:09 -0600896+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200897| Threat Type | Information Disclosure |
Zelalem05fed522021-02-24 19:20:09 -0600898+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200899| Application | Server | IoT | Mobile |
Zelalem05fed522021-02-24 19:20:09 -0600900+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200901| Impact | Medium (3) | Medium (3) | Medium (3) |
Zelalem05fed522021-02-24 19:20:09 -0600902+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200903| Likelihood | Medium (3) | Medium (3) | Medium (3) |
Zelalem05fed522021-02-24 19:20:09 -0600904+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200905| Total Risk Rating | Medium (9) | Medium (9) | Medium (9) |
Zelalem05fed522021-02-24 19:20:09 -0600906+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200907| Mitigations | Enable appropriate side-channel protections. |
908+------------------------+-----------------------------------------------------+
909| Mitigations | | Yes / Platform specific. |
910| implemented? | |
911| | | TF-A implements software mitigations for Spectre |
Zelalem05fed522021-02-24 19:20:09 -0600912| | type attacks as recommended by `Cache Speculation |
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200913| | Side-channels`_ for the generic code. |
914| | |
915| | | SiPs should implement similar mitigations for |
916| | code that is deemed to be vulnerable to such |
917| | attacks. |
Zelalem05fed522021-02-24 19:20:09 -0600918+------------------------+-----------------------------------------------------+
919
Zelalem05fed522021-02-24 19:20:09 -0600920
921+------------------------+-----------------------------------------------------+
922| ID | 12 |
923+========================+=====================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200924| Threat | | **Incorrect configuration of Performance Monitor |
Zelalem05fed522021-02-24 19:20:09 -0600925| | Unit (PMU) counters can allow an attacker to |
926| | mount side-channel attacks using information |
927| | exposed by the counters** |
928| | |
929| | | Non-secure software can configure PMU registers |
930| | to count events at any exception level and in |
931| | both Secure and Non-secure states. This allows |
932| | a Non-secure software (or a lower-level Secure |
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200933| | software) to potentially carry out |
Zelalem05fed522021-02-24 19:20:09 -0600934| | side-channel timing attacks against TF-A. |
935+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200936| Diagram Elements | DF5, DF6 |
Zelalem05fed522021-02-24 19:20:09 -0600937+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200938| Affected TF-A | BL31 |
939| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600940+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200941| Assets | Sensitive Data |
Zelalem05fed522021-02-24 19:20:09 -0600942+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200943| Threat Agent | NSCode |
Zelalem05fed522021-02-24 19:20:09 -0600944+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200945| Threat Type | Information Disclosure |
Zelalem05fed522021-02-24 19:20:09 -0600946+------------------------+-------------------+----------------+----------------+
Tamas Bancf151b72022-11-30 17:06:05 +0100947| Application | Server | IoT | Mobile |
948+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200949| Impact | Medium (3) | Medium (3) | Medium (3) |
Zelalem05fed522021-02-24 19:20:09 -0600950+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200951| Likelihood | Low (2) | Low (2) | Low (2) |
Zelalem05fed522021-02-24 19:20:09 -0600952+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200953| Total Risk Rating | Medium (6) | Medium (6) | Medium (6) |
Zelalem05fed522021-02-24 19:20:09 -0600954+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200955| Mitigations | Follow mitigation strategies as described in |
956| | `Secure Development Guidelines`_. |
957+------------------------+-----------------------------------------------------+
958| Mitigations | | Yes / platform specific. |
959| implemented? | |
960| | | General events and cycle counting in the Secure |
961| | world is prohibited by default when applicable. |
962| | |
963| | | However, on some implementations (e.g. PMUv3) |
964| | Secure world event counting depends on external |
965| | debug interface signals, i.e. Secure world event |
966| | counting is enabled if external debug is enabled. |
967| | |
968| | | Configuration of debug signals is platform |
Zelalem05fed522021-02-24 19:20:09 -0600969| | specific, therefore platforms need to make sure |
970| | that external debug is disabled in production or |
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200971| | proper debug authentication is in place. This |
972| | should be the case if threat #06 is properly |
973| | mitigated. |
Zelalem05fed522021-02-24 19:20:09 -0600974+------------------------+-----------------------------------------------------+
975
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200976
977Threats to be Mitigated by an External Agent Outside of TF-A
978------------------------------------------------------------
Tamas Bancf151b72022-11-30 17:06:05 +0100979
Jeffrey Kardatzke7e6b09a2022-10-03 15:50:21 -0700980+------------------------+-----------------------------------------------------+
981| ID | 14 |
982+========================+=====================================================+
Jeffrey Kardatzkeab7e5572023-02-09 11:03:17 -0800983| Threat | | **Attacker wants to execute an arbitrary or |
984| | untrusted binary as the secure OS.** |
Jeffrey Kardatzke7e6b09a2022-10-03 15:50:21 -0700985| | |
Jeffrey Kardatzkeab7e5572023-02-09 11:03:17 -0800986| | | When the option OPTEE_ALLOW_SMC_LOAD is enabled, |
987| | this trusts the non-secure world up until the |
988| | point it issues the SMC call to load the Secure |
989| | BL32 payload. If a compromise occurs before the |
990| | SMC call is invoked, then arbitrary code execution|
991| | in S-EL1 can occur or arbitrary memory in EL3 can |
992| | be overwritten. |
Jeffrey Kardatzke7e6b09a2022-10-03 15:50:21 -0700993+------------------------+-----------------------------------------------------+
994| Diagram Elements | DF5 |
995+------------------------+-----------------------------------------------------+
996| Affected TF-A | BL31, BL32 |
997| Components | |
998+------------------------+-----------------------------------------------------+
999| Assets | Code Execution, Sensitive Data |
1000+------------------------+-----------------------------------------------------+
1001| Threat Agent | NSCode |
1002+------------------------+-----------------------------------------------------+
1003| Threat Type | Tampering, Information Disclosure, |
1004| | Elevation of privilege |
1005+------------------------+-----------------+-----------------+-----------------+
1006| Application | Server | IoT | Mobile |
1007+------------------------+-----------------+-----------------+-----------------+
1008| Impact | Critical (5) | Critical (5) | Critical (5) |
1009+------------------------+-----------------+-----------------+-----------------+
Jeffrey Kardatzkeab7e5572023-02-09 11:03:17 -08001010| Likelihood | High (4) | High (4) | High (4) |
Jeffrey Kardatzke7e6b09a2022-10-03 15:50:21 -07001011+------------------------+-----------------+-----------------+-----------------+
Jeffrey Kardatzkeab7e5572023-02-09 11:03:17 -08001012| Total Risk Rating | Critical (20) | Critical (20) | Critical (20) |
Jeffrey Kardatzke7e6b09a2022-10-03 15:50:21 -07001013+------------------------+-----------------+-----------------+-----------------+
1014| Mitigations | When enabling the option OPTEE_ALLOW_SMC_LOAD, |
1015| | the non-secure OS must be considered a closed |
1016| | platform up until the point the SMC can be invoked |
1017| | to load OP-TEE. |
1018+------------------------+-----------------------------------------------------+
1019| Mitigations | | None in TF-A itself. This option is only used by |
1020| implemented? | ChromeOS currently which has other mechanisms to |
1021| | to mitigate this threat which are described in |
1022| | `OP-TEE Dispatcher`_. |
1023+------------------------+-----------------------------------------------------+
1024
Zelalem05fed522021-02-24 19:20:09 -06001025--------------
1026
Jeffrey Kardatzke7e6b09a2022-10-03 15:50:21 -07001027*Copyright (c) 2021-2023, Arm Limited. All rights reserved.*
Zelalem05fed522021-02-24 19:20:09 -06001028
1029
1030.. _STRIDE threat analysis technique: https://docs.microsoft.com/en-us/azure/security/develop/threat-modeling-tool-threats#stride-model
1031.. _DEN0034: https://developer.arm.com/documentation/den0034/latest
1032.. _Cache Speculation Side-channels: https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability
1033.. _Spectre: https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability
1034.. _TBBR-Client specification: https://developer.arm.com/documentation/den0006/d/
1035.. _Trusted Board Boot (TBB): https://trustedfirmware-a.readthedocs.io/en/latest/design/trusted-board-boot.html
1036.. _TF-A error handling policy: https://trustedfirmware-a.readthedocs.io/en/latest/process/coding-guidelines.html#error-handling-and-robustness
1037.. _Secure Development Guidelines: https://trustedfirmware-a.readthedocs.io/en/latest/process/security-hardening.html#secure-development-guidelines
Olivier Deprez86d1ffd2021-06-01 15:37:16 +02001038.. _Trusted Firmware-A Tests: https://git.trustedfirmware.org/TF-A/tf-a-tests.git/about/
Jeffrey Kardatzke7e6b09a2022-10-03 15:50:21 -07001039.. _OP-TEE Dispatcher: https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/components/spd/optee-dispatcher.rst