draco: SEGV in KHR_draco_mesh_compression parsing when attribute lookup returns null (vendored tinygltf)

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

Research direction

Start with ParseDracoExtension in third_party/tinygltf/tiny_gltf.h around line 4340 and inspect how a failed GetAttributeByUniqueId lookup is handled. Reproduce with the KHR_draco_mesh_compression input using attribute id 999 or -1 under ASan/UBSan. Done means invalid attribute ids are rejected without a crash; the issue says reproducer files are available on request.

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 4340) uses the result of mesh->GetAttributeByUniqueId() without a null check, then calls pAttribute->buffer() on it. With an attribute id that does not resolve (e.g. 999 or -1), this is a null-pointer dereference.

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

  • UBSan: member call / member access on null pointer of type PointAttribute (tiny_gltf.h:4334, 4340; point_attribute.h:62; geometry_attribute.h:273).
  • ASan: SEGV on unknown address 0x18, READ: ParseDracoExtension (tiny_gltf.h:4340) -> ParsePrimitive (4435) -> ParseMesh (4456).
  • Trigger: attribute id 999 or -1 in the extension JSON. Seven other fuzz inputs hit the identical signature — one root cause, not nine bugs.

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.

Suggested fix: null-check the attribute lookup result in ParseDracoExtension and reject the primitive, 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
1d 59m
Merged PRs (30d)
4

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.