dapr / components-contrib

Community driven, reusable components for distributed apps
Apache License 2.0
548 stars 480 forks source link

Azure Blob Storage Binding metadata sanitization issue for daprgrpctracebin #3580

Closed bhagya05 closed 2 weeks ago

bhagya05 commented 4 weeks ago

Actual Behavior

When using azure blob storage binding, we are getting the following error code

DEBU[0040] rpc error: code = Internal desc = error invoking output binding azure-storage-manager: error uploading az blob: Put "https://edmblob.blob.core.windows.net/dev/inbound%2Finbound-file.jpeg": net/http: invalid header field value for "x-ms-meta-daprgrpctracebin"  app_id=content-storage-adaptor-service instance=bhagya.local scope=dapr.runtime.grpc.api type=log ver=1.14.4

Did some debugging by adding some logs and found that dapr is allowing control ASCII characters in the metadata header value when metadata key is daprgrpctracebin.

Screenshot 2024-10-25 at 11 47 33 AM

Byte is 108 
Byte is 82 
Byte is 30 
Byte is 71 
Byte is 107 
Byte is 56 
Byte is 71 
Byte is 20 
Byte is 1 
Byte is 58 
Byte is 35 
Byte is 50 
Byte is 117 
Byte is 2 
Byte is 1 

Steps to Reproduce the Problem

  1. Use Azure blob storage binding with java application

Version Details: Dapr runtime version : 1.14.4 Dapr java sdk version : 1.12.1