-
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
Kibana allows users to create a saved object with an empty ID #118957
Comments
Pinging @elastic/kibana-core (Team:Core) |
Pinging @elastic/kibana-security (Team:Security) |
Yeah, I forgot about that one. IMO, #105039 is a bit bigger in scope as actual new validation would be a breaking change. I'm still trying to think of what to do about |
That would make sense
Can you elaborate on this one? |
Kibana behaves this way today: a. Since action (d) before 7.11 didn't behave this way -- it also generated a random object ID -- it makes sense to me to treat this like a bug and change that behavior back to how it was. Now, we have other scenarios to consider: e. Action (h) is also problematic, but how should we approach it? If we treat this as a 400 Bad Request, then we should probably respond to action (g) the same way. FWIW I just tested our generic So maybe we don't need to worry about update+upsert for now, since it sounds like there's a much lower chance someone could accidentally create an object with an empty ID using this API. |
I think for any |
I faced this issue while trying to import a dashboard ndjson file with an empty ID , now the saved object, and dashboard menus are broken, actually I'm using a version 7.16, can you tell me how I can fix this issue ? |
Kibana version: 7.11.0 - 7.16.1
Describe the bug:
Credit to @wwang500 for discovering this bug with a fuzzing tool!
When you create a saved object in Kibana, if you don't specify an ID, it is supposed to automatically generate one. Before 7.11, we relied on Elasticsearch do to this (using the
create
document API instead of theindex
document API). However, starting in #84113, we introduced a change to useuuidv4
to generate an object ID before calling Elasticsearch; the reason for this is so that we can log a complete audit trail of events.However, this change introduced a regression that allowed an empty object ID (
""
) to be assigned when the object is created. When Kibana serializes a saved object to an ES document, its raw document ID is formatted as<type>:<id>
. When Kibana later tries to deserialize the document back into a saved object, it validates the raw ID. If the raw ID is malformed (such as<type>:
), Kibana throws an error.Note, it is only possible to get into this situation using the SavedObjectsClient
create
API, notbulkCreate
.Steps to reproduce:
Any other API call in Kibana that tries to load the saved object will also fail in this spectacular fashion.
Expected behavior:
Kibana should not allow users to create a saved object with an empty ID.
The text was updated successfully, but these errors were encountered: