Skip to content

Add reflection_fuzzer covering the C++ reflection API - #9213

Open
tinhien11 wants to merge 1 commit into
google:masterfrom
tinhien11:add-reflection-fuzzer
Open

Add reflection_fuzzer covering the C++ reflection API#9213
tinhien11 wants to merge 1 commit into
google:masterfrom
tinhien11:add-reflection-fuzzer

Conversation

@tinhien11

Copy link
Copy Markdown

The existing fuzz targets cover the parser, verifier, flexbuffers and the annotator (with a fixed schema), but not the reflection API itself: reflection::VerifySchemaBuffer()flatbuffers::Verify(schema, root, ...)flatbuffers::CopyTable(), which is the documented path for consuming an untrusted schema together with untrusted data at runtime.

This adds reflection_fuzzer with a simple two-part input:

u32 schema_length | bfbs schema | flatbuffer data

Inputs that fail either verification step return early, so the corpus converges on schema/data pairs that exercise the full consume path.

reflection_debug follows the existing scalar_debug/monster_debug convention for reproducing crash files locally.

Verified locally with -DUSE_ASAN=ON -DBUILD_DEBUGGER=ON. The OSS-Fuzz project build (projects/flatbuffers) builds all targets from tests/fuzzer, so no oss-fuzz-side change is needed.

The existing targets fuzz the parser, verifier, flexbuffers and the
annotator (fixed schema). This adds a target for the reflection API
itself, the documented path for consuming an untrusted schema plus
untrusted data at runtime:

  VerifySchemaBuffer(schema) -> Verify(schema, root, data) -> CopyTable

Input format: u32 schema_length | bfbs schema | flatbuffer data.
Inputs failing either verification step return early, so the corpus
converges on pairs that exercise the full consume path.
reflection_debug follows the scalar_debug/monster_debug convention.
@google-cla

google-cla Bot commented Sep 1, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions Bot added the c++ label Sep 1, 2026
@tinhien11
tinhien11 force-pushed the add-reflection-fuzzer branch from 4394876 to 35e2fc7 Compare September 1, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant