#6760·assimp

错误: Blender 导入器会在未验证的、由文件控制的枚举字段上切换 → UBSan 无效的枚举加载 / SIGILL (CWE-704)

作者: 1820893135-pixel创建于 2026年8月6日更新于 2026年9月23日
标签BugBlender

Describe the bug

The Blender (.blend) importer in assimp decodes enum fields directly from untrusted binary file bytes and passes them into switch statements without range validation. Three distinct sites in BlenderLoader.cpp — ConvertLight (switches on lamp->type, legal values 0..4), ConvertNode (switches on obj->type, 10 legal discrete values), and ResolveTexture (switches on rtex->type, legal values 1..15) — all contain a switch with no default branch and no prior bounds check. A malformed .blend file that overwrites the corresponding struct regions with 0xFF causes the enum to load the value 0xFFFFFFFF. Loading an out-of-range value into a C++ enum is undefined behavior; under a trap-mode UBSAN build (-fsanitize-trap=undefined) this compiles to a ud1 trap instruction, crashing the process with SIGILL (exit 132).