Skip to content

grpc: replace manual protobuf wire parsing - #7483

Draft
kingthorin wants to merge 2 commits into
zaproxy:mainfrom
kingthorin:grpc-new-parse
Draft

grpc: replace manual protobuf wire parsing#7483
kingthorin wants to merge 2 commits into
zaproxy:mainfrom
kingthorin:grpc-new-parse

Conversation

@kingthorin

@kingthorin kingthorin commented Jun 24, 2026

Copy link
Copy Markdown
Member

Summary

Replace hand-rolled protobuf wire parsing in the gRPC add-on with protobuf-java (UnknownFieldSet) behind a ZapProtoTextCodec adapter. The gRPC message views and variant keep the same editable text format and behaviour; corrupted payloads now fail cleanly instead of showing partial fields.

  • Drop unused grpc-protobuf in favour of protobuf-java
  • Remove ProtoBufNestedMessageDecoder and ~400 lines of manual encode/decode logic
  • Add round-trip tests (wire + bytes → text → bytes)

Why / future work

Centralises protobuf handling in one codec layer on a maintained library API. That gives a stable base for later schema-aware decoding (e.g. gRPC reflection + DynamicMessage) while keeping the current schema-less path as fallback.

Related Issues

Signed-off-by: kingthorin <kingthorin@users.noreply.github.com>
Completes the wire parsing refactor by adding the ZAP text format codec
and bytes-to-text-to-bytes coverage referenced by the decoder and encoder.
@kingthorin kingthorin changed the title Grpc new parse grpc: replace manual protobuf wire parsing Jun 24, 2026
@psiinon

psiinon commented Jun 24, 2026

Copy link
Copy Markdown
Member

Logo
Checkmarx One – Scan Summary & Details98c5429e-4be3-46fe-93d4-db91d87da356

Great job! No new security vulnerabilities introduced in this pull request


Use @Checkmarx to interact with Checkmarx PR Assistant.
Examples:
@Checkmarx how are you able to help me?
@Checkmarx rescan this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants