Skip to content

rmodels: validate IQM file offsets against data size - #6367

Closed
TristanInSec wants to merge 1 commit into
raysan5:masterfrom
TristanInSec:fix-iqm-bounds-check
Closed

TristanInSec wants to merge 1 commit into
raysan5:masterfrom
TristanInSec:fix-iqm-bounds-check

Conversation

@TristanInSec

Copy link
Copy Markdown

The IQM model loader reads offset and count fields from the file header and passes them directly to memcpy without checking they fit within the loaded data. A crafted .iqm with out-of-range offsets reads past the file buffer.

This validates the header-level offsets (meshes, triangles, vertex arrays, joints) up front, and checks per-element offsets (text strings, vertex array data) before each copy.

The IQM loader reads offset and count fields from the file header
and uses them directly in memcpy calls without checking they fall
within the loaded file data. A crafted .iqm file with out-of-range
offsets causes heap buffer over-reads.

Validate the main header offsets (meshes, triangles, vertex arrays,
joints) against the file size before use, and check per-element
offsets (text strings, vertex data) before each memcpy.
@raysan5 raysan5 closed this Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants