blob: 57a5e1b81429cc8ff8d9e9a4956adb1fc26e75a2 [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
Thaddeus Serna8709cc92023-08-14 13:28:59 -050088.. _threat_analysis:
89
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +020090***************
Zelalem05fed522021-02-24 19:20:09 -060091Threat Analysis
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +020092***************
93
Zelalem05fed522021-02-24 19:20:09 -060094In this section we identify and provide assessment of potential threats to TF-A
95firmware. The threats are identified for each diagram element on the
96data flow diagram above.
97
98For each threat, we identify the *asset* that is under threat, the
99*threat agent* and the *threat type*. Each threat is given a *risk rating*
100that represents the impact and likelihood of that threat. We also discuss
101potential mitigations.
102
103Assets
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200104======
105
Zelalem05fed522021-02-24 19:20:09 -0600106We have identified the following assets for TF-A:
107
108.. table:: Table 2: TF-A Assets
109
110 +--------------------+---------------------------------------------------+
111 | Asset | Description |
112 +====================+===================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200113 | Sensitive Data | | These include sensitive data that an attacker |
Zelalem05fed522021-02-24 19:20:09 -0600114 | | must not be able to tamper with (e.g. the Root |
115 | | of Trust Public Key) or see (e.g. secure logs, |
116 | | debugging information such as crash reports). |
117 +--------------------+---------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200118 | Code Execution | | This represents the requirement that the |
Zelalem05fed522021-02-24 19:20:09 -0600119 | | platform should run only TF-A code approved by |
120 | | the platform provider. |
121 +--------------------+---------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200122 | Availability | | This represents the requirement that TF-A |
Zelalem05fed522021-02-24 19:20:09 -0600123 | | services should always be available for use. |
124 +--------------------+---------------------------------------------------+
125
126Threat Agents
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200127=============
128
Zelalem05fed522021-02-24 19:20:09 -0600129To understand the attack surface, it is important to identify potential
130attackers, i.e. attack entry points. The following threat agents are
131in scope of this threat model.
132
133.. table:: Table 3: Threat Agents
134
135 +-------------------+-------------------------------------------------------+
136 | Threat Agent | Description |
137 +===================+=======================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200138 | NSCode | | Malicious or faulty code running in the Non-secure |
Zelalem05fed522021-02-24 19:20:09 -0600139 | | world, including NS-EL0 NS-EL1 and NS-EL2 levels |
140 +-------------------+-------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200141 | SecCode | | Malicious or faulty code running in the secure |
Zelalem05fed522021-02-24 19:20:09 -0600142 | | world, including S-EL0 and S-EL1 levels |
143 +-------------------+-------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200144 | AppDebug | | Physical attacker using debug signals to access |
Zelalem05fed522021-02-24 19:20:09 -0600145 | | TF-A resources |
146 +-------------------+-------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200147 | PhysicalAccess | | Physical attacker having access to external device |
Zelalem05fed522021-02-24 19:20:09 -0600148 | | communication bus and to external flash |
149 | | communication bus using common hardware |
150 +-------------------+-------------------------------------------------------+
151
152.. note::
153
154 In this threat model an advanced physical attacker that has the capability
155 to tamper with a hardware (e.g. "rewiring" a chip using a focused
156 ion beam (FIB) workstation or decapsulate the chip using chemicals) is
157 considered out-of-scope.
158
159Threat Types
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200160============
161
Zelalem05fed522021-02-24 19:20:09 -0600162In this threat model we categorize threats using the `STRIDE threat
163analysis technique`_. In this technique a threat is categorized as one
164or more of these types: ``Spoofing``, ``Tampering``, ``Repudiation``,
165``Information disclosure``, ``Denial of service`` or
166``Elevation of privilege``.
167
168Threat Risk Ratings
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200169===================
170
Zelalem05fed522021-02-24 19:20:09 -0600171For each threat identified, a risk rating that ranges
172from *informational* to *critical* is given based on the likelihood of the
Tamas Bancf151b72022-11-30 17:06:05 +0100173threat occurring if a mitigation is not in place, and the impact of the
Zelalem05fed522021-02-24 19:20:09 -0600174threat (i.e. how severe the consequences could be). Table 4 explains each
175rating in terms of score, impact and likelihood.
176
177.. table:: Table 4: Rating and score as applied to impact and likelihood
178
179 +-----------------------+-------------------------+---------------------------+
180 | **Rating (Score)** | **Impact** | **Likelihood** |
181 +=======================+=========================+===========================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200182 | Critical (5) | | Extreme impact to | | Threat is almost |
Zelalem05fed522021-02-24 19:20:09 -0600183 | | entire organization | certain to be exploited.|
184 | | if exploited. | |
185 | | | | Knowledge of the threat |
186 | | | and how to exploit it |
187 | | | are in the public |
188 | | | domain. |
189 +-----------------------+-------------------------+---------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200190 | High (4) | | Major impact to entire| | Threat is relatively |
Zelalem05fed522021-02-24 19:20:09 -0600191 | | organization or single| easy to detect and |
192 | | line of business if | exploit by an attacker |
193 | | exploited | with little skill. |
194 +-----------------------+-------------------------+---------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200195 | Medium (3) | | Noticeable impact to | | A knowledgeable insider |
Zelalem05fed522021-02-24 19:20:09 -0600196 | | line of business if | or expert attacker could|
197 | | exploited. | exploit the threat |
198 | | | without much difficulty.|
199 +-----------------------+-------------------------+---------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200200 | Low (2) | | Minor damage if | | Exploiting the threat |
Zelalem05fed522021-02-24 19:20:09 -0600201 | | exploited or could | would require |
202 | | be used in conjunction| considerable expertise |
203 | | with other | and resources |
204 | | vulnerabilities to | |
205 | | perform a more serious| |
206 | | attack | |
207 +-----------------------+-------------------------+---------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200208 | Informational (1) | | Poor programming | | Threat is not likely |
Zelalem05fed522021-02-24 19:20:09 -0600209 | | practice or poor | to be exploited on its |
210 | | design decision that | own, but may be used to |
211 | | may not represent an | gain information for |
212 | | immediate risk on its | launching another |
213 | | own, but may have | attack |
214 | | security implications | |
215 | | if multiplied and/or | |
216 | | combined with other | |
217 | | threats. | |
218 +-----------------------+-------------------------+---------------------------+
219
220Aggregate risk scores are assigned to identified threats;
221specifically, the impact score multiplied by the likelihood score.
222For example, a threat with high likelihood and low impact would have an
223aggregate risk score of eight (8); that is, four (4) for high likelihood
224multiplied by two (2) for low impact. The aggregate risk score determines
225the finding's overall risk level, as shown in the following table.
226
227.. table:: Table 5: Overall risk levels and corresponding aggregate scores
228
229 +---------------------+-----------------------------------+
230 | Overall Risk Level | Aggregate Risk Score |
231 | | (Impact multiplied by Likelihood) |
232 +=====================+===================================+
233 | Critical | 20–25 |
234 +---------------------+-----------------------------------+
235 | High | 12–19 |
236 +---------------------+-----------------------------------+
237 | Medium | 6–11 |
238 +---------------------+-----------------------------------+
239 | Low | 2–5 |
240 +---------------------+-----------------------------------+
241 | Informational | 1 |
242 +---------------------+-----------------------------------+
243
244The likelihood and impact of a threat depends on the
245target environment in which TF-A is running. For example, attacks
246that require physical access are unlikely in server environments while
247they are more common in Internet of Things(IoT) environments.
248In this threat model we consider three target environments:
249``Internet of Things(IoT)``, ``Mobile`` and ``Server``.
250
251Threat Assessment
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200252=================
253
Zelalem05fed522021-02-24 19:20:09 -0600254The following threats were identified by applying STRIDE analysis on
255each diagram element of the data flow diagram.
256
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200257For each threat, we strive to indicate whether the mitigations are currently
258implemented or not. However, the answer to this question is not always straight
259forward. Some mitigations are partially implemented in the generic code but also
260rely on the platform code to implement some bits of it. This threat model aims
261to be platform-independent and it is important to keep in mind that such threats
262only get mitigated if the platform code properly fulfills its responsibilities.
263
264Also, some mitigations require enabling specific features, which must be
265explicitly turned on via a build flag.
266
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200267When such conditions must be met, these are highlighted in the ``Mitigations
268implemented?`` box.
Zelalem05fed522021-02-24 19:20:09 -0600269
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200270As our :ref:`Target of Evaluation` is made of several, distinct firmware images,
271some threats are confined in specific images, while others apply to each of
272them. To help developers implement mitigations in the right place, threats below
273are categorized based on the firmware image that should mitigate them.
Zelalem05fed522021-02-24 19:20:09 -0600274
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200275General Threats for All Firmware Images
276---------------------------------------
Zelalem05fed522021-02-24 19:20:09 -0600277
278+------------------------+---------------------------------------------------+
279| ID | 05 |
280+========================+===================================================+
Sandrine Bailleuxb8d854d2022-05-16 13:57:38 +0200281| Threat | | **Information leak via UART logs** |
Zelalem05fed522021-02-24 19:20:09 -0600282| | |
283| | | During the development stages of software it is |
Sandrine Bailleuxb8d854d2022-05-16 13:57:38 +0200284| | common to print all sorts of information on the |
285| | console, including sensitive or confidential |
286| | information such as crash reports with detailed |
287| | information of the CPU state, current registers |
288| | values, privilege level or stack dumps. |
289| | |
290| | | This information is useful when debugging |
291| | problems before releasing the production |
292| | version but it could be used by an attacker |
293| | to develop a working exploit if left enabled in |
294| | the production version. |
295| | |
296| | | This happens when directly logging sensitive |
297| | information and more subtly when logging |
298| | side-channel information that can be used by an |
299| | attacker to learn about sensitive information. |
Zelalem05fed522021-02-24 19:20:09 -0600300+------------------------+---------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200301| Diagram Elements | DF2 |
Zelalem05fed522021-02-24 19:20:09 -0600302+------------------------+---------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200303| Affected TF-A | BL1, BL2, BL31 |
304| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600305+------------------------+---------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200306| Assets | Sensitive Data |
Zelalem05fed522021-02-24 19:20:09 -0600307+------------------------+---------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200308| Threat Agent | AppDebug |
Zelalem05fed522021-02-24 19:20:09 -0600309+------------------------+---------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200310| Threat Type | Information Disclosure |
Zelalem05fed522021-02-24 19:20:09 -0600311+------------------------+------------------+----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200312| Application | Server | IoT | Mobile |
Zelalem05fed522021-02-24 19:20:09 -0600313+------------------------+------------------+----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200314| Impact | N/A | Low (2) | Low (2) |
Zelalem05fed522021-02-24 19:20:09 -0600315+------------------------+------------------+----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200316| Likelihood | N/A | High (4) | High (4) |
Zelalem05fed522021-02-24 19:20:09 -0600317+------------------------+------------------+----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200318| Total Risk Rating | N/A | Medium (8) | Medium (8) |
Zelalem05fed522021-02-24 19:20:09 -0600319+------------------------+------------------+----------------+---------------+
Sandrine Bailleuxb8d854d2022-05-16 13:57:38 +0200320| Mitigations | | Remove sensitive information logging in |
321| | production releases. |
322| | |
323| | | Do not conditionally log information depending |
324| | on potentially sensitive data. |
325| | |
326| | | Do not log high precision timing information. |
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200327+------------------------+---------------------------------------------------+
328| Mitigations | | Yes / Platform Specific. |
329| implemented? | Requires the right build options to be used. |
330| | |
331| | | Crash reporting is only enabled for debug |
332| | builds by default, see ``CRASH_REPORTING`` |
333| | build option. |
334| | |
335| | | The log level can be tuned at build time, from |
336| | very verbose to no output at all. See |
337| | ``LOG_LEVEL`` build option. By default, release |
338| | builds are a lot less verbose than debug ones |
339| | but still produce some output. |
340| | |
341| | | Messages produced by the platform code should |
342| | use the appropriate level of verbosity so as |
343| | not to leak sensitive information in production |
344| | builds. |
Zelalem05fed522021-02-24 19:20:09 -0600345+------------------------+---------------------------------------------------+
346
347+------------------------+----------------------------------------------------+
348| ID | 06 |
349+========================+====================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200350| Threat | | **An attacker can read sensitive data and |
Zelalem05fed522021-02-24 19:20:09 -0600351| | execute arbitrary code through the external |
352| | debug and trace interface** |
353| | |
354| | | Arm processors include hardware-assisted debug |
355| | and trace features that can be controlled without|
356| | the need for software operating on the platform. |
357| | If left enabled without authentication, this |
358| | feature can be used by an attacker to inspect and|
359| | modify TF-A registers and memory allowing the |
360| | attacker to read sensitive data and execute |
361| | arbitrary code. |
362+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200363| Diagram Elements | DF3 |
Zelalem05fed522021-02-24 19:20:09 -0600364+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200365| Affected TF-A | BL1, BL2, BL31 |
366| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600367+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200368| Assets | Code Execution, Sensitive Data |
Zelalem05fed522021-02-24 19:20:09 -0600369+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200370| Threat Agent | AppDebug |
Zelalem05fed522021-02-24 19:20:09 -0600371+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200372| Threat Type | Tampering, Information Disclosure, |
Zelalem05fed522021-02-24 19:20:09 -0600373| | Elevation of privilege |
374+------------------------+------------------+---------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200375| Application | Server | IoT | Mobile |
Zelalem05fed522021-02-24 19:20:09 -0600376+------------------------+------------------+---------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200377| Impact | N/A | High (4) | High (4) |
Zelalem05fed522021-02-24 19:20:09 -0600378+------------------------+------------------+---------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200379| Likelihood | N/A | Critical (5) | Critical (5) |
Zelalem05fed522021-02-24 19:20:09 -0600380+------------------------+------------------+---------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200381| Total Risk Rating | N/A | Critical (20) | Critical (20) |
Zelalem05fed522021-02-24 19:20:09 -0600382+------------------------+------------------+---------------+-----------------+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200383| Mitigations | Disable the debug and trace capability for |
384| | production releases or enable proper debug |
385| | authentication as recommended by [`DEN0034`_]. |
386+------------------------+----------------------------------------------------+
387| Mitigations | | Platform specific. |
388| implemented? | |
389| | | Configuration of debug and trace capabilities is |
390| | entirely platform specific. |
Zelalem05fed522021-02-24 19:20:09 -0600391+------------------------+----------------------------------------------------+
392
393+------------------------+------------------------------------------------------+
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200394| ID | 08 |
Zelalem05fed522021-02-24 19:20:09 -0600395+========================+======================================================+
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200396| Threat | | **Memory corruption due to memory overflows and |
397| | lack of boundary checking when accessing resources |
398| | could allow an attacker to execute arbitrary code, |
399| | modify some state variable to change the normal |
400| | flow of the program, or leak sensitive |
401| | information** |
Zelalem05fed522021-02-24 19:20:09 -0600402| | |
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200403| | | Like in other software, TF-A has multiple points |
404| | where memory corruption security errors can arise. |
405| | |
406| | | Some of the errors include integer overflow, |
407| | buffer overflow, incorrect array boundary checks, |
408| | and incorrect error management. |
409| | Improper use of asserts instead of proper input |
410| | validations might also result in these kinds of |
411| | errors in release builds. |
Zelalem05fed522021-02-24 19:20:09 -0600412+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200413| Diagram Elements | DF4, DF5 |
Zelalem05fed522021-02-24 19:20:09 -0600414+------------------------+------------------------------------------------------+
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200415| Affected TF-A | BL1, BL2, BL31 |
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200416| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600417+------------------------+------------------------------------------------------+
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200418| Assets | Code Execution, Sensitive Data |
Zelalem05fed522021-02-24 19:20:09 -0600419+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200420| Threat Agent | NSCode, SecCode |
Zelalem05fed522021-02-24 19:20:09 -0600421+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200422| Threat Type | Tampering, Information Disclosure, |
Zelalem05fed522021-02-24 19:20:09 -0600423| | Elevation of Privilege |
424+------------------------+-------------------+-----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200425| Application | Server | IoT | Mobile |
Zelalem05fed522021-02-24 19:20:09 -0600426+------------------------+-------------------+-----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200427| Impact | Critical (5) | Critical (5) | Critical (5) |
Zelalem05fed522021-02-24 19:20:09 -0600428+------------------------+-------------------+-----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200429| Likelihood | Medium (3 | Medium (3) | Medium (3) |
Zelalem05fed522021-02-24 19:20:09 -0600430+------------------------+-------------------+-----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200431| Total Risk Rating | High (15) | High (15) | High (15) |
Zelalem05fed522021-02-24 19:20:09 -0600432+------------------------+-------------------+-----------------+----------------+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200433| Mitigations | | 1) Use proper input validation. |
Zelalem05fed522021-02-24 19:20:09 -0600434| | |
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200435| | | 2) Code reviews, testing. |
436+------------------------+------------------------------------------------------+
437| Mitigations | | 1) Yes. |
438| implemented? | Data received from normal world, such as addresses |
Zelalem05fed522021-02-24 19:20:09 -0600439| | and sizes identifying memory regions, are |
440| | sanitized before being used. These security checks |
441| | make sure that the normal world software does not |
442| | access memory beyond its limit. |
443| | |
444| | | By default *asserts* are only used to check for |
445| | programming errors in debug builds. Other types of |
446| | errors are handled through condition checks that |
447| | remain enabled in release builds. See |
448| | `TF-A error handling policy`_. TF-A provides an |
449| | option to use *asserts* in release builds, however |
450| | we recommend using proper runtime checks instead |
451| | of relying on asserts in release builds. |
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200452| | |
453| | | 2) Yes. |
454| | TF-A uses a combination of manual code reviews |
455| | and automated program analysis and testing to |
456| | detect and fix memory corruption bugs. All TF-A |
457| | code including platform code go through manual |
458| | code reviews. Additionally, static code analysis |
459| | is performed using Coverity Scan on all TF-A code. |
460| | The code is also tested with |
461| | `Trusted Firmware-A Tests`_ on Juno and FVP |
462| | platforms. |
Zelalem05fed522021-02-24 19:20:09 -0600463+------------------------+------------------------------------------------------+
464
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200465
466+------------------------+----------------------------------------------------+
467| ID | 11 |
468+========================+====================================================+
469| Threat | | **Misconfiguration of the Memory Management Unit |
470| | (MMU) may allow a normal world software to |
471| | access sensitive data, execute arbitrary |
472| | code or access otherwise restricted HW |
473| | interface** |
474| | |
475| | | A misconfiguration of the MMU could |
476| | lead to an open door for software running in the |
477| | normal world to access sensitive data or even |
478| | execute code if the proper security mechanisms |
479| | are not in place. |
480+------------------------+----------------------------------------------------+
481| Diagram Elements | DF5, DF6 |
482+------------------------+----------------------------------------------------+
483| Affected TF-A | BL1, BL2, BL31 |
484| Components | |
485+------------------------+----------------------------------------------------+
486| Assets | Sensitive Data, Code execution |
487+------------------------+----------------------------------------------------+
488| Threat Agent | NSCode |
489+------------------------+----------------------------------------------------+
490| Threat Type | Information Disclosure, Elevation of Privilege |
491+------------------------+-----------------+-----------------+----------------+
492| Application | Server | IoT | Mobile |
493+------------------------+-----------------+-----------------+----------------+
494| Impact | Critical (5) | Critical (5) | Critical (5) |
495+------------------------+-----------------+-----------------+----------------+
496| Likelihood | High (4) | High (4) | High (4) |
497+------------------------+-----------------+-----------------+----------------+
498| Total Risk Rating | Critical (20) | Critical (20) | Critical (20) |
499+------------------------+-----------------+-----------------+----------------+
500| Mitigations | When configuring access permissions, the |
501| | principle of least privilege ought to be |
502| | enforced. This means we should not grant more |
503| | privileges than strictly needed, e.g. code |
504| | should be read-only executable, read-only data |
505| | should be read-only execute-never, and so on. |
506+------------------------+----------------------------------------------------+
507| Mitigations | | Platform specific. |
508| implemented? | |
509| | | MMU configuration is platform specific, |
510| | therefore platforms need to make sure that the |
511| | correct attributes are assigned to memory |
512| | regions. |
513| | |
514| | | TF-A provides a library which abstracts the |
515| | low-level details of MMU configuration. It |
516| | provides well-defined and tested APIs. |
517| | Platforms are encouraged to use it to limit the |
518| | risk of misconfiguration. |
519+------------------------+----------------------------------------------------+
520
521
522+------------------------+-----------------------------------------------------+
523| ID | 13 |
524+========================+=====================================================+
525| Threat | | **Leaving sensitive information in the memory, |
526| | can allow an attacker to retrieve them.** |
527| | |
528| | | Accidentally leaving not-needed sensitive data in |
529| | internal buffers can leak them if an attacker |
530| | gains access to memory due to a vulnerability. |
531+------------------------+-----------------------------------------------------+
532| Diagram Elements | DF4, DF5 |
533+------------------------+-----------------------------------------------------+
534| Affected TF-A | BL1, BL2, BL31 |
535| Components | |
536+------------------------+-----------------------------------------------------+
537| Assets | Sensitive Data |
538+------------------------+-----------------------------------------------------+
539| Threat Agent | NSCode, SecCode |
540+------------------------+-----------------------------------------------------+
541| Threat Type | Information Disclosure |
542+------------------------+-------------------+----------------+----------------+
543| Application | Server | IoT | Mobile |
544+------------------------+-------------------+----------------+----------------+
545| Impact | Critical (5) | Critical (5) | Critical (5) |
546+------------------------+-------------------+----------------+----------------+
547| Likelihood | Medium (3) | Medium (3) | Medium (3) |
548+------------------------+-------------------+----------------+----------------+
549| Total Risk Rating | High (15) | High (15) | High (15) |
550+------------------------+-------------------+----------------+----------------+
551| Mitigations | Clear the sensitive data from internal buffers as |
552| | soon as they are not needed anymore. |
553+------------------------+-----------------------------------------------------+
554| Mitigations | | Yes / Platform specific |
555+------------------------+-----------------------------------------------------+
556
557
558Threats to be Mitigated by the Boot Firmware
559--------------------------------------------
560
561The boot firmware here refers to the boot ROM (BL1) and the trusted boot
562firmware (BL2). Typically it does not stay resident in memory and it is
563dismissed once execution has reached the runtime EL3 firmware (BL31). Thus, past
564that point in time, the threats below can no longer be exploited.
565
566Note, however, that this is not necessarily true on all platforms. Platform
567vendors should review these threats to make sure they cannot be exploited
568nonetheless once execution has reached the runtime EL3 firmware.
569
570+------------------------+----------------------------------------------------+
571| ID | 01 |
572+========================+====================================================+
573| Threat | | **An attacker can mangle firmware images to |
574| | execute arbitrary code** |
575| | |
576| | | Some TF-A images are loaded from external |
577| | storage. It is possible for an attacker to access|
578| | the external flash memory and change its contents|
579| | physically, through the Rich OS, or using the |
580| | updating mechanism to modify the non-volatile |
581| | images to execute arbitrary code. |
582+------------------------+----------------------------------------------------+
583| Diagram Elements | DF1, DF4, DF5 |
584+------------------------+----------------------------------------------------+
585| Affected TF-A | BL2, BL31 |
586| Components | |
587+------------------------+----------------------------------------------------+
588| Assets | Code Execution |
589+------------------------+----------------------------------------------------+
590| Threat Agent | PhysicalAccess, NSCode, SecCode |
591+------------------------+----------------------------------------------------+
592| Threat Type | Tampering, Elevation of Privilege |
593+------------------------+------------------+-----------------+---------------+
594| Application | Server | IoT | Mobile |
595+------------------------+------------------+-----------------+---------------+
596| Impact | Critical (5) | Critical (5) | Critical (5) |
597+------------------------+------------------+-----------------+---------------+
598| Likelihood | Critical (5) | Critical (5) | Critical (5) |
599+------------------------+------------------+-----------------+---------------+
600| Total Risk Rating | Critical (25) | Critical (25) | Critical (25) |
601+------------------------+------------------+-----------------+---------------+
602| Mitigations | | 1) Implement the `Trusted Board Boot (TBB)`_ |
603| | feature which prevents malicious firmware from |
604| | running on the platform by authenticating all |
605| | firmware images. |
606| | |
607| | | 2) Perform extra checks on unauthenticated data, |
608| | such as FIP metadata, prior to use. |
609+------------------------+----------------------------------------------------+
610| Mitigations | | 1) Yes, provided that the ``TRUSTED_BOARD_BOOT`` |
611| implemented? | build option is set to 1. |
612| | |
613| | | 2) Yes. |
614+------------------------+----------------------------------------------------+
615
616+------------------------+----------------------------------------------------+
617| ID | 02 |
618+========================+====================================================+
619| Threat | | **An attacker may attempt to boot outdated, |
620| | potentially vulnerable firmware image** |
621| | |
622| | | When updating firmware, an attacker may attempt |
623| | to rollback to an older version that has unfixed |
624| | vulnerabilities. |
625+------------------------+----------------------------------------------------+
626| Diagram Elements | DF1, DF4, DF5 |
627+------------------------+----------------------------------------------------+
628| Affected TF-A | BL2, BL31 |
629| Components | |
630+------------------------+----------------------------------------------------+
631| Assets | Code Execution |
632+------------------------+----------------------------------------------------+
633| Threat Agent | PhysicalAccess, NSCode, SecCode |
634+------------------------+----------------------------------------------------+
635| Threat Type | Tampering |
636+------------------------+------------------+-----------------+---------------+
637| Application | Server | IoT | Mobile |
638+------------------------+------------------+-----------------+---------------+
639| Impact | Critical (5) | Critical (5) | Critical (5) |
640+------------------------+------------------+-----------------+---------------+
641| Likelihood | Critical (5) | Critical (5) | Critical (5) |
642+------------------------+------------------+-----------------+---------------+
643| Total Risk Rating | Critical (25) | Critical (25) | Critical (25) |
644+------------------------+------------------+-----------------+---------------+
645| Mitigations | Implement anti-rollback protection using |
646| | non-volatile counters (NV counters) as required |
647| | by `TBBR-Client specification`_. |
648+------------------------+----------------------------------------------------+
649| Mitigations | | Yes / Platform specific. |
650| implemented? | |
651| | | After a firmware image is validated, the image |
652| | revision number taken from a certificate |
653| | extension field is compared with the |
654| | corresponding NV counter stored in hardware to |
655| | make sure the new counter value is larger than |
656| | the current counter value. |
657| | |
658| | | **Platforms must implement this protection using |
659| | platform specific hardware NV counters.** |
660+------------------------+----------------------------------------------------+
661
662
663+------------------------+-------------------------------------------------------+
664| ID | 03 |
665+========================+=======================================================+
666| Threat | | **An attacker can use Time-of-Check-Time-of-Use |
667| | (TOCTOU) attack to bypass image authentication |
668| | during the boot process** |
669| | |
670| | | Time-of-Check-Time-of-Use (TOCTOU) threats occur |
671| | when the security check is produced before the time |
672| | the resource is accessed. If an attacker is sitting |
673| | in the middle of the off-chip images, they could |
674| | change the binary containing executable code right |
675| | after the integrity and authentication check has |
676| | been performed. |
677+------------------------+-------------------------------------------------------+
678| Diagram Elements | DF1 |
679+------------------------+-------------------------------------------------------+
680| Affected TF-A | BL1, BL2 |
681| Components | |
682+------------------------+-------------------------------------------------------+
683| Assets | Code Execution, Sensitive Data |
684+------------------------+-------------------------------------------------------+
685| Threat Agent | PhysicalAccess |
686+------------------------+-------------------------------------------------------+
687| Threat Type | Elevation of Privilege |
688+------------------------+---------------------+-----------------+---------------+
689| Application | Server | IoT | Mobile |
690+------------------------+---------------------+-----------------+---------------+
691| Impact | N/A | Critical (5) | Critical (5) |
692+------------------------+---------------------+-----------------+---------------+
693| Likelihood | N/A | Medium (3) | Medium (3) |
694+------------------------+---------------------+-----------------+---------------+
695| Total Risk Rating | N/A | High (15) | High (15) |
696+------------------------+---------------------+-----------------+---------------+
697| Mitigations | Copy image to on-chip memory before authenticating |
698| | it. |
699+------------------------+-------------------------------------------------------+
700| Mitigations | | Platform specific. |
701| implemented? | |
702| | | The list of images to load and their location is |
703| | platform specific. Platforms are responsible for |
704| | arranging images to be loaded in on-chip memory. |
705+------------------------+-------------------------------------------------------+
706
707
708+------------------------+-------------------------------------------------------+
709| ID | 04 |
710+========================+=======================================================+
711| Threat | | **An attacker with physical access can execute |
712| | arbitrary image by bypassing the signature |
713| | verification stage using glitching techniques** |
714| | |
715| | | Glitching (Fault injection) attacks attempt to put |
716| | a hardware into a undefined state by manipulating an|
717| | environmental variable such as power supply. |
718| | |
719| | | TF-A relies on a chain of trust that starts with the|
720| | ROTPK, which is the key stored inside the chip and |
721| | the root of all validation processes. If an attacker|
722| | can break this chain of trust, they could execute |
723| | arbitrary code on the device. This could be |
724| | achieved with physical access to the device by |
725| | attacking the normal execution flow of the |
726| | process using glitching techniques that target |
727| | points where the image is validated against the |
728| | signature. |
729+------------------------+-------------------------------------------------------+
730| Diagram Elements | DF1 |
731+------------------------+-------------------------------------------------------+
732| Affected TF-A | BL1, BL2 |
733| Components | |
734+------------------------+-------------------------------------------------------+
735| Assets | Code Execution |
736+------------------------+-------------------------------------------------------+
737| Threat Agent | PhysicalAccess |
738+------------------------+-------------------------------------------------------+
739| Threat Type | Tampering, Elevation of Privilege |
740+------------------------+---------------------+-----------------+---------------+
741| Application | Server | IoT | Mobile |
742+------------------------+---------------------+-----------------+---------------+
743| Impact | N/A | Critical (5) | Critical (5) |
744+------------------------+---------------------+-----------------+---------------+
745| Likelihood | N/A | Medium (3) | Medium (3) |
746+------------------------+---------------------+-----------------+---------------+
747| Total Risk Rating | N/A | High (15) | High (15) |
748+------------------------+---------------------+-----------------+---------------+
749| Mitigations | Mechanisms to detect clock glitch and power |
750| | variations. |
751+------------------------+-------------------------------------------------------+
752| Mitigations | | No. |
753| implemented? | |
754| | | The most effective mitigation is adding glitching |
755| | detection and mitigation circuit at the hardware |
756| | level. |
757| | |
758| | | However, software techniques, such as adding |
759| | redundant checks when performing conditional |
760| | branches that are security sensitive, can be used |
761| | to harden TF-A against such attacks. |
762| | **At the moment TF-A doesn't implement such |
763| | mitigations.** |
764+------------------------+-------------------------------------------------------+
765
766.. topic:: Measured Boot Threats (or lack of)
767
768 In the current Measured Boot design, BL1, BL2, and BL31, as well as the
769 secure world components, form the |SRTM|. Measurement data is currently
770 considered an asset to be protected against attack, and this is achieved
771 by storing them in the Secure Memory.
772 Beyond the measurements stored inside the TCG-compliant Event Log buffer,
773 there are no other assets to protect or threats to defend against that
774 could compromise |TF-A| execution environment's security.
775
776 There are general security assets and threats associated with remote/delegated
777 attestation. However, these are outside the |TF-A| security boundary and
778 should be dealt with by the appropriate agent in the platform/system.
779 Since current Measured Boot design does not use local attestation, there would
780 be no further assets to protect(like unsealed keys).
781
782 A limitation of the current Measured Boot design is that it is dependent upon
783 Secure Boot as implementation of Measured Boot does not extend measurements
784 into a discrete |TPM|, where they would be securely stored and protected
785 against tampering. This implies that if Secure-Boot is compromised, Measured
786 Boot may also be compromised.
787
788 Platforms must carefully evaluate the security of the default implementation
789 since the |SRTM| includes all secure world components.
790
791
792Threats to be Mitigated by the Runtime EL3 Firmware
793---------------------------------------------------
794
Zelalem05fed522021-02-24 19:20:09 -0600795+------------------------+------------------------------------------------------+
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200796| ID | 07 |
797+========================+======================================================+
798| Threat | | **An attacker can perform a denial-of-service |
799| | attack by using a broken SMC call that causes the |
800| | system to reboot or enter into unknown state.** |
801| | |
802| | | Secure and non-secure clients access TF-A services |
803| | through SMC calls. Malicious code can attempt to |
804| | place the TF-A runtime into an inconsistent state |
805| | by calling unimplemented SMC call or by passing |
806| | invalid arguments. |
807+------------------------+------------------------------------------------------+
808| Diagram Elements | DF4, DF5 |
809+------------------------+------------------------------------------------------+
810| Affected TF-A | BL31 |
811| Components | |
812+------------------------+------------------------------------------------------+
813| Assets | Availability |
814+------------------------+------------------------------------------------------+
815| Threat Agent | NSCode, SecCode |
816+------------------------+------------------------------------------------------+
817| Threat Type | Denial of Service |
818+------------------------+-------------------+----------------+-----------------+
819| Application | Server | IoT | Mobile |
820+------------------------+-------------------+----------------+-----------------+
821| Impact | Medium (3) | Medium (3) | Medium (3) |
822+------------------------+-------------------+----------------+-----------------+
823| Likelihood | High (4) | High (4) | High (4) |
824+------------------------+-------------------+----------------+-----------------+
825| Total Risk Rating | High (12) | High (12) | High (12) |
826+------------------------+-------------------+----------------+-----------------+
827| Mitigations | Validate SMC function ids and arguments before using |
828| | them. |
829+------------------------+------------------------------------------------------+
830| Mitigations | | Yes / Platform specific. |
831| implemented? | |
832| | | For standard services, all input is validated. |
833| | |
834| | | Platforms that implement SiP services must also |
835| | validate SMC call arguments. |
836+------------------------+------------------------------------------------------+
837
838
839+------------------------+------------------------------------------------------+
Zelalem05fed522021-02-24 19:20:09 -0600840| ID | 09 |
841+========================+======================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200842| Threat | | **Improperly handled SMC calls can leak register |
Zelalem05fed522021-02-24 19:20:09 -0600843| | contents** |
844| | |
Sandrine Bailleux1c7d74e2022-05-12 16:37:18 +0200845| | | When switching between worlds, TF-A register state |
846| | can leak to software in different security |
847| | contexts. |
Zelalem05fed522021-02-24 19:20:09 -0600848+------------------------+------------------------------------------------------+
Sandrine Bailleux1c7d74e2022-05-12 16:37:18 +0200849| Diagram Elements | DF4, DF5 |
Zelalem05fed522021-02-24 19:20:09 -0600850+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200851| Affected TF-A | BL31 |
852| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600853+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200854| Assets | Sensitive Data |
Zelalem05fed522021-02-24 19:20:09 -0600855+------------------------+------------------------------------------------------+
Sandrine Bailleux1c7d74e2022-05-12 16:37:18 +0200856| Threat Agent | NSCode, SecCode |
Zelalem05fed522021-02-24 19:20:09 -0600857+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200858| Threat Type | Information Disclosure |
Zelalem05fed522021-02-24 19:20:09 -0600859+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200860| Application | Server | IoT | Mobile |
Zelalem05fed522021-02-24 19:20:09 -0600861+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200862| Impact | Medium (3) | Medium (3) | Medium (3) |
Zelalem05fed522021-02-24 19:20:09 -0600863+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200864| Likelihood | High (4) | High (4) | High (4) |
Zelalem05fed522021-02-24 19:20:09 -0600865+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200866| Total Risk Rating | High (12) | High (12) | High (12) |
Zelalem05fed522021-02-24 19:20:09 -0600867+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200868| Mitigations | Save and restore registers when switching contexts. |
869+------------------------+------------------------------------------------------+
870| Mitigations | | Yes. |
871| implemented? | |
872| | | This is the default behaviour in TF-A. |
873| | Build options are also provided to save/restore |
874| | additional registers such as floating-point |
875| | registers. These should be enabled if required. |
Zelalem05fed522021-02-24 19:20:09 -0600876+------------------------+------------------------------------------------------+
877
878+------------------------+-----------------------------------------------------+
879| ID | 10 |
880+========================+=====================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200881| Threat | | **SMC calls can leak sensitive information from |
Zelalem05fed522021-02-24 19:20:09 -0600882| | TF-A memory via microarchitectural side channels**|
883| | |
884| | | Microarchitectural side-channel attacks such as |
885| | `Spectre`_ can be used to leak data across |
886| | security boundaries. An attacker might attempt to |
887| | use this kind of attack to leak sensitive |
888| | data from TF-A memory. |
889+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200890| Diagram Elements | DF4, DF5 |
Zelalem05fed522021-02-24 19:20:09 -0600891+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200892| Affected TF-A | BL31 |
893| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600894+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200895| Assets | Sensitive Data |
Zelalem05fed522021-02-24 19:20:09 -0600896+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200897| Threat Agent | SecCode, NSCode |
Zelalem05fed522021-02-24 19:20:09 -0600898+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200899| Threat Type | Information Disclosure |
Zelalem05fed522021-02-24 19:20:09 -0600900+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200901| Application | Server | IoT | Mobile |
Zelalem05fed522021-02-24 19:20:09 -0600902+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200903| Impact | Medium (3) | Medium (3) | Medium (3) |
Zelalem05fed522021-02-24 19:20:09 -0600904+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200905| Likelihood | Medium (3) | Medium (3) | Medium (3) |
Zelalem05fed522021-02-24 19:20:09 -0600906+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200907| Total Risk Rating | Medium (9) | Medium (9) | Medium (9) |
Zelalem05fed522021-02-24 19:20:09 -0600908+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200909| Mitigations | Enable appropriate side-channel protections. |
910+------------------------+-----------------------------------------------------+
911| Mitigations | | Yes / Platform specific. |
912| implemented? | |
913| | | TF-A implements software mitigations for Spectre |
Zelalem05fed522021-02-24 19:20:09 -0600914| | type attacks as recommended by `Cache Speculation |
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200915| | Side-channels`_ for the generic code. |
916| | |
917| | | SiPs should implement similar mitigations for |
918| | code that is deemed to be vulnerable to such |
919| | attacks. |
Zelalem05fed522021-02-24 19:20:09 -0600920+------------------------+-----------------------------------------------------+
921
Zelalem05fed522021-02-24 19:20:09 -0600922
923+------------------------+-----------------------------------------------------+
924| ID | 12 |
925+========================+=====================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200926| Threat | | **Incorrect configuration of Performance Monitor |
Zelalem05fed522021-02-24 19:20:09 -0600927| | Unit (PMU) counters can allow an attacker to |
928| | mount side-channel attacks using information |
929| | exposed by the counters** |
930| | |
931| | | Non-secure software can configure PMU registers |
932| | to count events at any exception level and in |
933| | both Secure and Non-secure states. This allows |
934| | a Non-secure software (or a lower-level Secure |
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200935| | software) to potentially carry out |
Zelalem05fed522021-02-24 19:20:09 -0600936| | side-channel timing attacks against TF-A. |
937+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200938| Diagram Elements | DF5, DF6 |
Zelalem05fed522021-02-24 19:20:09 -0600939+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200940| Affected TF-A | BL31 |
941| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600942+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200943| Assets | Sensitive Data |
Zelalem05fed522021-02-24 19:20:09 -0600944+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200945| Threat Agent | NSCode |
Zelalem05fed522021-02-24 19:20:09 -0600946+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200947| Threat Type | Information Disclosure |
Zelalem05fed522021-02-24 19:20:09 -0600948+------------------------+-------------------+----------------+----------------+
Tamas Bancf151b72022-11-30 17:06:05 +0100949| Application | Server | IoT | Mobile |
950+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200951| Impact | Medium (3) | Medium (3) | Medium (3) |
Zelalem05fed522021-02-24 19:20:09 -0600952+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200953| Likelihood | Low (2) | Low (2) | Low (2) |
Zelalem05fed522021-02-24 19:20:09 -0600954+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200955| Total Risk Rating | Medium (6) | Medium (6) | Medium (6) |
Zelalem05fed522021-02-24 19:20:09 -0600956+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200957| Mitigations | Follow mitigation strategies as described in |
958| | `Secure Development Guidelines`_. |
959+------------------------+-----------------------------------------------------+
960| Mitigations | | Yes / platform specific. |
961| implemented? | |
962| | | General events and cycle counting in the Secure |
963| | world is prohibited by default when applicable. |
964| | |
965| | | However, on some implementations (e.g. PMUv3) |
966| | Secure world event counting depends on external |
967| | debug interface signals, i.e. Secure world event |
968| | counting is enabled if external debug is enabled. |
969| | |
970| | | Configuration of debug signals is platform |
Zelalem05fed522021-02-24 19:20:09 -0600971| | specific, therefore platforms need to make sure |
972| | that external debug is disabled in production or |
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200973| | proper debug authentication is in place. This |
974| | should be the case if threat #06 is properly |
975| | mitigated. |
Zelalem05fed522021-02-24 19:20:09 -0600976+------------------------+-----------------------------------------------------+
977
Sandrine Bailleux522185b2023-08-21 14:28:54 +0200978
979Threats to be Mitigated by an External Agent Outside of TF-A
980------------------------------------------------------------
Tamas Bancf151b72022-11-30 17:06:05 +0100981
Jeffrey Kardatzke7e6b09a2022-10-03 15:50:21 -0700982+------------------------+-----------------------------------------------------+
983| ID | 14 |
984+========================+=====================================================+
Jeffrey Kardatzkeab7e5572023-02-09 11:03:17 -0800985| Threat | | **Attacker wants to execute an arbitrary or |
986| | untrusted binary as the secure OS.** |
Jeffrey Kardatzke7e6b09a2022-10-03 15:50:21 -0700987| | |
Jeffrey Kardatzkeab7e5572023-02-09 11:03:17 -0800988| | | When the option OPTEE_ALLOW_SMC_LOAD is enabled, |
989| | this trusts the non-secure world up until the |
990| | point it issues the SMC call to load the Secure |
991| | BL32 payload. If a compromise occurs before the |
992| | SMC call is invoked, then arbitrary code execution|
993| | in S-EL1 can occur or arbitrary memory in EL3 can |
994| | be overwritten. |
Jeffrey Kardatzke7e6b09a2022-10-03 15:50:21 -0700995+------------------------+-----------------------------------------------------+
996| Diagram Elements | DF5 |
997+------------------------+-----------------------------------------------------+
998| Affected TF-A | BL31, BL32 |
999| Components | |
1000+------------------------+-----------------------------------------------------+
1001| Assets | Code Execution, Sensitive Data |
1002+------------------------+-----------------------------------------------------+
1003| Threat Agent | NSCode |
1004+------------------------+-----------------------------------------------------+
1005| Threat Type | Tampering, Information Disclosure, |
1006| | Elevation of privilege |
1007+------------------------+-----------------+-----------------+-----------------+
1008| Application | Server | IoT | Mobile |
1009+------------------------+-----------------+-----------------+-----------------+
1010| Impact | Critical (5) | Critical (5) | Critical (5) |
1011+------------------------+-----------------+-----------------+-----------------+
Jeffrey Kardatzkeab7e5572023-02-09 11:03:17 -08001012| Likelihood | High (4) | High (4) | High (4) |
Jeffrey Kardatzke7e6b09a2022-10-03 15:50:21 -07001013+------------------------+-----------------+-----------------+-----------------+
Jeffrey Kardatzkeab7e5572023-02-09 11:03:17 -08001014| Total Risk Rating | Critical (20) | Critical (20) | Critical (20) |
Jeffrey Kardatzke7e6b09a2022-10-03 15:50:21 -07001015+------------------------+-----------------+-----------------+-----------------+
1016| Mitigations | When enabling the option OPTEE_ALLOW_SMC_LOAD, |
1017| | the non-secure OS must be considered a closed |
1018| | platform up until the point the SMC can be invoked |
1019| | to load OP-TEE. |
1020+------------------------+-----------------------------------------------------+
1021| Mitigations | | None in TF-A itself. This option is only used by |
1022| implemented? | ChromeOS currently which has other mechanisms to |
1023| | to mitigate this threat which are described in |
1024| | `OP-TEE Dispatcher`_. |
1025+------------------------+-----------------------------------------------------+
1026
Zelalem05fed522021-02-24 19:20:09 -06001027--------------
1028
Jeffrey Kardatzke7e6b09a2022-10-03 15:50:21 -07001029*Copyright (c) 2021-2023, Arm Limited. All rights reserved.*
Zelalem05fed522021-02-24 19:20:09 -06001030
1031
1032.. _STRIDE threat analysis technique: https://docs.microsoft.com/en-us/azure/security/develop/threat-modeling-tool-threats#stride-model
1033.. _DEN0034: https://developer.arm.com/documentation/den0034/latest
1034.. _Cache Speculation Side-channels: https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability
1035.. _Spectre: https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability
1036.. _TBBR-Client specification: https://developer.arm.com/documentation/den0006/d/
1037.. _Trusted Board Boot (TBB): https://trustedfirmware-a.readthedocs.io/en/latest/design/trusted-board-boot.html
1038.. _TF-A error handling policy: https://trustedfirmware-a.readthedocs.io/en/latest/process/coding-guidelines.html#error-handling-and-robustness
1039.. _Secure Development Guidelines: https://trustedfirmware-a.readthedocs.io/en/latest/process/security-hardening.html#secure-development-guidelines
Olivier Deprez86d1ffd2021-06-01 15:37:16 +02001040.. _Trusted Firmware-A Tests: https://git.trustedfirmware.org/TF-A/tf-a-tests.git/about/
Jeffrey Kardatzke7e6b09a2022-10-03 15:50:21 -07001041.. _OP-TEE Dispatcher: https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/components/spd/optee-dispatcher.rst