-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
hapi request payload hardening #49609
Comments
Pinging @elastic/kibana-security (Team:Security) |
I have a related PR here which disallows these specific properties for LP routes without any payload validation defined: #48753 One idea I had to secure route payloads is to enhance
Protecting the Anyway, just something to consider -- I can continue with #48753 if you want, or I can leave it alone if you have other approaches you'd like to explore. #48753 is only concerned with legacy platform routes that don't specify any validation. It does not protect routes that declare their own (potentially unsafe) validation, and it also ignores all NP routes. |
@legrego Good idea baking it into the validator. In general, I think that's a good solution. Playing devil's advocate for a second, I assume JSON parsing and validation are two separate steps right? If so, would it potentially be possible for say a Kibana plugin/app to sidestep the validation (by accident) or maybe have a need to inject some "middleware" in before the validation step that potentially could be attacked? |
Yes, these are two separate steps. A plugin could in theory do something like this to sidestep my proposal
|
That part would be covered by #49608 in which we want to harden |
That makes sense to me. As part of these hardening efforts, we'll want to make sure to communicate to all kibana area teams and solution teams that they need to be cognizant of how their payloads are used, and to understand when they need to use the unsafe escape hatches. When @kobelb and I talked through #48753, we decided that we could potentially land that in |
@afharo's PR to allow custom validation in the NP should provide us the extension points to port the approach implemented in #48753 over to the NP. |
Look into if it's feasible to disallow hapi request payloads to contain either
__proto__
orconstuctor.prototype
by default (it should probably be possible to allow these on a per-endpoint basis)The text was updated successfully, but these errors were encountered: