Skip to content

Fixes CVE-2025-2751: Out-of-bounds Read in Assimp::CSMImporter::InternReadFile (closes #6012) - #6224

Merged
kimkulling merged 2 commits into
assimp:masterfrom
VinzSpring:fix-CVE-2025-2751
Jun 8, 2025
Merged

kimkulling merged 2 commits into
assimp:masterfrom
VinzSpring:fix-CVE-2025-2751

Conversation

@VinzSpring

@VinzSpring VinzSpring commented Jun 5, 2025 •

Copy link
Copy Markdown
Contributor

Closes #6012

description:
issue:

fix:

  • added nullptr check
  • added array count check
  • added default fallback init to identity matrix

fuzz output after fixing:

sh /home/ubuntu/assimp/test_exploits/CVE-2025-2751.sh
-- Shared libraries disabled
-- GCC13 detected disabling "-Wdangling-reference" in Cpp files as it appears to be a false positive
-- compiling zlib from sources
-- GCC13 detected disabling "-Warray-bounds and -Wstringop-overflow" for AssetLib/MDL/MDLLoader.cpp as it appears to be a false positive
-- VRML disabled
-- tinyusdz disabled
-- Enabled importer formats: AMF 3DS AC ASE ASSBIN B3D BVH COLLADA DXF CSM HMP IRRMESH IQM IRR LWO LWS MD2 MD3 MD5 MDC MDL NFF NDO OFF OBJ OGRE OPENGEX PLY MS3D COB BLEND IFC XGL FBX Q3D Q3BSP RAW SIB SMD STL TERRAGEN 3D X X3D GLTF 3MF MMD
-- Disabled importer formats: USD
-- Enabled exporter formats: OBJ OPENGEX PLY 3DS ASSBIN ASSXML COLLADA FBX STL X X3D GLTF 3MF PBRT ASSJSON STEP
-- Disabled exporter formats:
-- Treating all warnings as errors (for assimp library only)
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/ubuntu/assimp
ninja: no work to do.
INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 595894660
INFO: Loaded 1 modules (7 inline 8-bit counters): 7 [0x5f958c8f0a30, 0x5f958c8f0a37),
INFO: Loaded 1 PC tables (7 PCs): 7 [0x5f958c8f0a38,0x5f958c8f0aa8),
./assimp_fuzzer: Running 1 inputs 1 time(s) each.
Running: ./crash
Executed ./crash in 3 ms
NOTE: fuzzing was not performed, you have only

  •   executed the target code on a fixed set of inputs.*
    

…nReadFile (closes assimp#6012)

description:
issue:
- https://github.com/assimp/assimp/blob/4ad1d2aa3086517816716a50aa122342806736f9/code/AssetLib/CSM/CSMLoader.cpp#L274C1-L275C1
- sometimes the code tried to construct a new 4x4 matrix from a nullptr, thus reading out of bounds

fix:
- added nullptr check
- added array count check
- added default fallback init to identity matrix
@tellypresence

Copy link
Copy Markdown
Collaborator

Please add text "Closes #6012" in description of PR so github will associate PR with issue

@tellypresence tellypresence added Bug Global flag to mark a deviation from expected behaviour Fuzzer Bugs found by a fuzzer Security Risk Bugs that could potentially be security vulnerabilities labels Jun 5, 2025

@kimkulling kimkulling left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine for me.

@sonarqubecloud

sonarqubecloud Bot commented Jun 8, 2025

Copy link
Copy Markdown

@kimkulling
kimkulling merged commit 177797c into assimp:master Jun 8, 2025
@kimkulling

Copy link
Copy Markdown
Member

Merged, thanks a lot for your contribution.

kimkulling added a commit that referenced this pull request Jul 1, 2026
…nReadFile (closes #6012) (#6224)

description:
issue:
- https://github.com/assimp/assimp/blob/4ad1d2aa3086517816716a50aa122342806736f9/code/AssetLib/CSM/CSMLoader.cpp#L274C1-L275C1
- sometimes the code tried to construct a new 4x4 matrix from a nullptr, thus reading out of bounds

fix:
- added nullptr check
- added array count check
- added default fallback init to identity matrix

Co-authored-by: Vinz Spring <[email protected]>
Co-authored-by: Kim Kulling <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Global flag to mark a deviation from expected behaviour Fuzzer Bugs found by a fuzzer Security Risk Bugs that could potentially be security vulnerabilities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Out-of-bounds Read in Assimp::CSMImporter::InternReadFile

3 participants