Skip to content

Added PGV constraint for serverName.#12967

Merged
htuch merged 2 commits intoenvoyproxy:masterfrom
mk46:pgv_servername
Sep 8, 2020
Merged

Added PGV constraint for serverName.#12967
htuch merged 2 commits intoenvoyproxy:masterfrom
mk46:pgv_servername

Conversation

@mk46
Copy link
Contributor

@mk46 mk46 commented Sep 3, 2020

Signed-off-by: Manish Kumar manish.kumar1@india.nec.com

Commit Message: Added PGV constraint for serverName. It shouldn't contain \0\n\r.
Additional Description: Added PGV constraint to not allow \0\n\r in serverName.Currently, header doesn't allow \0\r\n.
Risk Level:
Testing: config_test
Docs Changes:
Release Notes:
Fixes #12709

Signed-off-by: Manish Kumar <manish.kumar1@india.nec.com>
@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/envoy/.
CC @envoyproxy/api-watchers: FYI only for changes made to api/envoy/.

🐱

Caused by: #12967 was opened by mk46.

see: more, trace.

// An optional override that the connection manager will write to the server
// header in responses. If not set, the default is *envoy*.
string server_name = 10;
string server_name = 10 [(validate.rules).string = {pattern: "^[^\000\r\n]*$"}];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: there is a pattern for this already HTTP_HEADER_VALUE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree but the configuration should also have such constraints. Currently, server_name allow \0, \n, and \r which should not be there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @asraa is suggesting to use this pattern in the validator, see

string host = 1 [(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}];
for an example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@htuch @asraa Thanks for the review. PTAL.

Signed-off-by: Manish Kumar <manish.kumar1@india.nec.com>
@mk46 mk46 requested a review from asraa September 4, 2020 13:35
@mk46
Copy link
Contributor Author

mk46 commented Sep 4, 2020

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines, to retry CircleCI checks, use /retest-circle.
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #12967 (comment) was created by @mk46.

see: more, trace.

@mk46 mk46 requested a review from htuch September 4, 2020 16:23
Copy link
Contributor

@asraa asraa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the test as well!

Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@repokitteh-read-only repokitteh-read-only bot removed the api label Sep 8, 2020
@htuch htuch merged commit 23df69e into envoyproxy:master Sep 8, 2020
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

Successfully merging this pull request may close these issues.

[http_conn_manage]missing protobuf validation for config.serverName()

3 participants