zaproxy / zaproxy

The ZAP by Checkmarx Core project
https://www.zaproxy.org
Apache License 2.0
12.77k stars 2.28k forks source link

gRPC support. Not able to encode and decode gRPC messages. #8642

Open kdurolek opened 2 months ago

kdurolek commented 2 months ago

Describe the bug

ZAP is able to intercept gRPC request and response that I sent (acting as a proxy) but

  1. when I try to decode request of response message using dropdown (Body: gRPC) I always get this error "Illegal base64 character 0".
  2. when I want to prepare/modify massage myself and send it to gRPC endpoint I always get this error back grpc-status: 8 grpc-message: grpc: received message larger than max

Steps to reproduce the behavior

  1. Intercept any gRPC request in ZAP. Try to decode any request or response using body dropdown. image

image

  1. Try to prepare any gRPC request and send it. image

Expected behavior

I'm able to read and modify gRPC requests and responses

Software versions

2.15.0

Screenshots

No response

Errors from the zap.log file

No response

Additional context

No response

Would you like to help fix this issue?

kingthorin commented 2 months ago

@amitpanwar789 are you able to look into this?

kingthorin commented 2 months ago

@kdurolek could you provide the raw content?

kingthorin commented 1 month ago

@kdurolek could you provide the raw content?

kdurolek commented 1 month ago

image

kdurolek commented 1 month ago

Raw request exported from ZAP: issue.txt

kingthorin commented 1 month ago

Thanks. What were your steps exporting it raw from ZAP?

kdurolek commented 1 month ago

No problem. 1) I found request in zap history (also available via site tree) 2) Right-click -> Save as RAW -> Choose file name -> Save 3) I have renamed file issue.raw -> to issue.txt because I wasn't able to attach it (it was complaining about file type).

I hope it helps.

amitpanwar789 commented 2 weeks ago

sorry for the late reply, maybe there is additional compression is used on response body as mentioned in header grpc-accept-encoding deflate,gzip and when you try to prepare any message you got grpc-status 8, maybe you have set a limit on your server try sending smaller message.