Skip to content

test(fuzz): vstring parser fuzz target (FCV-14 #2441) - #4486

Merged
oferchen merged 1 commit into
masterfrom
test/fuzz-vstring
May 18, 2026
Merged

oferchen merged 1 commit into
masterfrom
test/fuzz-vstring

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Per FCV-3 audit (PR #4407) - vstring is pre-auth attack surface.

Summary

  • Adds fuzz/fuzz_targets/vstring.rs, a libFuzzer target that drives the protocol 30+ vstring reader through the public negotiate_capabilities entry point.
  • Registers the new bin in fuzz/Cargo.toml and seeds the corpus with a known-good vstring.

Coverage

read_vstring / write_vstring live in crates/protocol/src/negotiation/capabilities/negotiate.rs and are pub(super). They are reached from outside the crate exclusively through negotiate_capabilities, which feeds the caller-supplied reader into the vstring decoder. A selector byte at the head of the fuzz input fans out across protocol versions (28/30/31/32) and role/mode flags (do_negotiation, send_compression, is_daemon_mode, is_server) so libFuzzer can independently explore the one-byte and two-byte length encodings and the UTF-8 validation path.

Test plan

  • cargo fmt --all -- --check (fuzz package)
  • cargo +nightly fuzz run vstring (manual smoke run)

The vstring codec is exchanged during protocol 30+ capability negotiation,
well before authentication completes, making any panic in the reader a
pre-auth remote attack surface (FCV-3 audit, PR #4407).

Add a libFuzzer target that drives `read_vstring` through the public
`negotiate_capabilities` entry point, with a selector byte that fans out
across protocol versions and role flags so both the one-byte and two-byte
length encodings and the UTF-8 validation path are exercised. Register the
new bin in fuzz/Cargo.toml and seed the corpus with a known-good vstring.
@github-actions github-actions Bot added the test label May 18, 2026
@oferchen
oferchen merged commit 612c53e into master May 18, 2026
3 checks passed
@oferchen
oferchen deleted the test/fuzz-vstring branch May 18, 2026 10:55
oferchen added a commit that referenced this pull request May 18, 2026
The vstring codec is exchanged during protocol 30+ capability negotiation,
well before authentication completes, making any panic in the reader a
pre-auth remote attack surface (FCV-3 audit, PR #4407).

Add a libFuzzer target that drives `read_vstring` through the public
`negotiate_capabilities` entry point, with a selector byte that fans out
across protocol versions and role flags so both the one-byte and two-byte
length encodings and the UTF-8 validation path are exercised. Register the
new bin in fuzz/Cargo.toml and seed the corpus with a known-good vstring.
oferchen added a commit that referenced this pull request May 18, 2026
The vstring codec is exchanged during protocol 30+ capability negotiation,
well before authentication completes, making any panic in the reader a
pre-auth remote attack surface (FCV-3 audit, PR #4407).

Add a libFuzzer target that drives `read_vstring` through the public
`negotiate_capabilities` entry point, with a selector byte that fans out
across protocol versions and role flags so both the one-byte and two-byte
length encodings and the UTF-8 validation path are exercised. Register the
new bin in fuzz/Cargo.toml and seed the corpus with a known-good vstring.
oferchen added a commit that referenced this pull request Aug 24, 2026
The vstring codec is exchanged during protocol 30+ capability negotiation,
well before authentication completes, making any panic in the reader a
pre-auth remote attack surface (FCV-3 audit, PR #4407).

Add a libFuzzer target that drives `read_vstring` through the public
`negotiate_capabilities` entry point, with a selector byte that fans out
across protocol versions and role flags so both the one-byte and two-byte
length encodings and the UTF-8 validation path are exercised. Register the
new bin in fuzz/Cargo.toml and seed the corpus with a known-good vstring.
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