34704 Commits

Author SHA1 Message Date
Ben Taylor
1aa1254546 Fix style issue
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-10 14:15:48 +01:00
Ronald Cron
1070ab8dd7
Merge pull request #1563 from minosgalanakis/security/mlfbyt4c_tls13_policy_bypass
TLS1.3 client HRR policy bypass[ARM-MLFBYT4C]
2026-06-10 13:04:24 +02:00
Ben Taylor
273c9b38b7 Correct syntax of MBEDTLS_GET_UINT32_BE in write_new_session_ticket_mem
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-10 08:38:36 +01:00
Ben Taylor
cecb4c2162 Correct ChangeLog style
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-10 08:21:05 +01:00
Ben Taylor
911b9b67db
Add CVE ID to ChangeLog
Co-authored-by: Gilles Peskine <gilles.peskine@arm.com>
Signed-off-by: Ben Taylor <32939606+bjwtaylor@users.noreply.github.com>
2026-06-08 15:48:14 +01:00
Ben Taylor
0c62b498bd Add ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-08 15:46:00 +01:00
Ben Taylor
33c55a90e3 Improve test of non-initilisation of lifetime
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-08 15:39:17 +01:00
Ben Taylor
38185e2308 Improve robustness of tlen and lifetime variables
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-08 15:39:17 +01:00
Ben Taylor
a5c2e02198 Add fix for leak
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-08 15:39:17 +01:00
Ben Taylor
f5675fd064 Add test for leak
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-08 15:39:17 +01:00
Ben Taylor
5e04a32840
Add CVE to ChangeLog
Co-authored-by: Ronald Cron <ronald.cron@arm.com>
Signed-off-by: Ben Taylor <32939606+bjwtaylor@users.noreply.github.com>
2026-06-08 15:13:37 +01:00
Ben Taylor
4b32430d3c
Improve the wording of the ChangeLog
Co-authored-by: Ronald Cron <ronald.cron@arm.com>
Signed-off-by: Ben Taylor <32939606+bjwtaylor@users.noreply.github.com>
2026-06-08 15:13:02 +01:00
Ronald Cron
5cd633798c
Merge pull request #10769 from mpg/security-link-dev
Update broken link in SECURITY.md
2026-06-05 15:44:33 +00:00
Gilles Peskine
e94a7a2d22 Add CVE-ID
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:35:46 +02:00
Gilles Peskine
ca89089968 Add attribution for the second bug
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:35:46 +02:00
Gilles Peskine
402592db1d Update dependencies in forward port from 3.6
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:35:46 +02:00
Gilles Peskine
f624adff2e Switch to MBEDTLS_ERROR_ADD for combining X509 and ASN1 error codes
Since Mbed TLS 4.0, this is just the low-level error code. But keep the
combination for uniformity with the rest of the file, and to reduce the
differences with the 3.6 branch.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:35:46 +02:00
Gilles Peskine
045cede1b8 basicConstraints with leading INTEGER field: document the behavior change
Announce the security fix together with the overflow fix, since the two bugs
are pretty much indistinguishable from a black-box perspective, despite
being due to independent problems in the code.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:35:46 +02:00
Gilles Peskine
0d6060d644 Stop accepting basicConstraints with only pathLenConstraint
In an X.509 certificate, a basicConstraints extension where the cA
field (BOOLEAN) is omitted but the pathLenConstraint field (INTEGER )is
present is syntactically valid, but RFC 5280 states that CAs MUST NOT emit
such a certificate.

Historically, since XySSL 0.9 in 2008, if a basicConstraints extension
started with an INTEGER field, we interpreted that field as a cA value. This
was a deliberate change:

> Fixed x509_get_ext() to accept some rare certificates (like
> www.openssl.org:443) which have an INTEGER instead of a BOOLEAN for
> Extension::BasicConstraints::cA.

However, 18 years later, this does not seem to be relevant, and the details
seem to have been lost. Furthermore, major implementations follow RFC 5280
and interpret `SEQUENCE { INTEGER n }` with cA being set to its default
value (FALSE) and pathLenConstraint set to `n`. This means that such a
certificate with n != 0 would be interpreted as a CA certificate in Mbed TLS
but as a leaf certificate elsewhere, which is dangerous.

Since CAs are not supposed to emit such certificates, stop accepting them
altogether.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:35:46 +02:00
Gilles Peskine
5cc6fb22c6 basicConstraints pathLenConstraint tests: use standard cA type
In test cases for pathLenConstraint parsing in a basicConstraints extension
of an X.509 certificate, use the standard type for the leading cA field,
namely BOOLEAN. The test data was encoding that field as INTEGER, which was
accepted as a deviation from the standard since XySSL 0.9.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:35:46 +02:00
Gilles Peskine
eb051b501a Remove unreachable CSR extensionRequest check
It is now unreachable because:

- end_set == end_attr_data is enforced at library/x509_csr.c:236.
- end_exts == end_set is enforced at library/x509_csr.c:248.
- x509_csr_parse_extensions() only returns success if *p == end_exts, enforced
  at library/x509_csr.c:188.

So after a successful x509_csr_parse_extensions() call, *p == end_exts ==
end_set == end_attr_data. The condition at line 257 cannot be true.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:35:41 +02:00
Gilles Peskine
cc794d8501 Tighten CSR extensionRequest bounds
Don't allow parts of a compound (SEQUENCE or SET) to go beyond the
containing compound.

The inline CSR regression test is derived from the existing "X509 CSR
ASN.1 (OK)" DER test vector. In the extensionRequest attribute, the original
well-formed fragment is:

    a029 3027 06092a864886f70d01090e 311a 3018 ...

where 31 1a is the SET containing the Extensions sequence and 30 18 is the
contained Extensions sequence. The malformed test changes only the SET
length byte, from 1a to 19:

    a029 3027 06092a864886f70d01090e 3119 3018 ...

The attribute SEQUENCE length and the inner Extensions sequence length are
left unchanged. This makes the SET one byte too short for its containing
attribute, so the parser must reject it with
MBEDTLS_ERR_ASN1_LENGTH_MISMATCH instead of parsing the trailing byte as
data outside the SET.

There is no known security impact, just some risk reduction.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-06-05 11:35:38 +02:00
Ben Taylor
a7c0d83354 Add improvements to ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-05 10:22:49 +01:00
Ben Taylor
ab2a7d5a34 Add reported by and CVE placeholder
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-04 14:22:38 +01:00
Ben Taylor
0501e447cc Correct style of ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-04 14:22:38 +01:00
Ben Taylor
c567299ee6 Add in tests for ECDHE-PSK integer overflow
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-04 14:22:38 +01:00
Ben Taylor
c058818451 Improve ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-04 14:22:38 +01:00
Ben Taylor
e71e49e634 Add ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-04 14:22:38 +01:00
Ben Taylor
baf449db7e Added fix for Integer overflow using a large ECDHE Identity
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-06-04 14:22:38 +01:00
Manuel Pégourié-Gonnard
af15f6e244 Update broken link
I believe the existing link was to the TF wiki which has been retired
for some time now.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2026-06-03 10:33:29 +02:00
Ronald Cron
5ca2218a28
Merge pull request #1589 from gilles-peskine-arm/ssl_tls13_prepare_new_session_ticket-psa_get_random-4.1
Fix ssl_tls13_prepare_new_session_ticket returning 1 on an RNG failure
2026-05-29 16:20:27 +02:00
Ronald Cron
05bd7f6429
Merge pull request #1612 from valeriosetti/issue1569
[development] TLS 1.3 certificate chain signature algorithm policy gap
2026-05-29 13:35:32 +02:00
Gilles Peskine
b05434c1b1 Improve changelog wording
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-05-28 16:32:35 +02:00
Gilles Peskine
6c8ae1ea48 Fix lax basicConstraints parsing
When parsing the basicConstraints extension, reject junk after the SEQUENCE
inside the extension (which is probably benign), and reject a SEQUENCE that
extends beyond the extension (could be very dangerous).

Add a non-regression test where a certificate that is technically malformed,
but accepted as a leaf certificate by OpenSSL and other X.509
implementations, to be accepted as a CA certificate by Mbed TLS.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-05-26 21:07:09 +02:00
Gilles Peskine
22dccc1d83 Update framework with test certificate with basicConstraints overflow
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2026-05-26 21:07:09 +02:00
Janos Follath
545d1b77a2
Merge pull request #10741 from valeriosetti/fix-mbedtls_config
mbedtls_config.c missing mbedtls_platform_requirements.h
2026-05-26 09:24:54 +00:00
Minos Galanakis
e2a6f05640 ssl_write_supported_groups_ext: Updated documentation
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-05-26 10:17:11 +01:00
Nadav0077
fc34e72fc2
Address review: symbolic mutation constants and CID bounds-check test
Signed-off-by: Nadav0077 <18245584+Nadav0077@users.noreply.github.com>
2026-05-21 13:58:17 +03:00
Minos Galanakis
84667a048f test_suite_ssl: Added MBEDTLS_DEBUG_C guards to logs
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-05-20 12:25:42 +01:00
Minos Galanakis
95ad8b45ed test_suite_ssl: Restructured reject_hrr_selecting_unoffered_group
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-05-19 22:28:56 +01:00
Minos Galanakis
3d3de630db test_suite_ssl: Renamed hrr_reject_selecting_unoffered_group
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-05-19 17:36:12 +01:00
Minos Galanakis
7a232d0822 sll_client: align TLS 1.3 supported_groups filtering with PSA curve support
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-05-19 17:31:47 +01:00
Nadav0077
72f767da31
Address review comments on serialized data hardening
Signed-off-by: Nadav0077 <18245584+Nadav0077@users.noreply.github.com>
2026-05-19 14:15:02 +03:00
Nadav0077
fea00c3e51
Reject out-of-bounds DTLS CID length in ssl_context_load
Signed-off-by: Nadav0077 <18245584+Nadav0077@users.noreply.github.com>
2026-05-19 14:15:01 +03:00
Valerio Setti
147ad72669 changelog: fix typos
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-05-19 12:37:30 +02:00
Valerio Setti
c53e78796a changelog: add note about issue 1569 resolution
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-05-18 11:08:23 +02:00
Valerio Setti
a3ae8be611 ssl: improve documentation of mbedtls_ssl_conf_sig_algs()
Clarify that the 'sig_algs' set through this function are only enforced
during the key exchange and that 'mbedtls_ssl_conf_cert_profile()' should
instead be used to enforce the same algorithms when verifying certificates.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2026-05-18 11:04:59 +02:00
minosgalanakis
701132e5b3
Merge pull request #10663 from yiwu0b11/remove_unused_ffdh_code
Remove FFDH-specific code from compat.sh
2026-05-13 16:49:20 +00:00
Minos Galanakis
848ddaaedb test_suite_ssl: doc fixes
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2026-05-13 11:33:40 +01:00
Ben Taylor
ea9dc9c396 Add ChangeLog
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2026-05-13 11:16:49 +01:00