Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multipart/form-data upload from HttpClient blocked by Azure Application Gateway WAF rule 920140 REQUEST-920-PROTOCOL-ENFORCEMENT #186

Open
shawnz88 opened this issue Feb 15, 2023 · 0 comments

Comments

@shawnz88
Copy link

shawnz88 commented Feb 15, 2023

How to reproduce:

MultipartFormDataContent form = new MultipartFormDataContent();
var message = new HttpRequestMessage();
var content = new MultipartFormDataContent();
content.Add(new StringContent("11111"), "AccountID");
content.Add(new StringContent("22222"), "MessageID");
content.Add(new StringContent("some message"), "MessageBody");

message.Method = HttpMethod.Post;
message.Content = content;
message.RequestUri = new Uri(apiEndpoint);
string token = await bt.GetCachedTokenAsync(cache);
message.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token);

return await httpClient.SendAsync(message);

Azure Application Gateway will block the upload with rule 920140 because the message fails strict validation.

Expected result

The multipart/form-data upload by HttpClient should pass strict validation by WAF rule 920140.

@shawnz88 shawnz88 changed the title Multipart/form-data upload from HttpClient blocked by Azure Application Gateway WAF rule 920130 REQUEST-920-PROTOCOL-ENFORCEMENT Multipart/form-data upload from HttpClient blocked by Azure Application Gateway WAF rule 920140 REQUEST-920-PROTOCOL-ENFORCEMENT Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant