Hello,
The NodeJS server of my organization integrates with Kaltura via the kaltura-client
NPM package. We have been using this package to search for videos within Kaltura but recently one of our clients has reported that users are getting videos in their search results that they shouldn’t have access to. To keep it simple, I’ll focus on a single notable incident of this occurrence that one of our clients mentioned to us.
A Kaltura user (“UserA”) searches for a video called “Week One Part One” by its full title. The video with that exact title is correctly returned, but so is another video that seemingly doesn’t match the conditions specified by the search parameters.
In this instance, here is what my organization is trying to do in plain English:
Find a video where:
video.mediaType is either 1 OR 5
AND video.name partially contains “Week One Part One”
AND (
video.userId = “UserA”
OR video.entitledUsersEdit includes “UserA”
OR video.entitledUsersPublish includes “UserA”
OR video.entitledUsersView includes “UserA”
)
As mentioned above, we’re using the kaltura-client
NPM package to construct these search queries. To avoid getting bogged down in the minutiae of various coding languages, I will instead just show you what this finalized search query looked like:
ESearchEntryParams {
objectType: 'KalturaESearchEntryParams',
searchOperator: ESearchEntryOperator {
objectType: 'KalturaESearchEntryOperator',
operator: 1,
searchItems: [
ESearchEntryOperator {
objectType: 'KalturaESearchEntryOperator',
operator: 2,
searchItems: [
ESearchEntryItem {
objectType: 'KalturaESearchEntryItem',
searchTerm: 1,
itemType: 1,
fieldName: 'media_type'
},
ESearchEntryItem {
objectType: 'KalturaESearchEntryItem',
searchTerm: 5,
itemType: 1,
fieldName: 'media_type'
}
]
},
ESearchEntryOperator {
objectType: 'KalturaESearchEntryOperator',
operator: 2,
searchItems: [
ESearchEntryItem {
objectType: 'KalturaESearchEntryItem',
searchTerm: 'UserA',
itemType: 1,
fieldName: 'kuser_id'
},
ESearchEntryItem {
objectType: 'KalturaESearchEntryItem',
searchTerm: 'UserA',
itemType: 4,
fieldName: 'entitled_kusers_edit'
},
ESearchEntryItem {
objectType: 'KalturaESearchEntryItem',
searchTerm: 'UserA',
itemType: 4,
fieldName: 'entitled_kusers_publish'
},
ESearchEntryItem {
objectType: 'KalturaESearchEntryItem',
searchTerm: 'UserA',
itemType: 4,
fieldName: 'entitled_kusers_view'
}
]
},
ESearchEntryItem {
objectType: 'KalturaESearchEntryItem',
searchTerm: 'Week One Part One',
itemType: 2,
fieldName: 'name'
}
]
},
orderBy: '-createdAt’
}
Now compare those search parameters to the relevant fields of the unexpected video we’re receiving in that search request:
{
entitledUsersEdit: "GroupNameA",
entitledUsersPublish: "GroupNameA",
entitledUsersView: "GroupNameA",
name: "Week 1 - THE MARKETING FUNCTION",
userId: "UserB",
type: 1,
}
My question to the Kaltura community is this: why is this video being returned in this search query when “UserA” is not the userId associated with the video nor does he have edit, publish, or view access over the video? I can see that the video is being returned because both its title and the search term contain the word “Week” but the other conditions should still come into play here, right?
Thank you for any and all help.