Repository navigation
Fixes CVE-2025-2750: out of bounds write by assigning to wrong array element count tracking (closes #6011) - #6225
Conversation
…element count tracking (closes assimp#6011) description: - The current implementation has faulty reallocation logic when parsing a CSM file - Issue 1 - https://github.com/assimp/assimp/blob/4ad1d2aa3086517816716a50aa122342806736f9/code/AssetLib/CSM/CSMLoader.cpp#L205 - By assigning s->mNumPositionKeys = alloc*2 right before resizing the buffer, making s->mNumPositionKeys equivalent to the max number of aiVectorKey that can be stored in s->mPositionKeys - the code later attempts to get the next write location by doing: aiVectorKey* sub = s->mPositionKeys + s->mNumPositionKeys; - this points to the end of the array, not after the last element in the array - Issue 2 - https://github.com/assimp/assimp/blob/4ad1d2aa3086517816716a50aa122342806736f9/code/AssetLib/CSM/CSMLoader.cpp#L178-L184 - if the CSM file does not declare last frame data, then mPositionKeys will never be initialized fix: - we preserve s->mNumPositionKeys to still contain the actual number of aiVectorKeys and ensure that we will not write out of bounds - we initialize mPositionKeys with a default value and if we find last frame info, we just re-initialize it
|
Please add text "Closes #6011" in description of PR so github will associate PR with issue |
|
@VinzSpring Looks like there's a quality issue flagged on your PR, please take a look and see if there's a suggestion to fix |
|
Security scanner looks good. The code was using new and delete before. My pull request focuses on fixng the CVE. |
Right, must have been the additional |
|
|
Merged, thanks a lot for your contribution. |
…element count tracking (closes #6011) (#6225) description: - The current implementation has faulty reallocation logic when parsing a CSM file - Issue 1 - https://github.com/assimp/assimp/blob/4ad1d2aa3086517816716a50aa122342806736f9/code/AssetLib/CSM/CSMLoader.cpp#L205 - By assigning s->mNumPositionKeys = alloc*2 right before resizing the buffer, making s->mNumPositionKeys equivalent to the max number of aiVectorKey that can be stored in s->mPositionKeys - the code later attempts to get the next write location by doing: aiVectorKey* sub = s->mPositionKeys + s->mNumPositionKeys; - this points to the end of the array, not after the last element in the array - Issue 2 - https://github.com/assimp/assimp/blob/4ad1d2aa3086517816716a50aa122342806736f9/code/AssetLib/CSM/CSMLoader.cpp#L178-L184 - if the CSM file does not declare last frame data, then mPositionKeys will never be initialized fix: - we preserve s->mNumPositionKeys to still contain the actual number of aiVectorKeys and ensure that we will not write out of bounds - we initialize mPositionKeys with a default value and if we find last frame info, we just re-initialize it Co-authored-by: Vinz Spring <[email protected]> Co-authored-by: Kim Kulling <[email protected]>




Closes #6011
description:
assimp/code/AssetLib/CSM/CSMLoader.cpp
Line 205 in 4ad1d2a
assimp/code/AssetLib/CSM/CSMLoader.cpp
Lines 178 to 184 in 4ad1d2a
fix: