Bug: MD2 importer heap-buffer-overflow

Open
#6,771 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
cpp

Research direction

Locate Assimp::MD2Importer::InternReadFile() and reproduce the crash with the attached poc.zip. Inspect how pcSkins->name is handled before strlen(), then verify malformed MD2 input no longer causes an out-of-bounds read and add regression coverage for the reproducer.

Written by the indexing model from the issue text.

Description

Bug MD2 Security Risk

Describe the bug
My name is Ravshan. I'd like to describe the bug/vulnerability: Heap Overflow Memory-safety vulnerability.
A heap-buffer-overflow occurs in Assimp’s MD2 importer when processing a malformed input file.
The crash happens due to an out-of-bounds read in strlen(), called from Assimp::MD2Importer::InternReadFile().

strlen scans memory until it finds '\0'. If pcSkins->name points to bytes that do not contain a '\0' within the allocated region, strlen reads out-of-bounds.
Code:

poc.zip

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Platform (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Dominant language
C++
Stars
13.3k
Forks
3.3k
Avg merge
3d 5h
Merged PRs (30d)
12

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from assimp/assimp

All issues in assimp/assimp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.