blob: 387221e61f0351136f7b7cca1eb400e74085285c [file] [log] [blame] [view]
Tom Cosgrove0b86ac12022-07-29 13:44:01 +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 Case8b0ecbc2021-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 Follath18d41732023-02-24 16:00:21 +000021
22## Threat model
23
24We use the following classification of attacks:
25
Janos Follath18d41732023-02-24 16:00:21 +000026### Remote attacks
27
Janos Follath9ec195c2023-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 Follath144dd7d2023-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
35in question. (For example Mbed TLS alone won't guarantee that the messages will
36arrive without delay, as the TLS protocol doesn't guarantee that either.)
Janos Follath18d41732023-02-24 16:00:21 +000037
Janos Follath3d377602023-03-08 16:53:50 +000038**Warning!** Depending on network latency, the timing of messages might be
39enough to launch some timing attacks. Block ciphers do not yet achieve full
40protection against these. For details and workarounds see the [Block
41Ciphers](#block-ciphers) section.
42
Janos Follathfef82fd2023-03-08 16:10:39 +000043### Local attacks
44
Janos Follathd5a09402023-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 Follathfef82fd2023-03-08 16:10:39 +000048
49#### Timing attacks
Janos Follath18d41732023-02-24 16:00:21 +000050
Janos Follathd5a09402023-03-08 19:58:29 +000051The attacker is able to observe the timing of instructions executed by Mbed
52TLS.(See for example the [Flush+Reload
Janos Follathfef82fd2023-03-08 16:10:39 +000053paper](https://eprint.iacr.org/2013/448.pdf).)
54
Janos Follath144dd7d2023-03-03 14:56:38 +000055Mbed TLS provides limited protection against timing attacks. The cost of
56protecting against timing attacks widely varies depending on the granularity of
57the measurements and the noise present. Therefore the protection in Mbed TLS is
Janos Follathfef82fd2023-03-08 16:10:39 +000058limited. We are only aiming to provide protection against **publicly
Janos Follath042e4332023-03-08 20:07:59 +000059documented** attacks.
60
61**Remark:** Timing information can be observed over the network or through
62physical side channels as well. Remote and physical timing attacks are covered
63in the [Remote attacks](remote-attacks) and [Physical
64attacks](physical-attacks) sections respectively.
Janos Follath18d41732023-02-24 16:00:21 +000065
Janos Follath24792d02023-03-03 14:16:12 +000066**Warning!** Block ciphers do not yet achieve full protection. For
Janos Follath3d377602023-03-08 16:53:50 +000067details and workarounds see the [Block Ciphers](#block-ciphers) section.
Janos Follath18d41732023-02-24 16:00:21 +000068
Janos Follathfef82fd2023-03-08 16:10:39 +000069#### Local non-timing side channels
70
71The attacker code running on the platform has access to some sensor capable of
72picking up information on the physical state of the hardware while Mbed TLS is
73running. This can for example be any analogue to digital converter on the
74platform that is located unfortunately enough to pick up the CPU noise. (See
75for example the [Leaky Noise
76paper](https://tches.iacr.org/index.php/TCHES/article/view/8297).)
77
78Mbed TLS doesn't offer any security guarantees against local non-timing based
79side channel attacks. If local non-timing attacks are present in a use case or
80a user application's threat model, it needs to be mitigated by the platform.
81
82#### Local fault injection attacks
83
84Software running on the same hardware can affect the physical state of the
85device and introduce faults. (See for example the [Row Hammer
86paper](https://users.ece.cmu.edu/~yoonguk/papers/kim-isca14.pdf).)
87
88Mbed TLS doesn't offer any security guarantees against local fault injection
89attacks. If local fault injection attacks are present in a use case or a user
90application's threat model, it needs to be mitigated by the platform.
91
Janos Follath18d41732023-02-24 16:00:21 +000092### Physical attacks
93
Janos Follath9ec195c2023-03-06 14:54:59 +000094The attacker has access to physical information about the hardware Mbed TLS is
Janos Follathfef82fd2023-03-08 16:10:39 +000095running on and/or can alter the physical state of the hardware (eg. power
96analysis, radio emissions or fault injection).
Janos Follath9ec195c2023-03-06 14:54:59 +000097
Janos Follathfef82fd2023-03-08 16:10:39 +000098Mbed TLS doesn't offer any security guarantees against physical attacks. If
Janos Follath144dd7d2023-03-03 14:56:38 +000099physical attacks are present in a use case or a user application's threat
100model, it needs to be mitigated by physical countermeasures.
Janos Follathecaa2932023-03-08 16:38:07 +0000101
102### Caveats
103
104#### Out of scope countermeasures
105
106Mbed TLS has evolved organically and a well defined threat model hasn't always
107been present. Therefore, Mbed TLS might have countermeasures against attacks
108outside the above defined threat model.
109
110The presence of such countermeasures don't mean that Mbed TLS provides
111protection against a class of attacks outside of the above described threat
112model. Neither does it mean that the failure of such a countermeasure is
113considered a vulnerability.
Janos Follath3d377602023-03-08 16:53:50 +0000114
115#### Block ciphers
116
117Currently there are four block ciphers in Mbed TLS: AES, CAMELLIA, ARIA and
118DES. The pure software implementation in Mbed TLS implementation uses lookup
119tables, which are vulnerable to timing attacks.
120
121These timing attacks can be physical, local or depending on network latency
122even a remote. The attacks can result in key recovery.
123
124**Workarounds:**
125
126- Turn on hardware acceleration for AES. This is supported only on selected
127 architectures and currently only available for AES. See configuration options
128 `MBEDTLS_AESCE_C`, `MBEDTLS_AESNI_C` and `MBEDTLS_PADLOCK_C` for details.
129- Add a secure alternative implementation (typically hardware acceleration) for
130 the vulnerable cipher. See the [Alternative Implementations
131Guide](docs/architecture/alternative-implementations.md) for more information.
132- Use cryptographic mechanisms that are not based on block ciphers. In
133 particular, for authenticated encryption, use ChaCha20/Poly1305 instead of
134 block cipher modes. For random generation, use HMAC\_DRBG instead of CTR\_DRBG.