You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
git clone --depth 1 https://github.com/ARMmbed/mbedtls.git
cd mbedtls/
scripts/config.pl set MBEDTLS_PLATFORM_MEMORY
scripts/config.pl set MBEDTLS_CMAC_C
scripts/config.pl set MBEDTLS_NIST_KW_C
scripts/config.pl set MBEDTLS_ARIA_C
scripts/config.pl set MBEDTLS_MD2_C
scripts/config.pl set MBEDTLS_MD4_C
mkdir build/
cd build/
cmake .. -DENABLE_PROGRAMS=0 -DENABLE_TESTING=0
make -j$(nproc)
Expected behavior
No memory violation
Actual behavior
OOB write, as can be verified using Valgrind or AddressSanitizer.
This is not in accordance with the documentation, which states:
The buffer for the output data. This must be able to hold at least ilen Bytes.
Thanks for reporting this! Would you mind sharing which oss-fuzz project caught this? This isn't from the mbedtls project, which we do monitor.
The buffer for the output data. This must be able to hold at least ilen Bytes.
That's going to have to change, because NIST_KW isn't broken down into a “ciphertext” with the same size as the plaintext and a “tag”. I'm not sure the mapping between the mbedtls_cipher API and NIST_KW makes sense here.
But even so the mbedtls_cipher abstraction should have detected this and returned an error, not silently caused a buffer overflow.
Description
Bug
mbed TLS build:
Latest git checkout, built using:
Expected behavior
No memory violation
Actual behavior
OOB write, as can be verified using Valgrind or AddressSanitizer.
This is not in accordance with the documentation, which states:
Steps to reproduce
This bug was found by OSS-Fuzz. The following code is a standalone reproducer for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25529
The text was updated successfully, but these errors were encountered: