Ip046 — Draco connectivity `num_faces` count-driven decompression bomb

§12.15 import-format parser robustness (sub-class: draco-codec)

P1 — silent data loss

crash

Sources

Description

The Edgebreaker connectivity header carries a `num_faces` varint that the decoder historically fed to `vector::reserve()` with no bound against the remaining buffer. A tiny (~80-byte) file can therefore claim billions of faces while supplying almost no symbol payload. A robust decoder must bound the declared count against the bytes actually remaining before it allocates.

Reproducer recipe

Encode the tetra base mesh; replace the single-byte `num_faces` varint at file offset 12 (value 4) with the 5-byte varint `FF FF FF FF 0F` (~4.29 billion). Body is otherwise untouched.

Expected kernel behavior

Validate `num_faces` against the remaining buffer size before any reserve/allocation; reject with a clear diagnostic. Never size an allocation from an unvalidated stream count.

Notes

DracoPy 2.0.0 result observed: `FileTypeException: Input mesh is not draco encoded`. The decode returns immediately with a generic reject — no OOM, no hang; the generic error string does not confirm which check fired (header-parse vs. the `num_faces` bound), only that this build does not allocate from the unvalidated count. Synonyms: "count-driven allocation bomb", "codec-internal reserve() bomb", "unbounded num_faces". Provenance tier: bytes-only.

Expected validation

Provenance tier

bytes-only — defect not fully embodied in fixture bytes.

Byte assertions

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes (with defect highlighting)
1DRACOÿÿÿÿßÿ"ÿ	(2³
ÂBÿ?€?