-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Decouple request validation from @kbn/config-schema #50179
Comments
Pinging @elastic/kibana-platform (Team:Platform) |
Requiring strict validation on user-input is our primary defense against prototype-pollution. The lack of a standardized approach to validating request data potentially makes this significantly harder. Are there any additional details for exactly how this will be implemented, as it's possible I'm mis-understanding the implementation and this isn't such a cause for concern. |
We could, but we don't always want to do the prototype pollution validation which was added in #48753. There are various routes in Kibana where we need to disable this validation, for example any routes which are essentially "proxies" to Elasticsearch where users should be able to do things like a terms aggregation on a field named Additionally, this validation only catches the low-hanging fruit. The stricter that we are with the route validation, the more assurance we have that the input is "safe". |
For the proxies case, we can skip the prototype pollution validation when the
I agree with this, which is one reason this proposed change is specified as a temporary stop-gap rather than a long-term solution. Alternatively, we could ask plugins to use |
Not significantly, but it would perhaps encourage other developers without their own validation framework to use the default validation, which is better than nothing. |
We made the decision last week to decouple the request validation requirement from the
@kbn/config-schema
package. Reasons for this decision:@kbn/config-schema
package was designed explicitly for config schema. While it could be developed to be compatible with the request validation use-case, we do not have the time to do this right now.io-ts
, for validation. While there are some advantages of using the same package (eg. consistent validation error formats), we do not know what the recommended package for this use-case will be yet. In the meantime, we shouldn't stand in the way of what teams need to accomplish today.We should be able to replace this mechanism with a simple abstraction that is compatible with
@kbn/config-schema
in a non-breaking way and could be made compatible with other packages (eg.io-ts
) with a lightweight wrapper.Related: #45074
The text was updated successfully, but these errors were encountered: