blob: 1d689f5fde39aa4664d4f54bbf57fc7667d5f9df [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 Bailleux6e5c2182022-05-10 14:55:01 +020010********************
Zelalem05fed522021-02-24 19:20:09 -060011Target of Evaluation
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +020012********************
13
Zelalem05fed522021-02-24 19:20:09 -060014In this threat model, the target of evaluation is the Trusted
15Firmware for A-class Processors (TF-A). This includes the boot ROM (BL1),
16the trusted boot firmware (BL2) and the runtime EL3 firmware (BL31) as
17shown on Figure 1. Everything else on Figure 1 is outside of the scope of
18the evaluation.
19
20TF-A can be configured in various ways. In this threat model we consider
21only the most basic configuration. To that end we make the following
22assumptions:
23
24- All TF-A images are run from either ROM or on-chip trusted SRAM. This means
25 TF-A is not vulnerable to an attacker that can probe or tamper with off-chip
26 memory.
Zelalem Aweke023b1a42021-10-21 13:59:45 -050027
Zelalem05fed522021-02-24 19:20:09 -060028- Trusted boot is enabled. This means an attacker can't boot arbitrary images
29 that are not approved by platform providers.
Zelalem Aweke023b1a42021-10-21 13:59:45 -050030
Zelalem05fed522021-02-24 19:20:09 -060031- There is no Secure-EL2. We don't consider threats that may come with
32 Secure-EL2 software.
33
Sandrine Bailleuxe26ef3c2023-08-21 11:04:03 +020034- There are no Root and Realm worlds. These are introduced by :ref:`Realm
35 Management Extension (RME)`.
36
Sandrine Bailleux78cdfdd2022-05-12 14:57:26 +020037- No experimental features are enabled. We do not consider threats that may come
38 from them.
39
Manish V Badarkhe9d971222023-04-03 13:50:59 +010040.. note::
41
42 In the current Measured Boot design, BL1, BL2, and BL31, as well as the
43 secure world components, form the |SRTM|. Measurement data is currently
44 considered an asset to be protected against attack, and this is achieved
45 by storing them in the Secure Memory.
46 Beyond the measurements stored inside the TCG-compliant Event Log buffer,
47 there are no other assets to protect or threats to defend against that
48 could compromise |TF-A| execution environment's security.
49
50 There are general security assets and threats associated with remote/delegated
51 attestation. However, these are outside the |TF-A| security boundary and
52 should be dealt with by the appropriate agent in the platform/system.
53 Since current Measured Boot design does not use local attestation, there would
54 be no further assets to protect(like unsealed keys).
55
56 A limitation of the current Measured Boot design is that it is dependent upon
57 Secure Boot as implementation of Measured Boot does not extend measurements
58 into a discrete |TPM|, where they would be securely stored and protected
59 against tampering. This implies that if Secure-Boot is compromised, Measured
60 Boot may also be compromised.
61
62 Platforms must carefully evaluate the security of the default implementation
63 since the |SRTM| includes all secure world components.
64
Zelalem05fed522021-02-24 19:20:09 -060065Data Flow Diagram
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +020066=================
67
Zelalem05fed522021-02-24 19:20:09 -060068Figure 1 shows a high-level data flow diagram for TF-A. The diagram
69shows a model of the different components of a TF-A-based system and
70their interactions with TF-A. A description of each diagram element
71is given on Table 1. On the diagram, the red broken lines indicate
72trust boundaries. Components outside of the broken lines
73are considered untrusted by TF-A.
74
75.. uml:: ../resources/diagrams/plantuml/tfa_dfd.puml
76 :caption: Figure 1: TF-A Data Flow Diagram
77
78.. table:: Table 1: TF-A Data Flow Diagram Description
79
80 +-----------------+--------------------------------------------------------+
81 | Diagram Element | Description |
82 +=================+========================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +020083 | DF1 | | At boot time, images are loaded from non-volatile |
Zelalem05fed522021-02-24 19:20:09 -060084 | | memory and verified by TF-A boot firmware. These |
85 | | images include TF-A BL2 and BL31 images, as well as |
86 | | other secure and non-secure images. |
87 +-----------------+--------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +020088 | DF2 | | TF-A log system framework outputs debug messages |
Zelalem05fed522021-02-24 19:20:09 -060089 | | over a UART interface. |
90 +-----------------+--------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +020091 | DF3 | | Debug and trace IP on a platform can allow access |
Zelalem05fed522021-02-24 19:20:09 -060092 | | to registers and memory of TF-A. |
93 +-----------------+--------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +020094 | DF4 | | Secure world software (e.g. trusted OS) interact |
Zelalem05fed522021-02-24 19:20:09 -060095 | | with TF-A through SMC call interface and/or shared |
96 | | memory. |
97 +-----------------+--------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +020098 | DF5 | | Non-secure world software (e.g. rich OS) interact |
Zelalem05fed522021-02-24 19:20:09 -060099 | | with TF-A through SMC call interface and/or shared |
100 | | memory. |
101 +-----------------+--------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200102 | DF6 | | This path represents the interaction between TF-A and|
Zelalem05fed522021-02-24 19:20:09 -0600103 | | various hardware IPs such as TrustZone controller |
104 | | and GIC. At boot time TF-A configures/initializes the|
105 | | IPs and interacts with them at runtime through |
106 | | interrupts and registers. |
107 +-----------------+--------------------------------------------------------+
108
109
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200110***************
Zelalem05fed522021-02-24 19:20:09 -0600111Threat Analysis
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200112***************
113
Zelalem05fed522021-02-24 19:20:09 -0600114In this section we identify and provide assessment of potential threats to TF-A
115firmware. The threats are identified for each diagram element on the
116data flow diagram above.
117
118For each threat, we identify the *asset* that is under threat, the
119*threat agent* and the *threat type*. Each threat is given a *risk rating*
120that represents the impact and likelihood of that threat. We also discuss
121potential mitigations.
122
123Assets
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200124======
125
Zelalem05fed522021-02-24 19:20:09 -0600126We have identified the following assets for TF-A:
127
128.. table:: Table 2: TF-A Assets
129
130 +--------------------+---------------------------------------------------+
131 | Asset | Description |
132 +====================+===================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200133 | Sensitive Data | | These include sensitive data that an attacker |
Zelalem05fed522021-02-24 19:20:09 -0600134 | | must not be able to tamper with (e.g. the Root |
135 | | of Trust Public Key) or see (e.g. secure logs, |
136 | | debugging information such as crash reports). |
137 +--------------------+---------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200138 | Code Execution | | This represents the requirement that the |
Zelalem05fed522021-02-24 19:20:09 -0600139 | | platform should run only TF-A code approved by |
140 | | the platform provider. |
141 +--------------------+---------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200142 | Availability | | This represents the requirement that TF-A |
Zelalem05fed522021-02-24 19:20:09 -0600143 | | services should always be available for use. |
144 +--------------------+---------------------------------------------------+
145
146Threat Agents
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200147=============
148
Zelalem05fed522021-02-24 19:20:09 -0600149To understand the attack surface, it is important to identify potential
150attackers, i.e. attack entry points. The following threat agents are
151in scope of this threat model.
152
153.. table:: Table 3: Threat Agents
154
155 +-------------------+-------------------------------------------------------+
156 | Threat Agent | Description |
157 +===================+=======================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200158 | NSCode | | Malicious or faulty code running in the Non-secure |
Zelalem05fed522021-02-24 19:20:09 -0600159 | | world, including NS-EL0 NS-EL1 and NS-EL2 levels |
160 +-------------------+-------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200161 | SecCode | | Malicious or faulty code running in the secure |
Zelalem05fed522021-02-24 19:20:09 -0600162 | | world, including S-EL0 and S-EL1 levels |
163 +-------------------+-------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200164 | AppDebug | | Physical attacker using debug signals to access |
Zelalem05fed522021-02-24 19:20:09 -0600165 | | TF-A resources |
166 +-------------------+-------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200167 | PhysicalAccess | | Physical attacker having access to external device |
Zelalem05fed522021-02-24 19:20:09 -0600168 | | communication bus and to external flash |
169 | | communication bus using common hardware |
170 +-------------------+-------------------------------------------------------+
171
172.. note::
173
174 In this threat model an advanced physical attacker that has the capability
175 to tamper with a hardware (e.g. "rewiring" a chip using a focused
176 ion beam (FIB) workstation or decapsulate the chip using chemicals) is
177 considered out-of-scope.
178
179Threat Types
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200180============
181
Zelalem05fed522021-02-24 19:20:09 -0600182In this threat model we categorize threats using the `STRIDE threat
183analysis technique`_. In this technique a threat is categorized as one
184or more of these types: ``Spoofing``, ``Tampering``, ``Repudiation``,
185``Information disclosure``, ``Denial of service`` or
186``Elevation of privilege``.
187
188Threat Risk Ratings
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200189===================
190
Zelalem05fed522021-02-24 19:20:09 -0600191For each threat identified, a risk rating that ranges
192from *informational* to *critical* is given based on the likelihood of the
Tamas Bancf151b72022-11-30 17:06:05 +0100193threat occurring if a mitigation is not in place, and the impact of the
Zelalem05fed522021-02-24 19:20:09 -0600194threat (i.e. how severe the consequences could be). Table 4 explains each
195rating in terms of score, impact and likelihood.
196
197.. table:: Table 4: Rating and score as applied to impact and likelihood
198
199 +-----------------------+-------------------------+---------------------------+
200 | **Rating (Score)** | **Impact** | **Likelihood** |
201 +=======================+=========================+===========================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200202 | Critical (5) | | Extreme impact to | | Threat is almost |
Zelalem05fed522021-02-24 19:20:09 -0600203 | | entire organization | certain to be exploited.|
204 | | if exploited. | |
205 | | | | Knowledge of the threat |
206 | | | and how to exploit it |
207 | | | are in the public |
208 | | | domain. |
209 +-----------------------+-------------------------+---------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200210 | High (4) | | Major impact to entire| | Threat is relatively |
Zelalem05fed522021-02-24 19:20:09 -0600211 | | organization or single| easy to detect and |
212 | | line of business if | exploit by an attacker |
213 | | exploited | with little skill. |
214 +-----------------------+-------------------------+---------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200215 | Medium (3) | | Noticeable impact to | | A knowledgeable insider |
Zelalem05fed522021-02-24 19:20:09 -0600216 | | line of business if | or expert attacker could|
217 | | exploited. | exploit the threat |
218 | | | without much difficulty.|
219 +-----------------------+-------------------------+---------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200220 | Low (2) | | Minor damage if | | Exploiting the threat |
Zelalem05fed522021-02-24 19:20:09 -0600221 | | exploited or could | would require |
222 | | be used in conjunction| considerable expertise |
223 | | with other | and resources |
224 | | vulnerabilities to | |
225 | | perform a more serious| |
226 | | attack | |
227 +-----------------------+-------------------------+---------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200228 | Informational (1) | | Poor programming | | Threat is not likely |
Zelalem05fed522021-02-24 19:20:09 -0600229 | | practice or poor | to be exploited on its |
230 | | design decision that | own, but may be used to |
231 | | may not represent an | gain information for |
232 | | immediate risk on its | launching another |
233 | | own, but may have | attack |
234 | | security implications | |
235 | | if multiplied and/or | |
236 | | combined with other | |
237 | | threats. | |
238 +-----------------------+-------------------------+---------------------------+
239
240Aggregate risk scores are assigned to identified threats;
241specifically, the impact score multiplied by the likelihood score.
242For example, a threat with high likelihood and low impact would have an
243aggregate risk score of eight (8); that is, four (4) for high likelihood
244multiplied by two (2) for low impact. The aggregate risk score determines
245the finding's overall risk level, as shown in the following table.
246
247.. table:: Table 5: Overall risk levels and corresponding aggregate scores
248
249 +---------------------+-----------------------------------+
250 | Overall Risk Level | Aggregate Risk Score |
251 | | (Impact multiplied by Likelihood) |
252 +=====================+===================================+
253 | Critical | 20–25 |
254 +---------------------+-----------------------------------+
255 | High | 12–19 |
256 +---------------------+-----------------------------------+
257 | Medium | 6–11 |
258 +---------------------+-----------------------------------+
259 | Low | 2–5 |
260 +---------------------+-----------------------------------+
261 | Informational | 1 |
262 +---------------------+-----------------------------------+
263
264The likelihood and impact of a threat depends on the
265target environment in which TF-A is running. For example, attacks
266that require physical access are unlikely in server environments while
267they are more common in Internet of Things(IoT) environments.
268In this threat model we consider three target environments:
269``Internet of Things(IoT)``, ``Mobile`` and ``Server``.
270
271Threat Assessment
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200272=================
273
Zelalem05fed522021-02-24 19:20:09 -0600274The following threats were identified by applying STRIDE analysis on
275each diagram element of the data flow diagram.
276
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200277For each threat, we strive to indicate whether the mitigations are currently
278implemented or not. However, the answer to this question is not always straight
279forward. Some mitigations are partially implemented in the generic code but also
280rely on the platform code to implement some bits of it. This threat model aims
281to be platform-independent and it is important to keep in mind that such threats
282only get mitigated if the platform code properly fulfills its responsibilities.
283
284Also, some mitigations require enabling specific features, which must be
285explicitly turned on via a build flag.
286
287These are highlighted in the ``Mitigations implemented?`` box.
288
Zelalem05fed522021-02-24 19:20:09 -0600289+------------------------+----------------------------------------------------+
290| ID | 01 |
291+========================+====================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200292| Threat | | **An attacker can mangle firmware images to |
Zelalem05fed522021-02-24 19:20:09 -0600293| | execute arbitrary code** |
294| | |
295| | | Some TF-A images are loaded from external |
296| | storage. It is possible for an attacker to access|
297| | the external flash memory and change its contents|
298| | physically, through the Rich OS, or using the |
299| | updating mechanism to modify the non-volatile |
300| | images to execute arbitrary code. |
301+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200302| Diagram Elements | DF1, DF4, DF5 |
Zelalem05fed522021-02-24 19:20:09 -0600303+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200304| Affected TF-A | BL2, BL31 |
305| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600306+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200307| Assets | Code Execution |
Zelalem05fed522021-02-24 19:20:09 -0600308+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200309| Threat Agent | PhysicalAccess, NSCode, SecCode |
Zelalem05fed522021-02-24 19:20:09 -0600310+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200311| Threat Type | Tampering, Elevation of Privilege |
Zelalem05fed522021-02-24 19:20:09 -0600312+------------------------+------------------+-----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200313| Application | Server | IoT | Mobile |
Zelalem05fed522021-02-24 19:20:09 -0600314+------------------------+------------------+-----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200315| Impact | Critical (5) | Critical (5) | Critical (5) |
Zelalem05fed522021-02-24 19:20:09 -0600316+------------------------+------------------+-----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200317| Likelihood | Critical (5) | Critical (5) | Critical (5) |
Zelalem05fed522021-02-24 19:20:09 -0600318+------------------------+------------------+-----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200319| Total Risk Rating | Critical (25) | Critical (25) | Critical (25) |
Zelalem05fed522021-02-24 19:20:09 -0600320+------------------------+------------------+-----------------+---------------+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200321| Mitigations | | 1) Implement the `Trusted Board Boot (TBB)`_ |
Zelalem05fed522021-02-24 19:20:09 -0600322| | feature which prevents malicious firmware from |
323| | running on the platform by authenticating all |
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200324| | firmware images. |
325| | |
326| | | 2) Perform extra checks on unauthenticated data, |
327| | such as FIP metadata, prior to use. |
328+------------------------+----------------------------------------------------+
329| Mitigations | | 1) Yes, provided that the ``TRUSTED_BOARD_BOOT`` |
330| implemented? | build option is set to 1. |
331| | |
332| | | 2) Yes. |
Zelalem05fed522021-02-24 19:20:09 -0600333+------------------------+----------------------------------------------------+
334
335+------------------------+----------------------------------------------------+
336| ID | 02 |
337+========================+====================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200338| Threat | | **An attacker may attempt to boot outdated, |
Zelalem05fed522021-02-24 19:20:09 -0600339| | potentially vulnerable firmware image** |
340| | |
341| | | When updating firmware, an attacker may attempt |
342| | to rollback to an older version that has unfixed |
343| | vulnerabilities. |
344+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200345| Diagram Elements | DF1, DF4, DF5 |
Zelalem05fed522021-02-24 19:20:09 -0600346+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200347| Affected TF-A | BL2, BL31 |
348| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600349+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200350| Assets | Code Execution |
Zelalem05fed522021-02-24 19:20:09 -0600351+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200352| Threat Agent | PhysicalAccess, NSCode, SecCode |
Zelalem05fed522021-02-24 19:20:09 -0600353+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200354| Threat Type | Tampering |
Zelalem05fed522021-02-24 19:20:09 -0600355+------------------------+------------------+-----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200356| Application | Server | IoT | Mobile |
Zelalem05fed522021-02-24 19:20:09 -0600357+------------------------+------------------+-----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200358| Impact | Critical (5) | Critical (5) | Critical (5) |
Zelalem05fed522021-02-24 19:20:09 -0600359+------------------------+------------------+-----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200360| Likelihood | Critical (5) | Critical (5) | Critical (5) |
Zelalem05fed522021-02-24 19:20:09 -0600361+------------------------+------------------+-----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200362| Total Risk Rating | Critical (25) | Critical (25) | Critical (25) |
Zelalem05fed522021-02-24 19:20:09 -0600363+------------------------+------------------+-----------------+---------------+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200364| Mitigations | Implement anti-rollback protection using |
365| | non-volatile counters (NV counters) as required |
366| | by `TBBR-Client specification`_. |
367+------------------------+----------------------------------------------------+
368| Mitigations | | Yes / Platform specific. |
369| implemented? | |
370| | | After a firmware image is validated, the image |
371| | revision number taken from a certificate |
372| | extension field is compared with the |
373| | corresponding NV counter stored in hardware to |
374| | make sure the new counter value is larger than |
375| | the current counter value. |
376| | |
377| | | **Platforms must implement this protection using |
378| | platform specific hardware NV counters.** |
Zelalem05fed522021-02-24 19:20:09 -0600379+------------------------+----------------------------------------------------+
380
381+------------------------+-------------------------------------------------------+
382| ID | 03 |
383+========================+=======================================================+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200384| Threat | | **An attacker can use Time-of-Check-Time-of-Use |
Zelalem05fed522021-02-24 19:20:09 -0600385| | (TOCTOU) attack to bypass image authentication |
386| | during the boot process** |
387| | |
388| | | Time-of-Check-Time-of-Use (TOCTOU) threats occur |
389| | when the security check is produced before the time |
390| | the resource is accessed. If an attacker is sitting |
391| | in the middle of the off-chip images, they could |
392| | change the binary containing executable code right |
393| | after the integrity and authentication check has |
394| | been performed. |
395+------------------------+-------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200396| Diagram Elements | DF1 |
Zelalem05fed522021-02-24 19:20:09 -0600397+------------------------+-------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200398| Affected TF-A | BL1, BL2 |
399| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600400+------------------------+-------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200401| Assets | Code Execution, Sensitive Data |
Zelalem05fed522021-02-24 19:20:09 -0600402+------------------------+-------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200403| Threat Agent | PhysicalAccess |
Zelalem05fed522021-02-24 19:20:09 -0600404+------------------------+-------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200405| Threat Type | Elevation of Privilege |
Zelalem05fed522021-02-24 19:20:09 -0600406+------------------------+---------------------+-----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200407| Application | Server | IoT | Mobile |
Zelalem05fed522021-02-24 19:20:09 -0600408+------------------------+---------------------+-----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200409| Impact | N/A | Critical (5) | Critical (5) |
Zelalem05fed522021-02-24 19:20:09 -0600410+------------------------+---------------------+-----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200411| Likelihood | N/A | Medium (3) | Medium (3) |
Zelalem05fed522021-02-24 19:20:09 -0600412+------------------------+---------------------+-----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200413| Total Risk Rating | N/A | High (15) | High (15) |
Zelalem05fed522021-02-24 19:20:09 -0600414+------------------------+---------------------+-----------------+---------------+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200415| Mitigations | Copy image to on-chip memory before authenticating |
416| | it. |
417+------------------------+-------------------------------------------------------+
418| Mitigations | | Platform specific. |
419| implemented? | |
420| | | The list of images to load and their location is |
421| | platform specific. Platforms are responsible for |
422| | arranging images to be loaded in on-chip memory. |
Zelalem05fed522021-02-24 19:20:09 -0600423+------------------------+-------------------------------------------------------+
424
425+------------------------+-------------------------------------------------------+
426| ID | 04 |
427+========================+=======================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200428| Threat | | **An attacker with physical access can execute |
Zelalem05fed522021-02-24 19:20:09 -0600429| | arbitrary image by bypassing the signature |
430| | verification stage using glitching techniques** |
431| | |
432| | | Glitching (Fault injection) attacks attempt to put |
433| | a hardware into a undefined state by manipulating an|
434| | environmental variable such as power supply. |
435| | |
436| | | TF-A relies on a chain of trust that starts with the|
437| | ROTPK, which is the key stored inside the chip and |
438| | the root of all validation processes. If an attacker|
439| | can break this chain of trust, they could execute |
440| | arbitrary code on the device. This could be |
441| | achieved with physical access to the device by |
442| | attacking the normal execution flow of the |
443| | process using glitching techniques that target |
444| | points where the image is validated against the |
445| | signature. |
446+------------------------+-------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200447| Diagram Elements | DF1 |
Zelalem05fed522021-02-24 19:20:09 -0600448+------------------------+-------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200449| Affected TF-A | BL1, BL2 |
450| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600451+------------------------+-------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200452| Assets | Code Execution |
Zelalem05fed522021-02-24 19:20:09 -0600453+------------------------+-------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200454| Threat Agent | PhysicalAccess |
Zelalem05fed522021-02-24 19:20:09 -0600455+------------------------+-------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200456| Threat Type | Tampering, Elevation of Privilege |
Zelalem05fed522021-02-24 19:20:09 -0600457+------------------------+---------------------+-----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200458| Application | Server | IoT | Mobile |
Zelalem05fed522021-02-24 19:20:09 -0600459+------------------------+---------------------+-----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200460| Impact | N/A | Critical (5) | Critical (5) |
Zelalem05fed522021-02-24 19:20:09 -0600461+------------------------+---------------------+-----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200462| Likelihood | N/A | Medium (3) | Medium (3) |
Zelalem05fed522021-02-24 19:20:09 -0600463+------------------------+---------------------+-----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200464| Total Risk Rating | N/A | High (15) | High (15) |
Zelalem05fed522021-02-24 19:20:09 -0600465+------------------------+---------------------+-----------------+---------------+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200466| Mitigations | Mechanisms to detect clock glitch and power |
467| | variations. |
468+------------------------+-------------------------------------------------------+
469| Mitigations | | No. |
470| implemented? | |
471| | | The most effective mitigation is adding glitching |
Zelalem05fed522021-02-24 19:20:09 -0600472| | detection and mitigation circuit at the hardware |
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200473| | level. |
474| | |
475| | | However, software techniques, such as adding |
476| | redundant checks when performing conditional |
477| | branches that are security sensitive, can be used |
478| | to harden TF-A against such attacks. |
Zelalem05fed522021-02-24 19:20:09 -0600479| | **At the moment TF-A doesn't implement such |
480| | mitigations.** |
481+------------------------+-------------------------------------------------------+
482
483+------------------------+---------------------------------------------------+
484| ID | 05 |
485+========================+===================================================+
Sandrine Bailleuxb8d854d2022-05-16 13:57:38 +0200486| Threat | | **Information leak via UART logs** |
Zelalem05fed522021-02-24 19:20:09 -0600487| | |
488| | | During the development stages of software it is |
Sandrine Bailleuxb8d854d2022-05-16 13:57:38 +0200489| | common to print all sorts of information on the |
490| | console, including sensitive or confidential |
491| | information such as crash reports with detailed |
492| | information of the CPU state, current registers |
493| | values, privilege level or stack dumps. |
494| | |
495| | | This information is useful when debugging |
496| | problems before releasing the production |
497| | version but it could be used by an attacker |
498| | to develop a working exploit if left enabled in |
499| | the production version. |
500| | |
501| | | This happens when directly logging sensitive |
502| | information and more subtly when logging |
503| | side-channel information that can be used by an |
504| | attacker to learn about sensitive information. |
Zelalem05fed522021-02-24 19:20:09 -0600505+------------------------+---------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200506| Diagram Elements | DF2 |
Zelalem05fed522021-02-24 19:20:09 -0600507+------------------------+---------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200508| Affected TF-A | BL1, BL2, BL31 |
509| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600510+------------------------+---------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200511| Assets | Sensitive Data |
Zelalem05fed522021-02-24 19:20:09 -0600512+------------------------+---------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200513| Threat Agent | AppDebug |
Zelalem05fed522021-02-24 19:20:09 -0600514+------------------------+---------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200515| Threat Type | Information Disclosure |
Zelalem05fed522021-02-24 19:20:09 -0600516+------------------------+------------------+----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200517| Application | Server | IoT | Mobile |
Zelalem05fed522021-02-24 19:20:09 -0600518+------------------------+------------------+----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200519| Impact | N/A | Low (2) | Low (2) |
Zelalem05fed522021-02-24 19:20:09 -0600520+------------------------+------------------+----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200521| Likelihood | N/A | High (4) | High (4) |
Zelalem05fed522021-02-24 19:20:09 -0600522+------------------------+------------------+----------------+---------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200523| Total Risk Rating | N/A | Medium (8) | Medium (8) |
Zelalem05fed522021-02-24 19:20:09 -0600524+------------------------+------------------+----------------+---------------+
Sandrine Bailleuxb8d854d2022-05-16 13:57:38 +0200525| Mitigations | | Remove sensitive information logging in |
526| | production releases. |
527| | |
528| | | Do not conditionally log information depending |
529| | on potentially sensitive data. |
530| | |
531| | | Do not log high precision timing information. |
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200532+------------------------+---------------------------------------------------+
533| Mitigations | | Yes / Platform Specific. |
534| implemented? | Requires the right build options to be used. |
535| | |
536| | | Crash reporting is only enabled for debug |
537| | builds by default, see ``CRASH_REPORTING`` |
538| | build option. |
539| | |
540| | | The log level can be tuned at build time, from |
541| | very verbose to no output at all. See |
542| | ``LOG_LEVEL`` build option. By default, release |
543| | builds are a lot less verbose than debug ones |
544| | but still produce some output. |
545| | |
546| | | Messages produced by the platform code should |
547| | use the appropriate level of verbosity so as |
548| | not to leak sensitive information in production |
549| | builds. |
Zelalem05fed522021-02-24 19:20:09 -0600550+------------------------+---------------------------------------------------+
551
552+------------------------+----------------------------------------------------+
553| ID | 06 |
554+========================+====================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200555| Threat | | **An attacker can read sensitive data and |
Zelalem05fed522021-02-24 19:20:09 -0600556| | execute arbitrary code through the external |
557| | debug and trace interface** |
558| | |
559| | | Arm processors include hardware-assisted debug |
560| | and trace features that can be controlled without|
561| | the need for software operating on the platform. |
562| | If left enabled without authentication, this |
563| | feature can be used by an attacker to inspect and|
564| | modify TF-A registers and memory allowing the |
565| | attacker to read sensitive data and execute |
566| | arbitrary code. |
567+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200568| Diagram Elements | DF3 |
Zelalem05fed522021-02-24 19:20:09 -0600569+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200570| Affected TF-A | BL1, BL2, BL31 |
571| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600572+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200573| Assets | Code Execution, Sensitive Data |
Zelalem05fed522021-02-24 19:20:09 -0600574+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200575| Threat Agent | AppDebug |
Zelalem05fed522021-02-24 19:20:09 -0600576+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200577| Threat Type | Tampering, Information Disclosure, |
Zelalem05fed522021-02-24 19:20:09 -0600578| | Elevation of privilege |
579+------------------------+------------------+---------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200580| Application | Server | IoT | Mobile |
Zelalem05fed522021-02-24 19:20:09 -0600581+------------------------+------------------+---------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200582| Impact | N/A | High (4) | High (4) |
Zelalem05fed522021-02-24 19:20:09 -0600583+------------------------+------------------+---------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200584| Likelihood | N/A | Critical (5) | Critical (5) |
Zelalem05fed522021-02-24 19:20:09 -0600585+------------------------+------------------+---------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200586| Total Risk Rating | N/A | Critical (20) | Critical (20) |
Zelalem05fed522021-02-24 19:20:09 -0600587+------------------------+------------------+---------------+-----------------+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200588| Mitigations | Disable the debug and trace capability for |
589| | production releases or enable proper debug |
590| | authentication as recommended by [`DEN0034`_]. |
591+------------------------+----------------------------------------------------+
592| Mitigations | | Platform specific. |
593| implemented? | |
594| | | Configuration of debug and trace capabilities is |
595| | entirely platform specific. |
Zelalem05fed522021-02-24 19:20:09 -0600596+------------------------+----------------------------------------------------+
597
598+------------------------+------------------------------------------------------+
599| ID | 07 |
600+========================+======================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200601| Threat | | **An attacker can perform a denial-of-service |
Zelalem05fed522021-02-24 19:20:09 -0600602| | attack by using a broken SMC call that causes the |
603| | system to reboot or enter into unknown state.** |
604| | |
605| | | Secure and non-secure clients access TF-A services |
606| | through SMC calls. Malicious code can attempt to |
607| | place the TF-A runtime into an inconsistent state |
608| | by calling unimplemented SMC call or by passing |
609| | invalid arguments. |
610+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200611| Diagram Elements | DF4, DF5 |
Zelalem05fed522021-02-24 19:20:09 -0600612+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200613| Affected TF-A | BL31 |
614| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600615+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200616| Assets | Availability |
Zelalem05fed522021-02-24 19:20:09 -0600617+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200618| Threat Agent | NSCode, SecCode |
Zelalem05fed522021-02-24 19:20:09 -0600619+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200620| Threat Type | Denial of Service |
Zelalem05fed522021-02-24 19:20:09 -0600621+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200622| Application | Server | IoT | Mobile |
Zelalem05fed522021-02-24 19:20:09 -0600623+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200624| Impact | Medium (3) | Medium (3) | Medium (3) |
Zelalem05fed522021-02-24 19:20:09 -0600625+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200626| Likelihood | High (4) | High (4) | High (4) |
Zelalem05fed522021-02-24 19:20:09 -0600627+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200628| Total Risk Rating | High (12) | High (12) | High (12) |
Zelalem05fed522021-02-24 19:20:09 -0600629+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200630| Mitigations | Validate SMC function ids and arguments before using |
631| | them. |
632+------------------------+------------------------------------------------------+
633| Mitigations | | Yes / Platform specific. |
634| implemented? | |
635| | | For standard services, all input is validated. |
636| | |
637| | | Platforms that implement SiP services must also |
Zelalem05fed522021-02-24 19:20:09 -0600638| | validate SMC call arguments. |
639+------------------------+------------------------------------------------------+
640
641+------------------------+------------------------------------------------------+
642| ID | 08 |
643+========================+======================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200644| Threat | | **Memory corruption due to memory overflows and |
Zelalem05fed522021-02-24 19:20:09 -0600645| | lack of boundary checking when accessing resources |
646| | could allow an attacker to execute arbitrary code, |
647| | modify some state variable to change the normal |
648| | flow of the program, or leak sensitive |
649| | information** |
650| | |
Sandrine Bailleux0b816db2022-05-13 12:40:22 +0200651| | | Like in other software, TF-A has multiple points |
652| | where memory corruption security errors can arise. |
Zelalem05fed522021-02-24 19:20:09 -0600653| | |
654| | | Some of the errors include integer overflow, |
655| | buffer overflow, incorrect array boundary checks, |
656| | and incorrect error management. |
657| | Improper use of asserts instead of proper input |
658| | validations might also result in these kinds of |
659| | errors in release builds. |
660+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200661| Diagram Elements | DF4, DF5 |
Zelalem05fed522021-02-24 19:20:09 -0600662+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200663| Affected TF-A | BL1, BL2, BL31 |
664| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600665+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200666| Assets | Code Execution, Sensitive Data |
Zelalem05fed522021-02-24 19:20:09 -0600667+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200668| Threat Agent | NSCode, SecCode |
Zelalem05fed522021-02-24 19:20:09 -0600669+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200670| Threat Type | Tampering, Information Disclosure, |
Zelalem05fed522021-02-24 19:20:09 -0600671| | Elevation of Privilege |
672+------------------------+-------------------+-----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200673| Application | Server | IoT | Mobile |
Zelalem05fed522021-02-24 19:20:09 -0600674+------------------------+-------------------+-----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200675| Impact | Critical (5) | Critical (5) | Critical (5) |
Zelalem05fed522021-02-24 19:20:09 -0600676+------------------------+-------------------+-----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200677| Likelihood | Medium (3 | Medium (3) | Medium (3) |
Zelalem05fed522021-02-24 19:20:09 -0600678+------------------------+-------------------+-----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200679| Total Risk Rating | High (15) | High (15) | High (15) |
Zelalem05fed522021-02-24 19:20:09 -0600680+------------------------+-------------------+-----------------+----------------+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200681| Mitigations | | 1) Use proper input validation. |
Zelalem05fed522021-02-24 19:20:09 -0600682| | |
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200683| | | 2) Code reviews, testing. |
684+------------------------+------------------------------------------------------+
685| Mitigations | | 1) Yes. |
686| implemented? | Data received from normal world, such as addresses |
Zelalem05fed522021-02-24 19:20:09 -0600687| | and sizes identifying memory regions, are |
688| | sanitized before being used. These security checks |
689| | make sure that the normal world software does not |
690| | access memory beyond its limit. |
691| | |
692| | | By default *asserts* are only used to check for |
693| | programming errors in debug builds. Other types of |
694| | errors are handled through condition checks that |
695| | remain enabled in release builds. See |
696| | `TF-A error handling policy`_. TF-A provides an |
697| | option to use *asserts* in release builds, however |
698| | we recommend using proper runtime checks instead |
699| | of relying on asserts in release builds. |
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200700| | |
701| | | 2) Yes. |
702| | TF-A uses a combination of manual code reviews |
703| | and automated program analysis and testing to |
704| | detect and fix memory corruption bugs. All TF-A |
705| | code including platform code go through manual |
706| | code reviews. Additionally, static code analysis |
707| | is performed using Coverity Scan on all TF-A code. |
708| | The code is also tested with |
709| | `Trusted Firmware-A Tests`_ on Juno and FVP |
710| | platforms. |
Zelalem05fed522021-02-24 19:20:09 -0600711+------------------------+------------------------------------------------------+
712
713+------------------------+------------------------------------------------------+
714| ID | 09 |
715+========================+======================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200716| Threat | | **Improperly handled SMC calls can leak register |
Zelalem05fed522021-02-24 19:20:09 -0600717| | contents** |
718| | |
Sandrine Bailleux1c7d74e2022-05-12 16:37:18 +0200719| | | When switching between worlds, TF-A register state |
720| | can leak to software in different security |
721| | contexts. |
Zelalem05fed522021-02-24 19:20:09 -0600722+------------------------+------------------------------------------------------+
Sandrine Bailleux1c7d74e2022-05-12 16:37:18 +0200723| Diagram Elements | DF4, DF5 |
Zelalem05fed522021-02-24 19:20:09 -0600724+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200725| Affected TF-A | BL31 |
726| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600727+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200728| Assets | Sensitive Data |
Zelalem05fed522021-02-24 19:20:09 -0600729+------------------------+------------------------------------------------------+
Sandrine Bailleux1c7d74e2022-05-12 16:37:18 +0200730| Threat Agent | NSCode, SecCode |
Zelalem05fed522021-02-24 19:20:09 -0600731+------------------------+------------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200732| Threat Type | Information Disclosure |
Zelalem05fed522021-02-24 19:20:09 -0600733+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200734| Application | Server | IoT | Mobile |
Zelalem05fed522021-02-24 19:20:09 -0600735+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200736| Impact | Medium (3) | Medium (3) | Medium (3) |
Zelalem05fed522021-02-24 19:20:09 -0600737+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200738| Likelihood | High (4) | High (4) | High (4) |
Zelalem05fed522021-02-24 19:20:09 -0600739+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200740| Total Risk Rating | High (12) | High (12) | High (12) |
Zelalem05fed522021-02-24 19:20:09 -0600741+------------------------+-------------------+----------------+-----------------+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200742| Mitigations | Save and restore registers when switching contexts. |
743+------------------------+------------------------------------------------------+
744| Mitigations | | Yes. |
745| implemented? | |
746| | | This is the default behaviour in TF-A. |
747| | Build options are also provided to save/restore |
748| | additional registers such as floating-point |
749| | registers. These should be enabled if required. |
Zelalem05fed522021-02-24 19:20:09 -0600750+------------------------+------------------------------------------------------+
751
752+------------------------+-----------------------------------------------------+
753| ID | 10 |
754+========================+=====================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200755| Threat | | **SMC calls can leak sensitive information from |
Zelalem05fed522021-02-24 19:20:09 -0600756| | TF-A memory via microarchitectural side channels**|
757| | |
758| | | Microarchitectural side-channel attacks such as |
759| | `Spectre`_ can be used to leak data across |
760| | security boundaries. An attacker might attempt to |
761| | use this kind of attack to leak sensitive |
762| | data from TF-A memory. |
763+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200764| Diagram Elements | DF4, DF5 |
Zelalem05fed522021-02-24 19:20:09 -0600765+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200766| Affected TF-A | BL31 |
767| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600768+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200769| Assets | Sensitive Data |
Zelalem05fed522021-02-24 19:20:09 -0600770+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200771| Threat Agent | SecCode, NSCode |
Zelalem05fed522021-02-24 19:20:09 -0600772+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200773| Threat Type | Information Disclosure |
Zelalem05fed522021-02-24 19:20:09 -0600774+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200775| Application | Server | IoT | Mobile |
Zelalem05fed522021-02-24 19:20:09 -0600776+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200777| Impact | Medium (3) | Medium (3) | Medium (3) |
Zelalem05fed522021-02-24 19:20:09 -0600778+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200779| Likelihood | Medium (3) | Medium (3) | Medium (3) |
Zelalem05fed522021-02-24 19:20:09 -0600780+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200781| Total Risk Rating | Medium (9) | Medium (9) | Medium (9) |
Zelalem05fed522021-02-24 19:20:09 -0600782+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200783| Mitigations | Enable appropriate side-channel protections. |
784+------------------------+-----------------------------------------------------+
785| Mitigations | | Yes / Platform specific. |
786| implemented? | |
787| | | TF-A implements software mitigations for Spectre |
Zelalem05fed522021-02-24 19:20:09 -0600788| | type attacks as recommended by `Cache Speculation |
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200789| | Side-channels`_ for the generic code. |
790| | |
791| | | SiPs should implement similar mitigations for |
792| | code that is deemed to be vulnerable to such |
793| | attacks. |
Zelalem05fed522021-02-24 19:20:09 -0600794+------------------------+-----------------------------------------------------+
795
796+------------------------+----------------------------------------------------+
797| ID | 11 |
798+========================+====================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200799| Threat | | **Misconfiguration of the Memory Management Unit |
Zelalem05fed522021-02-24 19:20:09 -0600800| | (MMU) may allow a normal world software to |
Tamas Bancf151b72022-11-30 17:06:05 +0100801| | access sensitive data, execute arbitrary |
802| | code or access otherwise restricted HW |
803| | interface** |
Zelalem05fed522021-02-24 19:20:09 -0600804| | |
805| | | A misconfiguration of the MMU could |
806| | lead to an open door for software running in the |
807| | normal world to access sensitive data or even |
808| | execute code if the proper security mechanisms |
809| | are not in place. |
810+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200811| Diagram Elements | DF5, DF6 |
Zelalem05fed522021-02-24 19:20:09 -0600812+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200813| Affected TF-A | BL1, BL2, BL31 |
814| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600815+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200816| Assets | Sensitive Data, Code execution |
Zelalem05fed522021-02-24 19:20:09 -0600817+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200818| Threat Agent | NSCode |
Zelalem05fed522021-02-24 19:20:09 -0600819+------------------------+----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200820| Threat Type | Information Disclosure, Elevation of Privilege |
Zelalem05fed522021-02-24 19:20:09 -0600821+------------------------+-----------------+-----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200822| Application | Server | IoT | Mobile |
Zelalem05fed522021-02-24 19:20:09 -0600823+------------------------+-----------------+-----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200824| Impact | Critical (5) | Critical (5) | Critical (5) |
Zelalem05fed522021-02-24 19:20:09 -0600825+------------------------+-----------------+-----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200826| Likelihood | High (4) | High (4) | High (4) |
Zelalem05fed522021-02-24 19:20:09 -0600827+------------------------+-----------------+-----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200828| Total Risk Rating | Critical (20) | Critical (20) | Critical (20) |
Zelalem05fed522021-02-24 19:20:09 -0600829+------------------------+-----------------+-----------------+----------------+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200830| Mitigations | When configuring access permissions, the |
831| | principle of least privilege ought to be |
832| | enforced. This means we should not grant more |
833| | privileges than strictly needed, e.g. code |
834| | should be read-only executable, read-only data |
835| | should be read-only execute-never, and so on. |
836+------------------------+----------------------------------------------------+
837| Mitigations | | Platform specific. |
838| implemented? | |
839| | | MMU configuration is platform specific, |
840| | therefore platforms need to make sure that the |
841| | correct attributes are assigned to memory |
842| | regions. |
843| | |
844| | | TF-A provides a library which abstracts the |
845| | low-level details of MMU configuration. It |
846| | provides well-defined and tested APIs. |
847| | Platforms are encouraged to use it to limit the |
848| | risk of misconfiguration. |
Zelalem05fed522021-02-24 19:20:09 -0600849+------------------------+----------------------------------------------------+
850
851+------------------------+-----------------------------------------------------+
852| ID | 12 |
853+========================+=====================================================+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200854| Threat | | **Incorrect configuration of Performance Monitor |
Zelalem05fed522021-02-24 19:20:09 -0600855| | Unit (PMU) counters can allow an attacker to |
856| | mount side-channel attacks using information |
857| | exposed by the counters** |
858| | |
859| | | Non-secure software can configure PMU registers |
860| | to count events at any exception level and in |
861| | both Secure and Non-secure states. This allows |
862| | a Non-secure software (or a lower-level Secure |
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200863| | software) to potentially carry out |
Zelalem05fed522021-02-24 19:20:09 -0600864| | side-channel timing attacks against TF-A. |
865+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200866| Diagram Elements | DF5, DF6 |
Zelalem05fed522021-02-24 19:20:09 -0600867+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200868| Affected TF-A | BL31 |
869| Components | |
Zelalem05fed522021-02-24 19:20:09 -0600870+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200871| Assets | Sensitive Data |
Zelalem05fed522021-02-24 19:20:09 -0600872+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200873| Threat Agent | NSCode |
Zelalem05fed522021-02-24 19:20:09 -0600874+------------------------+-----------------------------------------------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200875| Threat Type | Information Disclosure |
Zelalem05fed522021-02-24 19:20:09 -0600876+------------------------+-------------------+----------------+----------------+
Tamas Bancf151b72022-11-30 17:06:05 +0100877| Application | Server | IoT | Mobile |
878+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200879| Impact | Medium (3) | Medium (3) | Medium (3) |
Zelalem05fed522021-02-24 19:20:09 -0600880+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200881| Likelihood | Low (2) | Low (2) | Low (2) |
Zelalem05fed522021-02-24 19:20:09 -0600882+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux6e5c2182022-05-10 14:55:01 +0200883| Total Risk Rating | Medium (6) | Medium (6) | Medium (6) |
Zelalem05fed522021-02-24 19:20:09 -0600884+------------------------+-------------------+----------------+----------------+
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200885| Mitigations | Follow mitigation strategies as described in |
886| | `Secure Development Guidelines`_. |
887+------------------------+-----------------------------------------------------+
888| Mitigations | | Yes / platform specific. |
889| implemented? | |
890| | | General events and cycle counting in the Secure |
891| | world is prohibited by default when applicable. |
892| | |
893| | | However, on some implementations (e.g. PMUv3) |
894| | Secure world event counting depends on external |
895| | debug interface signals, i.e. Secure world event |
896| | counting is enabled if external debug is enabled. |
897| | |
898| | | Configuration of debug signals is platform |
Zelalem05fed522021-02-24 19:20:09 -0600899| | specific, therefore platforms need to make sure |
900| | that external debug is disabled in production or |
Sandrine Bailleux94e70092022-05-13 12:39:56 +0200901| | proper debug authentication is in place. This |
902| | should be the case if threat #06 is properly |
903| | mitigated. |
Zelalem05fed522021-02-24 19:20:09 -0600904+------------------------+-----------------------------------------------------+
905
Tamas Bancf151b72022-11-30 17:06:05 +0100906+------------------------+-----------------------------------------------------+
907| ID | 13 |
908+========================+=====================================================+
909| Threat | | **Leaving sensitive information in the memory, |
910| | can allow an attacker to retrieve them.** |
911| | |
912| | | Accidentally leaving not-needed sensitive data in |
913| | internal buffers can leak them if an attacker |
914| | gains access to memory due to a vulnerability. |
915+------------------------+-----------------------------------------------------+
916| Diagram Elements | DF4, DF5 |
917+------------------------+-----------------------------------------------------+
918| Affected TF-A | BL1, BL2, BL31 |
919| Components | |
920+------------------------+-----------------------------------------------------+
921| Assets | Sensitive Data |
922+------------------------+-----------------------------------------------------+
923| Threat Agent | NSCode, SecCode |
924+------------------------+-----------------------------------------------------+
925| Threat Type | Information Disclosure |
926+------------------------+-------------------+----------------+----------------+
927| Application | Server | IoT | Mobile |
928+------------------------+-------------------+----------------+----------------+
929| Impact | Critical (5) | Critical (5) | Critical (5) |
930+------------------------+-------------------+----------------+----------------+
931| Likelihood | Medium (3) | Medium (3) | Medium (3) |
932+------------------------+-------------------+----------------+----------------+
933| Total Risk Rating | High (15) | High (15) | High (15) |
934+------------------------+-------------------+----------------+----------------+
935| Mitigations | Clear the sensitive data from internal buffers as |
936| | soon as they are not needed anymore. |
937+------------------------+-----------------------------------------------------+
938| Mitigations | | Yes / Platform specific |
939+------------------------+-----------------------------------------------------+
940
Jeffrey Kardatzke7e6b09a2022-10-03 15:50:21 -0700941+------------------------+-----------------------------------------------------+
942| ID | 14 |
943+========================+=====================================================+
Jeffrey Kardatzkeab7e5572023-02-09 11:03:17 -0800944| Threat | | **Attacker wants to execute an arbitrary or |
945| | untrusted binary as the secure OS.** |
Jeffrey Kardatzke7e6b09a2022-10-03 15:50:21 -0700946| | |
Jeffrey Kardatzkeab7e5572023-02-09 11:03:17 -0800947| | | When the option OPTEE_ALLOW_SMC_LOAD is enabled, |
948| | this trusts the non-secure world up until the |
949| | point it issues the SMC call to load the Secure |
950| | BL32 payload. If a compromise occurs before the |
951| | SMC call is invoked, then arbitrary code execution|
952| | in S-EL1 can occur or arbitrary memory in EL3 can |
953| | be overwritten. |
Jeffrey Kardatzke7e6b09a2022-10-03 15:50:21 -0700954+------------------------+-----------------------------------------------------+
955| Diagram Elements | DF5 |
956+------------------------+-----------------------------------------------------+
957| Affected TF-A | BL31, BL32 |
958| Components | |
959+------------------------+-----------------------------------------------------+
960| Assets | Code Execution, Sensitive Data |
961+------------------------+-----------------------------------------------------+
962| Threat Agent | NSCode |
963+------------------------+-----------------------------------------------------+
964| Threat Type | Tampering, Information Disclosure, |
965| | Elevation of privilege |
966+------------------------+-----------------+-----------------+-----------------+
967| Application | Server | IoT | Mobile |
968+------------------------+-----------------+-----------------+-----------------+
969| Impact | Critical (5) | Critical (5) | Critical (5) |
970+------------------------+-----------------+-----------------+-----------------+
Jeffrey Kardatzkeab7e5572023-02-09 11:03:17 -0800971| Likelihood | High (4) | High (4) | High (4) |
Jeffrey Kardatzke7e6b09a2022-10-03 15:50:21 -0700972+------------------------+-----------------+-----------------+-----------------+
Jeffrey Kardatzkeab7e5572023-02-09 11:03:17 -0800973| Total Risk Rating | Critical (20) | Critical (20) | Critical (20) |
Jeffrey Kardatzke7e6b09a2022-10-03 15:50:21 -0700974+------------------------+-----------------+-----------------+-----------------+
975| Mitigations | When enabling the option OPTEE_ALLOW_SMC_LOAD, |
976| | the non-secure OS must be considered a closed |
977| | platform up until the point the SMC can be invoked |
978| | to load OP-TEE. |
979+------------------------+-----------------------------------------------------+
980| Mitigations | | None in TF-A itself. This option is only used by |
981| implemented? | ChromeOS currently which has other mechanisms to |
982| | to mitigate this threat which are described in |
983| | `OP-TEE Dispatcher`_. |
984+------------------------+-----------------------------------------------------+
985
Zelalem05fed522021-02-24 19:20:09 -0600986--------------
987
Jeffrey Kardatzke7e6b09a2022-10-03 15:50:21 -0700988*Copyright (c) 2021-2023, Arm Limited. All rights reserved.*
Zelalem05fed522021-02-24 19:20:09 -0600989
990
991.. _STRIDE threat analysis technique: https://docs.microsoft.com/en-us/azure/security/develop/threat-modeling-tool-threats#stride-model
992.. _DEN0034: https://developer.arm.com/documentation/den0034/latest
993.. _Cache Speculation Side-channels: https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability
994.. _Spectre: https://developer.arm.com/support/arm-security-updates/speculative-processor-vulnerability
995.. _TBBR-Client specification: https://developer.arm.com/documentation/den0006/d/
996.. _Trusted Board Boot (TBB): https://trustedfirmware-a.readthedocs.io/en/latest/design/trusted-board-boot.html
997.. _TF-A error handling policy: https://trustedfirmware-a.readthedocs.io/en/latest/process/coding-guidelines.html#error-handling-and-robustness
998.. _Secure Development Guidelines: https://trustedfirmware-a.readthedocs.io/en/latest/process/security-hardening.html#secure-development-guidelines
Olivier Deprez86d1ffd2021-06-01 15:37:16 +0200999.. _Trusted Firmware-A Tests: https://git.trustedfirmware.org/TF-A/tf-a-tests.git/about/
Jeffrey Kardatzke7e6b09a2022-10-03 15:50:21 -07001000.. _OP-TEE Dispatcher: https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/components/spd/optee-dispatcher.rst