-
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
Unable to use index patterns against indices with a __proto__
field
#101944
Comments
Pinging @elastic/kibana-app-services (Team:AppServices) |
@legrego I'm thinking about how to approach this and it might be best to block I haven't seen anyone specifically need fields with such names. What do you think? |
I opened this issue because it was reported by an end-user, not because I noticed a theoretical issue. I agree it is esoteric, but I don't think we should be banning the use of these fields outright, especially in a foundational feature such as
I agree that blocking I think we should ensure that the index pattern code can handle this field correctly, and perhaps add
I disagree. Index patterns are inherently comprised of user-supplied (read: untrusted) data, and it is everyone's responsibility to ensure they are handling this data in an appropriate way. This includes defending against prototype pollution attacks. cc @elastic/kibana-security if anyone else has thoughts on this |
@legrego Those are good points but I could use some guidance in how to proceed. In order to properly handle In the mean time, you don't get ANY fields if you have a Anyways, thats just off the top of my head. I'm open to other ideas on how to approach this. |
I like this idea. Could this be something that is determined by our apps at runtime? That way, apps could independently opt-in to this behavior once they've certified themselves, rather than waiting for the entire Kibana ecosystem to be ready.
This could be problematic now that index patterns no longer cache fields, and instead load them on-demand. This means that the introduction of a |
Obviously anything is possible but I dislike the idea that index patterns would have different field lists based on which app is using them. That goes against the core mission of index patterns. |
I'm wondering if using a |
Yes, Maps are a great way to work with untrusted data such as |
Maps are not serialized/deserialized automatically with JSON methods, we would need a custom serialization/deserialization mechanism for both server and browser envs to support data pipeline
@jportner could you confirm you are okay if Core disables prototype pollution mechanism for
Also, @jportner do you know if we have any prototype pollution protection mechanism on the browser side? In this case, a Kibana server response might be broken in the browser again. |
I don't think Larry was suggesting that we use @mattkime correct me if I'm wrong -- all consumers of index patterns rely on the data plugin to actually load the index fields, right? If so, it sounds like that's the only consumer that would need to change the ES client option.
No, we don't have any "default" prototype pollution controls in the client code. It's difficult/impossible to implement broad protection against this while ensuring that existing code won't break. See also: Security best practices documentation |
We can work it around by allowing plugins to create a custom client with |
correct |
@jportner actually I was proposing this. I expect that a majority of ES APIs return user-supplied data, to which we have no control. I think it's perfectly reasonable for us to support If we keep this as an option in the ES Client, then I feel the ES Client would need to know which calls contain user-supplied data, and which ones do not. The ES Client could filter out |
@mattkime How quickly do you need to solve this problem? Should we set a deadline to decide on a preferred solution? |
I see it as a denial-of-service bug/exploit and would like to see it addressed soon. Would be nice to see it as part of 7.16 and perhaps backported to 7.15 |
@mattkime I tested today, and other fields such as Index a document
Create an index patternView in Discover |
The
elasticsearch-js
client that Kibana uses for all communication to Elasticsearch has builtin protections to mitigate the risk of prototype pollution attacks. While this is useful in practice, it can have unintended consequences.It appears that these protections are preventing index patterns from being used if there is an index mapping with a
__proto__
field.Reproduction steps
__proto__
field:my-test-index
index-pattern-error.mp4
I believe the solution is to turn off the protections provided by the
elasticsearch-js
client for the calls that are failing (see thedisablePrototypePoisoningProtection
option in the docs). It won't just be that simple though, as you'll need to ensure that you are not processing the field data in a dangerous way.The text was updated successfully, but these errors were encountered: