blob: 4e7bb143163f8654b7f90463b916191898ac4a84 [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
Janos Follathc51a4132023-03-14 12:47:27 +000024We classify attacks based on the capabilities of the attacker.
Janos Follath18d41732023-02-24 16:00:21 +000025
Janos Follath18d41732023-02-24 16:00:21 +000026### Remote attacks
27
Janos Follath9118bf52023-03-14 15:43:24 +000028In this section, we consider an attacker who can observe and modify data sent
29over the network. This includes observing the content and timing of individual
30packets, as well as suppressing or delaying legitimate messages, and injecting
31messages.
Janos Follath9ec195c2023-03-06 14:54:59 +000032
Janos Follath144dd7d2023-03-03 14:56:38 +000033Mbed TLS aims to fully protect against remote attacks and to enable the user
34application in providing full protection against remote attacks. Said
35protection is limited to providing security guarantees offered by the protocol
Janos Follathc51a4132023-03-14 12:47:27 +000036being implemented. (For example Mbed TLS alone won't guarantee that the
37messages will arrive without delay, as the TLS protocol doesn't guarantee that
38either.)
Janos Follath18d41732023-02-24 16:00:21 +000039
Janos Follathfef82fd2023-03-08 16:10:39 +000040### Local attacks
41
Janos Follath9118bf52023-03-14 15:43:24 +000042In this section, we consider an attacker who can run software on the same
43machine. The attacker has insufficient privileges to directly access Mbed TLS
44assets such as memory and files.
Janos Follathfef82fd2023-03-08 16:10:39 +000045
46#### Timing attacks
Janos Follath18d41732023-02-24 16:00:21 +000047
Janos Follath4317a9e2023-03-14 14:49:34 +000048The attacker is able to observe the timing of instructions executed by Mbed TLS
49by leveraging shared hardware that both Mbed TLS and the attacker have access
50to. Typical attack vectors include cache timings, memory bus contention and
51branch prediction.
Janos Follathfef82fd2023-03-08 16:10:39 +000052
Janos Follath144dd7d2023-03-03 14:56:38 +000053Mbed TLS provides limited protection against timing attacks. The cost of
54protecting against timing attacks widely varies depending on the granularity of
55the measurements and the noise present. Therefore the protection in Mbed TLS is
Janos Follathfef82fd2023-03-08 16:10:39 +000056limited. We are only aiming to provide protection against **publicly
Janos Follath4317a9e2023-03-14 14:49:34 +000057documented attack techniques**.
58
59As attacks keep improving, so does Mbed TLS's protection. Mbed TLS is moving
60towards a model of fully timing-invariant code, but has not reached this point
61yet.
Janos Follath042e4332023-03-08 20:07:59 +000062
63**Remark:** Timing information can be observed over the network or through
64physical side channels as well. Remote and physical timing attacks are covered
65in the [Remote attacks](remote-attacks) and [Physical
66attacks](physical-attacks) sections respectively.
Janos Follath18d41732023-02-24 16:00:21 +000067
Janos Follathfef82fd2023-03-08 16:10:39 +000068#### Local non-timing side channels
69
70The attacker code running on the platform has access to some sensor capable of
71picking up information on the physical state of the hardware while Mbed TLS is
Janos Follathc51a4132023-03-14 12:47:27 +000072running. This could for example be an analogue-to-digital converter on the
Janos Follathba759552023-03-14 14:54:44 +000073platform that is located unfortunately enough to pick up the CPU noise.
Janos Follathfef82fd2023-03-08 16:10:39 +000074
Janos Follathc51a4132023-03-14 12:47:27 +000075Mbed TLS doesn't make any security guarantees against local non-timing-based
Janos Follathfef82fd2023-03-08 16:10:39 +000076side channel attacks. If local non-timing attacks are present in a use case or
Janos Follathc51a4132023-03-14 12:47:27 +000077a user application's threat model, they need to be mitigated by the platform.
Janos Follathfef82fd2023-03-08 16:10:39 +000078
79#### Local fault injection attacks
80
81Software running on the same hardware can affect the physical state of the
Janos Follathba759552023-03-14 14:54:44 +000082device and introduce faults.
Janos Follathfef82fd2023-03-08 16:10:39 +000083
Janos Follathc51a4132023-03-14 12:47:27 +000084Mbed TLS doesn't make any security guarantees against local fault injection
Janos Follathfef82fd2023-03-08 16:10:39 +000085attacks. If local fault injection attacks are present in a use case or a user
Janos Follathc51a4132023-03-14 12:47:27 +000086application's threat model, they need to be mitigated by the platform.
Janos Follathfef82fd2023-03-08 16:10:39 +000087
Janos Follath18d41732023-02-24 16:00:21 +000088### Physical attacks
89
Janos Follath04fa1a42023-03-16 15:00:03 +000090In this section, we consider an attacker who has access to physical information
91about the hardware Mbed TLS is running on and/or can alter the physical state
92of the hardware (e.g. power analysis, radio emissions or fault injection).
Janos Follath9ec195c2023-03-06 14:54:59 +000093
Janos Follathc51a4132023-03-14 12:47:27 +000094Mbed TLS doesn't make any security guarantees against physical attacks. If
Janos Follath144dd7d2023-03-03 14:56:38 +000095physical attacks are present in a use case or a user application's threat
Janos Follathc51a4132023-03-14 12:47:27 +000096model, they need to be mitigated by physical countermeasures.
Janos Follathecaa2932023-03-08 16:38:07 +000097
98### Caveats
99
Janos Follathc51a4132023-03-14 12:47:27 +0000100#### Out-of-scope countermeasures
Janos Follathecaa2932023-03-08 16:38:07 +0000101
102Mbed TLS has evolved organically and a well defined threat model hasn't always
103been present. Therefore, Mbed TLS might have countermeasures against attacks
104outside the above defined threat model.
105
106The presence of such countermeasures don't mean that Mbed TLS provides
107protection against a class of attacks outside of the above described threat
108model. Neither does it mean that the failure of such a countermeasure is
109considered a vulnerability.
Janos Follath3d377602023-03-08 16:53:50 +0000110
David Horstmann2fe0da72025-01-22 14:27:22 +0000111#### Formatting of X.509 certificates and certificate signing requests
112
113When parsing X.509 certificates and certificate signing requests (CSRs),
114Mbed TLS does not check that they are strictly compliant with X.509 and other
115relevant standards. In the case of signed certificates, the signing party is
116assumed to have performed this validation (and the certificate is trusted to
117be correctly formatted as long as the signature is correct).
118Similarly, CSRs are implicitly trusted by Mbed TLS to be standards-compliant.
119
120**Warning!** Mbed TLS must not be used to sign untrusted CSRs unless extra
121validation is performed separately to ensure that they are compliant to the
David Horstmann0704fbf2025-01-23 10:28:06 +0000122relevant specifications. This makes Mbed TLS on its own unsuitable for use in
123a Certificate Authority (CA).
David Horstmannfaa1a0f2025-01-22 14:48:58 +0000124
125However, Mbed TLS aims to protect against memory corruption and other
126undefined behavior when parsing certificates and CSRs. If a CSR or signed
127certificate causes undefined behavior when it is parsed by Mbed TLS, that
128is considered a security vulnerability.