Skip to content

HttpRequestMessage.Headers.Add should validate the header value #50597

Closed
@drauch

Description

@drauch

As a security protection it would be nice if HttpRequestMessage.Headers.Add would check whether the value contains new lines. If you are allowing your users to send a certain header value, many people probably don't think about the following attack vector:

var headerValue = "<user-input>";
httpRequestMessage.Headers.Add("x-my-header", headerValue);

// user-input == "test\nx-other-header=value" // whoups

What do you think?

Best regards,
D.R.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions