-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Go does not validate metadata keys and values #468
Comments
@iamqizhao Can I take a shot at this one? Seems like one or more backwards incompatible changes will be required to the metadata package to enforce gRPC metadata requirements. For example should the Ideally we could add a new function to validate function to the metadata package:
|
This adds new http.Handler-based ServerTransport in the process, reusing the HTTP/2 server code in x/net/http2 or Go 1.6+. All end2end tests pass with this new ServerTransport. Fixes grpc#75 Also: Updates grpc#495 (lets user fix it with middleware in front) Updates grpc#468 (x/net/http2 validates) Updates grpc#147 (possible with x/net/http2) Updates grpc#104 (x/net/http2 does this)
This adds new http.Handler-based ServerTransport in the process, reusing the HTTP/2 server code in x/net/http2 or Go 1.6+. All end2end tests pass with this new ServerTransport. Fixes grpc#75 Also: Updates grpc#495 (lets user fix it with middleware in front) Updates grpc#468 (x/net/http2 validates) Updates grpc#147 (possible with x/net/http2) Updates grpc#104 (x/net/http2 does this)
Kelsey, Sure. Thanks a lot for the help!. I will schedule a meeting with you and let's talk. |
This adds new http.Handler-based ServerTransport in the process, reusing the HTTP/2 server code in x/net/http2 or Go 1.6+. All end2end tests pass with this new ServerTransport. Fixes grpc#75 Also: Updates grpc#495 (lets user fix it with middleware in front) Updates grpc#468 (x/net/http2 validates) Updates grpc#147 (possible with x/net/http2) Updates grpc#104 (x/net/http2 does this)
This adds new http.Handler-based ServerTransport in the process, reusing the HTTP/2 server code in x/net/http2 or Go 1.6+. All end2end tests pass with this new ServerTransport. Fixes grpc#75 Also: Updates grpc#495 (lets user fix it with middleware in front) Updates grpc#468 (x/net/http2 validates) Updates grpc#147 (possible with x/net/http2) Updates grpc#104 (x/net/http2 does this)
This adds new http.Handler-based ServerTransport in the process, reusing the HTTP/2 server code in x/net/http2 or Go 1.6+. All end2end tests pass with this new ServerTransport. Fixes grpc#75 Also: Updates grpc#495 (lets user fix it with middleware in front) Updates grpc#468 (x/net/http2 validates) Updates grpc#147 (possible with x/net/http2) Updates grpc#104 (x/net/http2 does this)
This adds new http.Handler-based ServerTransport in the process, reusing the HTTP/2 server code in x/net/http2 or Go 1.6+. All end2end tests pass with this new ServerTransport. Fixes grpc#75 Also: Updates grpc#495 (lets user fix it with middleware in front) Updates grpc#468 (x/net/http2 validates) Updates grpc#147 (possible with x/net/http2) Updates grpc#104 (x/net/http2 does this)
This adds new http.Handler-based ServerTransport in the process, reusing the HTTP/2 server code in x/net/http2 or Go 1.6+. All end2end tests pass with this new ServerTransport. Fixes grpc#75 Also: Updates grpc#495 (lets user fix it with middleware in front) Updates grpc#468 (x/net/http2 validates) Updates grpc#147 (possible with x/net/http2) Updates grpc#104 (x/net/http2 does this)
This adds new http.Handler-based ServerTransport in the process, reusing the HTTP/2 server code in x/net/http2 or Go 1.6+. All end2end tests pass with this new ServerTransport. Fixes grpc#75 Also: Updates grpc#495 (lets user fix it with middleware in front) Updates grpc#468 (x/net/http2 validates) Updates grpc#147 (possible with x/net/http2) Updates grpc#104 (x/net/http2 does this)
This adds new http.Handler-based ServerTransport in the process, reusing the HTTP/2 server code in x/net/http2 or Go 1.6+. All end2end tests pass with this new ServerTransport. Fixes grpc#75 Also: Updates grpc#495 (lets user fix it with middleware in front) Updates grpc#468 (x/net/http2 validates) Updates grpc#147 (possible with x/net/http2) Updates grpc#104 (x/net/http2 does this)
This adds new http.Handler-based ServerTransport in the process, reusing the HTTP/2 server code in x/net/http2 or Go 1.6+. All end2end tests pass with this new ServerTransport. Fixes grpc#75 Also: Updates grpc#495 (lets user fix it with middleware in front) Updates grpc#468 (x/net/http2 validates) Updates grpc#147 (possible with x/net/http2) Updates grpc#104 (x/net/http2 does this)
This adds new http.Handler-based ServerTransport in the process, reusing the HTTP/2 server code in x/net/http2 or Go 1.6+. All end2end tests pass with this new ServerTransport. Fixes grpc#75 Also: Updates grpc#495 (lets user fix it with middleware in front) Updates grpc#468 (x/net/http2 validates) Updates grpc#147 (possible with x/net/http2) Updates grpc#104 (x/net/http2 does this)
This adds new http.Handler-based ServerTransport in the process, reusing the HTTP/2 server code in x/net/http2 or Go 1.6+. All end2end tests pass with this new ServerTransport. Fixes grpc#75 Also: Updates grpc#495 (lets user fix it with middleware in front) Updates grpc#468 (x/net/http2 validates) Updates grpc#147 (possible with x/net/http2) Updates grpc#104 (x/net/http2 does this)
This adds new http.Handler-based ServerTransport in the process, reusing the HTTP/2 server code in x/net/http2 or Go 1.6+. All end2end tests pass with this new ServerTransport. Fixes grpc#75 Also: Updates grpc#495 (lets user fix it with middleware in front) Updates grpc#468 (x/net/http2 validates) Updates grpc#147 (possible with x/net/http2) Updates grpc#104 (x/net/http2 does this)
This adds new http.Handler-based ServerTransport in the process, reusing the HTTP/2 server code in x/net/http2 or Go 1.6+. All end2end tests pass with this new ServerTransport. Fixes grpc#75 Also: Updates grpc#495 (lets user fix it with middleware in front) Updates grpc#468 (x/net/http2 validates) Updates grpc#147 (possible with x/net/http2) Updates grpc#104 (x/net/http2 does this)
This adds new http.Handler-based ServerTransport in the process, reusing the HTTP/2 server code in x/net/http2 or Go 1.6+. All end2end tests pass with this new ServerTransport. Fixes grpc#75 Also: Updates grpc#495 (lets user fix it with middleware in front) Updates grpc#468 (x/net/http2 validates) Updates grpc#147 (possible with x/net/http2) Updates grpc#104 (x/net/http2 does this)
This adds new http.Handler-based ServerTransport in the process, reusing the HTTP/2 server code in x/net/http2 or Go 1.6+. All end2end tests pass with this new ServerTransport. Fixes grpc#75 Also: Updates grpc#495 (lets user fix it with middleware in front) Updates grpc#468 (x/net/http2 validates) Updates grpc#147 (possible with x/net/http2) Updates grpc#104 (x/net/http2 does this)
This adds new http.Handler-based ServerTransport in the process, reusing the HTTP/2 server code in x/net/http2 or Go 1.6+. All end2end tests pass with this new ServerTransport. Fixes grpc#75 Also: Updates grpc#495 (lets user fix it with middleware in front) Updates grpc#468 (x/net/http2 validates) Updates grpc#147 (possible with x/net/http2) Updates grpc#104 (x/net/http2 does this)
This adds new http.Handler-based ServerTransport in the process, reusing the HTTP/2 server code in x/net/http2 or Go 1.6+. All end2end tests pass with this new ServerTransport. Fixes grpc#75 Also: Updates grpc#495 (lets user fix it with middleware in front) Updates grpc#468 (x/net/http2 validates) Updates grpc#147 (possible with x/net/http2) Updates grpc#104 (x/net/http2 does this)
Proposal: Return a gRPC status error (code: This avoids changing the API and doesn't require a new validation function that has to be called manually. Note that anyone relying upon sending metadata forbidden by the spec but accepted by the current version of grpc-go would be broken by this change. |
Few clarifying questions before I get started on this:
package metadata
func (md MD) Validate() error { ...} Is this the complete set of checks to be done, or are there more?
Thanks. |
HTTP has restrictions on what characters may be used in headers. For example, newline and control characters are strictly prohibited. In addition, gRPC has additional restrictions and by not enforcing them grpc-go makes it much more likely users will create grpc services that can't be used with the other implementations, because they rely on invalid keys or values.
Enforcing the HTTP restrictions must be done, but it would also make sense to enforce gRPC's metadata restrictions.
https://github.com/grpc/grpc-go/blob/master/metadata/metadata.go#L63
https://github.com/grpc/grpc-go/blob/master/transport/http2_client.go#L334
The text was updated successfully, but these errors were encountered: