draco: OOB read/SEGV in KHR_draco_mesh_compression parsing when bufferView index is out of range (vendored tinygltf)

Open Beginner friendly
#1,259 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 5 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
security

Research direction

Start in third_party/tinygltf/tiny_gltf.h at ParseDracoExtension around line 4282, where the issue identifies an unchecked bufferView index. Review the reported ASan cases for indices 999 and -1, then add range validation and reject out-of-range values. Done means both malformed inputs are rejected without the reported out-of-bounds reads or crash.

Written by the indexing model from the issue text.

Description

Root cause: the vendored tinygltf parser's ParseDracoExtension (third_party/tinygltf/tiny_gltf.h, line 4282) indexes model->bufferViews[bufferView] with no range check on the attacker-controlled bufferView index. One missing check, two manifestations:

  • bufferView 999: SEGV reading view.buffer (line 4283).
  • bufferView -1: heap-buffer-overflow READ size 1 reading view.dracoDecoded (line 4285).

Evidence (local ASan build, KHR_draco_mesh_compression glTF, minimal JSON changes from a valid seed):

  • J_bv999 (bufferView:999): ASan SEGV in ParseDracoExtension.
  • J_bv_neg1 (bufferView:-1): ASan heap-buffer-overflow READ size 1 in ParseDracoExtension.

Impact: crash (denial of service) in any tool parsing KHR_draco_mesh_compression glTF through this path. Low severity. The fault is in the vendored tinygltf parser, reached via draco's glTF parsing path.

Note on related work: this is distinct from #1247, which validates bufferView/buffer indices in draco's own decoder (src/draco/io/gltf_decoder.cc and tiny_gltf_utils.h) — #1247 does not touch the vendored tinygltf ParseDracoExtension, so this path is still unguarded. It is also distinct from #1257 (byteOffset validation in the same function, different check).

Suggested fix: range-check the bufferView index in ParseDracoExtension and reject out-of-range values, or update the vendored tinygltf copy.

Reproducer: the minimal glTF triggers are available on request.

Dominant language
C++
Stars
7.5k
Forks
1.1k
Avg merge
3d 11h
Merged PRs (30d)
9

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 google/draco

All issues in google/draco

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.