Tom Cosgrove | 0b86ac1 | 2022-07-29 13:44:01 +0100 | [diff] [blame] | 1 | ## Reporting Vulnerabilities |
Manuel Pégourié-Gonnard | a21abf2 | 2021-02-25 11:41:38 +0100 | [diff] [blame] | 2 | |
| 3 | If you think you have found an Mbed TLS security vulnerability, then please |
| 4 | send an email to the security team at |
| 5 | <mbed-tls-security@lists.trustedfirmware.org>. |
| 6 | |
| 7 | ## Security Incident Handling Process |
| 8 | |
Shaun Case | 8b0ecbc | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 9 | Our security process is detailed in our |
Gilles Peskine | a23df13 | 2021-03-16 12:04:44 +0100 | [diff] [blame] | 10 | [security |
Manuel Pégourié-Gonnard | a21abf2 | 2021-02-25 11:41:38 +0100 | [diff] [blame] | 11 | center](https://developer.trustedfirmware.org/w/mbed-tls/security-center/). |
| 12 | |
| 13 | Its primary goal is to ensure fixes are ready to be deployed when the issue |
| 14 | goes public. |
| 15 | |
| 16 | ## Maintained branches |
| 17 | |
Gilles Peskine | a23df13 | 2021-03-16 12:04:44 +0100 | [diff] [blame] | 18 | Only the maintained branches, as listed in [`BRANCHES.md`](BRANCHES.md), |
| 19 | get security fixes. |
Manuel Pégourié-Gonnard | a21abf2 | 2021-02-25 11:41:38 +0100 | [diff] [blame] | 20 | Users are urged to always use the latest version of a maintained branch. |
Janos Follath | 18d4173 | 2023-02-24 16:00:21 +0000 | [diff] [blame] | 21 | |
| 22 | ## Threat model |
| 23 | |
| 24 | We use the following classification of attacks: |
| 25 | |
Janos Follath | 18d4173 | 2023-02-24 16:00:21 +0000 | [diff] [blame] | 26 | ### Remote attacks |
| 27 | |
Janos Follath | 9ec195c | 2023-03-06 14:54:59 +0000 | [diff] [blame] | 28 | The attacker can observe and modify data sent over the network. This includes |
| 29 | observing the content and timing of individual packets, as well as suppressing |
| 30 | or delaying legitimate messages, and injecting messages. |
| 31 | |
Janos Follath | 144dd7d | 2023-03-03 14:56:38 +0000 | [diff] [blame] | 32 | Mbed TLS aims to fully protect against remote attacks and to enable the user |
| 33 | application in providing full protection against remote attacks. Said |
| 34 | protection is limited to providing security guarantees offered by the protocol |
| 35 | in question. (For example Mbed TLS alone won't guarantee that the messages will |
| 36 | arrive without delay, as the TLS protocol doesn't guarantee that either.) |
Janos Follath | 18d4173 | 2023-02-24 16:00:21 +0000 | [diff] [blame] | 37 | |
Janos Follath | 3d37760 | 2023-03-08 16:53:50 +0000 | [diff] [blame] | 38 | **Warning!** Depending on network latency, the timing of messages might be |
| 39 | enough to launch some timing attacks. Block ciphers do not yet achieve full |
| 40 | protection against these. For details and workarounds see the [Block |
| 41 | Ciphers](#block-ciphers) section. |
| 42 | |
Janos Follath | fef82fd | 2023-03-08 16:10:39 +0000 | [diff] [blame] | 43 | ### Local attacks |
| 44 | |
Janos Follath | d5a0940 | 2023-03-08 19:58:29 +0000 | [diff] [blame^] | 45 | The attacker can run software on the same machine. The attacker has |
| 46 | insufficient privileges to directly access Mbed TLS assets such as memory and |
| 47 | files. |
Janos Follath | fef82fd | 2023-03-08 16:10:39 +0000 | [diff] [blame] | 48 | |
| 49 | #### Timing attacks |
Janos Follath | 18d4173 | 2023-02-24 16:00:21 +0000 | [diff] [blame] | 50 | |
Janos Follath | d5a0940 | 2023-03-08 19:58:29 +0000 | [diff] [blame^] | 51 | The attacker is able to observe the timing of instructions executed by Mbed |
| 52 | TLS.(See for example the [Flush+Reload |
Janos Follath | fef82fd | 2023-03-08 16:10:39 +0000 | [diff] [blame] | 53 | paper](https://eprint.iacr.org/2013/448.pdf).) |
| 54 | |
| 55 | (Technically, timing information can be observed over the network or through |
| 56 | physical side channels as well. Network timing attacks are less powerful than |
| 57 | local and countermeasures protecting against local attacks prevent network |
| 58 | attacks as well. If the timing information is gained through physical side |
| 59 | channels, we consider them physical attacks and as such they are out of scope.) |
Janos Follath | 9ec195c | 2023-03-06 14:54:59 +0000 | [diff] [blame] | 60 | |
Janos Follath | 144dd7d | 2023-03-03 14:56:38 +0000 | [diff] [blame] | 61 | Mbed TLS provides limited protection against timing attacks. The cost of |
| 62 | protecting against timing attacks widely varies depending on the granularity of |
| 63 | the measurements and the noise present. Therefore the protection in Mbed TLS is |
Janos Follath | fef82fd | 2023-03-08 16:10:39 +0000 | [diff] [blame] | 64 | limited. We are only aiming to provide protection against **publicly |
| 65 | documented** attacks, and this protection is not currently complete. |
Janos Follath | 18d4173 | 2023-02-24 16:00:21 +0000 | [diff] [blame] | 66 | |
Janos Follath | 24792d0 | 2023-03-03 14:16:12 +0000 | [diff] [blame] | 67 | **Warning!** Block ciphers do not yet achieve full protection. For |
Janos Follath | 3d37760 | 2023-03-08 16:53:50 +0000 | [diff] [blame] | 68 | details and workarounds see the [Block Ciphers](#block-ciphers) section. |
Janos Follath | 18d4173 | 2023-02-24 16:00:21 +0000 | [diff] [blame] | 69 | |
Janos Follath | fef82fd | 2023-03-08 16:10:39 +0000 | [diff] [blame] | 70 | #### Local non-timing side channels |
| 71 | |
| 72 | The attacker code running on the platform has access to some sensor capable of |
| 73 | picking up information on the physical state of the hardware while Mbed TLS is |
| 74 | running. This can for example be any analogue to digital converter on the |
| 75 | platform that is located unfortunately enough to pick up the CPU noise. (See |
| 76 | for example the [Leaky Noise |
| 77 | paper](https://tches.iacr.org/index.php/TCHES/article/view/8297).) |
| 78 | |
| 79 | Mbed TLS doesn't offer any security guarantees against local non-timing based |
| 80 | side channel attacks. If local non-timing attacks are present in a use case or |
| 81 | a user application's threat model, it needs to be mitigated by the platform. |
| 82 | |
| 83 | #### Local fault injection attacks |
| 84 | |
| 85 | Software running on the same hardware can affect the physical state of the |
| 86 | device and introduce faults. (See for example the [Row Hammer |
| 87 | paper](https://users.ece.cmu.edu/~yoonguk/papers/kim-isca14.pdf).) |
| 88 | |
| 89 | Mbed TLS doesn't offer any security guarantees against local fault injection |
| 90 | attacks. If local fault injection attacks are present in a use case or a user |
| 91 | application's threat model, it needs to be mitigated by the platform. |
| 92 | |
Janos Follath | 18d4173 | 2023-02-24 16:00:21 +0000 | [diff] [blame] | 93 | ### Physical attacks |
| 94 | |
Janos Follath | 9ec195c | 2023-03-06 14:54:59 +0000 | [diff] [blame] | 95 | The attacker has access to physical information about the hardware Mbed TLS is |
Janos Follath | fef82fd | 2023-03-08 16:10:39 +0000 | [diff] [blame] | 96 | running on and/or can alter the physical state of the hardware (eg. power |
| 97 | analysis, radio emissions or fault injection). |
Janos Follath | 9ec195c | 2023-03-06 14:54:59 +0000 | [diff] [blame] | 98 | |
Janos Follath | fef82fd | 2023-03-08 16:10:39 +0000 | [diff] [blame] | 99 | Mbed TLS doesn't offer any security guarantees against physical attacks. If |
Janos Follath | 144dd7d | 2023-03-03 14:56:38 +0000 | [diff] [blame] | 100 | physical attacks are present in a use case or a user application's threat |
| 101 | model, it needs to be mitigated by physical countermeasures. |
Janos Follath | ecaa293 | 2023-03-08 16:38:07 +0000 | [diff] [blame] | 102 | |
| 103 | ### Caveats |
| 104 | |
| 105 | #### Out of scope countermeasures |
| 106 | |
| 107 | Mbed TLS has evolved organically and a well defined threat model hasn't always |
| 108 | been present. Therefore, Mbed TLS might have countermeasures against attacks |
| 109 | outside the above defined threat model. |
| 110 | |
| 111 | The presence of such countermeasures don't mean that Mbed TLS provides |
| 112 | protection against a class of attacks outside of the above described threat |
| 113 | model. Neither does it mean that the failure of such a countermeasure is |
| 114 | considered a vulnerability. |
Janos Follath | 3d37760 | 2023-03-08 16:53:50 +0000 | [diff] [blame] | 115 | |
| 116 | #### Block ciphers |
| 117 | |
| 118 | Currently there are four block ciphers in Mbed TLS: AES, CAMELLIA, ARIA and |
| 119 | DES. The pure software implementation in Mbed TLS implementation uses lookup |
| 120 | tables, which are vulnerable to timing attacks. |
| 121 | |
| 122 | These timing attacks can be physical, local or depending on network latency |
| 123 | even a remote. The attacks can result in key recovery. |
| 124 | |
| 125 | **Workarounds:** |
| 126 | |
| 127 | - Turn on hardware acceleration for AES. This is supported only on selected |
| 128 | architectures and currently only available for AES. See configuration options |
| 129 | `MBEDTLS_AESCE_C`, `MBEDTLS_AESNI_C` and `MBEDTLS_PADLOCK_C` for details. |
| 130 | - Add a secure alternative implementation (typically hardware acceleration) for |
| 131 | the vulnerable cipher. See the [Alternative Implementations |
| 132 | Guide](docs/architecture/alternative-implementations.md) for more information. |
| 133 | - Use cryptographic mechanisms that are not based on block ciphers. In |
| 134 | particular, for authenticated encryption, use ChaCha20/Poly1305 instead of |
| 135 | block cipher modes. For random generation, use HMAC\_DRBG instead of CTR\_DRBG. |