#!/usr/bin/env python3 """Byte-level annotation of poc_oob_read_missing_verifier.ptd (64 bytes). Run: python3 decode_poc.py poc_oob_read_missing_verifier.ptd """ import struct import sys with open(sys.argv[1] if len(sys.argv) > 1 else "poc_oob_read_missing_verifier.ptd", "rb") as f: data = f.read() assert len(data) == 64, f"expected 64 bytes, got {len(data)}" root_offset = struct.unpack_from(" loaded_flatbuffer_len: print(f"*** root_offset ({root_offset}) EXCEEDS the loaded flatbuffer segment length ({loaded_flatbuffer_len}) ***") print("This is the corrupted field that FlatTensorDataMap::load() never validates:") print("no flatbuffers::Verifier runs, so GetFlatTensor()/field accessors trust this") print("out-of-range offset and walk memory past the end of the loaded buffer.")