blob: 8d2337111cb26779dfc7e6080123243e7a5f7f2c [file] [log] [blame] [view]
Tom Cosgrovec71bc7b2022-07-29 13:54:52 +01001## Reporting Vulnerabilities
Manuel Pégourié-Gonnarda21abf22021-02-25 11:41:38 +01002
3If you think you have found an Mbed TLS security vulnerability, then please
4send an email to the security team at
5<mbed-tls-security@lists.trustedfirmware.org>.
6
7## Security Incident Handling Process
8
Shaun Case0e7791f2021-12-20 21:14:10 -08009Our security process is detailed in our
Gilles Peskinea23df132021-03-16 12:04:44 +010010[security
Manuel Pégourié-Gonnarda21abf22021-02-25 11:41:38 +010011center](https://developer.trustedfirmware.org/w/mbed-tls/security-center/).
12
13Its primary goal is to ensure fixes are ready to be deployed when the issue
14goes public.
15
16## Maintained branches
17
Gilles Peskinea23df132021-03-16 12:04:44 +010018Only the maintained branches, as listed in [`BRANCHES.md`](BRANCHES.md),
19get security fixes.
Manuel Pégourié-Gonnarda21abf22021-02-25 11:41:38 +010020Users are urged to always use the latest version of a maintained branch.
Janos Follathce2985b2023-02-24 16:00:21 +000021
22## Threat model
23
Janos Follath6ce259d2023-03-14 12:47:27 +000024We classify attacks based on the capabilities of the attacker.
Janos Follathce2985b2023-02-24 16:00:21 +000025
Janos Follathce2985b2023-02-24 16:00:21 +000026### Remote attacks
27
Janos Follath5adb2c22023-03-06 14:54:59 +000028The attacker can observe and modify data sent over the network. This includes
29observing the content and timing of individual packets, as well as suppressing
30or delaying legitimate messages, and injecting messages.
31
Janos Follathe57ed982023-03-03 14:56:38 +000032Mbed TLS aims to fully protect against remote attacks and to enable the user
33application in providing full protection against remote attacks. Said
34protection is limited to providing security guarantees offered by the protocol
Janos Follath6ce259d2023-03-14 12:47:27 +000035being implemented. (For example Mbed TLS alone won't guarantee that the
36messages will arrive without delay, as the TLS protocol doesn't guarantee that
37either.)
Janos Follathce2985b2023-02-24 16:00:21 +000038
Janos Follath6ce259d2023-03-14 12:47:27 +000039**Warning!** Block ciphers do not yet achieve full protection against attackers
40who can measure the timing of packets with sufficient precision. For details
41and workarounds see the [Block Ciphers](#block-ciphers) section.
Janos Follath5e68d3b2023-03-08 16:53:50 +000042
Janos Follathadc8a0b2023-03-08 16:10:39 +000043### Local attacks
44
Janos Follath18ffba62023-03-08 19:58:29 +000045The attacker can run software on the same machine. The attacker has
46insufficient privileges to directly access Mbed TLS assets such as memory and
47files.
Janos Follathadc8a0b2023-03-08 16:10:39 +000048
49#### Timing attacks
Janos Follathce2985b2023-02-24 16:00:21 +000050
Janos Follath08094b82023-03-14 14:49:34 +000051The attacker is able to observe the timing of instructions executed by Mbed TLS
52by leveraging shared hardware that both Mbed TLS and the attacker have access
53to. Typical attack vectors include cache timings, memory bus contention and
54branch prediction.
Janos Follathadc8a0b2023-03-08 16:10:39 +000055
Janos Follathe57ed982023-03-03 14:56:38 +000056Mbed TLS provides limited protection against timing attacks. The cost of
57protecting against timing attacks widely varies depending on the granularity of
58the measurements and the noise present. Therefore the protection in Mbed TLS is
Janos Follathadc8a0b2023-03-08 16:10:39 +000059limited. We are only aiming to provide protection against **publicly
Janos Follath08094b82023-03-14 14:49:34 +000060documented attack techniques**.
61
62As attacks keep improving, so does Mbed TLS's protection. Mbed TLS is moving
63towards a model of fully timing-invariant code, but has not reached this point
64yet.
Janos Follath8257d8a2023-03-08 20:07:59 +000065
66**Remark:** Timing information can be observed over the network or through
67physical side channels as well. Remote and physical timing attacks are covered
68in the [Remote attacks](remote-attacks) and [Physical
69attacks](physical-attacks) sections respectively.
Janos Follathce2985b2023-02-24 16:00:21 +000070
Janos Follath661c88f2023-03-03 14:16:12 +000071**Warning!** Block ciphers do not yet achieve full protection. For
Janos Follath5e68d3b2023-03-08 16:53:50 +000072details and workarounds see the [Block Ciphers](#block-ciphers) section.
Janos Follathce2985b2023-02-24 16:00:21 +000073
Janos Follathadc8a0b2023-03-08 16:10:39 +000074#### Local non-timing side channels
75
76The attacker code running on the platform has access to some sensor capable of
77picking up information on the physical state of the hardware while Mbed TLS is
Janos Follath6ce259d2023-03-14 12:47:27 +000078running. This could for example be an analogue-to-digital converter on the
Janos Follathe3d677c2023-03-14 14:54:44 +000079platform that is located unfortunately enough to pick up the CPU noise.
Janos Follathadc8a0b2023-03-08 16:10:39 +000080
Janos Follath6ce259d2023-03-14 12:47:27 +000081Mbed TLS doesn't make any security guarantees against local non-timing-based
Janos Follathadc8a0b2023-03-08 16:10:39 +000082side channel attacks. If local non-timing attacks are present in a use case or
Janos Follath6ce259d2023-03-14 12:47:27 +000083a user application's threat model, they need to be mitigated by the platform.
Janos Follathadc8a0b2023-03-08 16:10:39 +000084
85#### Local fault injection attacks
86
87Software running on the same hardware can affect the physical state of the
Janos Follathe3d677c2023-03-14 14:54:44 +000088device and introduce faults.
Janos Follathadc8a0b2023-03-08 16:10:39 +000089
Janos Follath6ce259d2023-03-14 12:47:27 +000090Mbed TLS doesn't make any security guarantees against local fault injection
Janos Follathadc8a0b2023-03-08 16:10:39 +000091attacks. If local fault injection attacks are present in a use case or a user
Janos Follath6ce259d2023-03-14 12:47:27 +000092application's threat model, they need to be mitigated by the platform.
Janos Follathadc8a0b2023-03-08 16:10:39 +000093
Janos Follathce2985b2023-02-24 16:00:21 +000094### Physical attacks
95
Janos Follath5adb2c22023-03-06 14:54:59 +000096The attacker has access to physical information about the hardware Mbed TLS is
Janos Follath6ce259d2023-03-14 12:47:27 +000097running on and/or can alter the physical state of the hardware (e.g. power
Janos Follathadc8a0b2023-03-08 16:10:39 +000098analysis, radio emissions or fault injection).
Janos Follath5adb2c22023-03-06 14:54:59 +000099
Janos Follath6ce259d2023-03-14 12:47:27 +0000100Mbed TLS doesn't make any security guarantees against physical attacks. If
Janos Follathe57ed982023-03-03 14:56:38 +0000101physical attacks are present in a use case or a user application's threat
Janos Follath6ce259d2023-03-14 12:47:27 +0000102model, they need to be mitigated by physical countermeasures.
Janos Follath389cdf42023-03-08 16:38:07 +0000103
104### Caveats
105
Janos Follath6ce259d2023-03-14 12:47:27 +0000106#### Out-of-scope countermeasures
Janos Follath389cdf42023-03-08 16:38:07 +0000107
108Mbed TLS has evolved organically and a well defined threat model hasn't always
109been present. Therefore, Mbed TLS might have countermeasures against attacks
110outside the above defined threat model.
111
112The presence of such countermeasures don't mean that Mbed TLS provides
113protection against a class of attacks outside of the above described threat
114model. Neither does it mean that the failure of such a countermeasure is
115considered a vulnerability.
Janos Follath5e68d3b2023-03-08 16:53:50 +0000116
117#### Block ciphers
118
119Currently there are four block ciphers in Mbed TLS: AES, CAMELLIA, ARIA and
120DES. The pure software implementation in Mbed TLS implementation uses lookup
121tables, which are vulnerable to timing attacks.
122
123These timing attacks can be physical, local or depending on network latency
124even a remote. The attacks can result in key recovery.
125
126**Workarounds:**
127
128- Turn on hardware acceleration for AES. This is supported only on selected
129 architectures and currently only available for AES. See configuration options
130 `MBEDTLS_AESCE_C`, `MBEDTLS_AESNI_C` and `MBEDTLS_PADLOCK_C` for details.
131- Add a secure alternative implementation (typically hardware acceleration) for
132 the vulnerable cipher. See the [Alternative Implementations
133Guide](docs/architecture/alternative-implementations.md) for more information.
134- Use cryptographic mechanisms that are not based on block ciphers. In
135 particular, for authenticated encryption, use ChaCha20/Poly1305 instead of
136 block cipher modes. For random generation, use HMAC\_DRBG instead of CTR\_DRBG.