dfir-iris/iris-web

[BUG] Manual hook is not found when multiple rows are selected

StaSys846 opened this issue · 0 comments

Describe the bug
Registered manual hook of self developed module is not fired / found when two or more rows of a list are selected.
Manual hook is working without errors when a single row is selected.
Iris v2.3.7.
Problem can be identified in static/assets/js/iris/common.js (692: function init_module_processing_wrap(rows, data_type, out_hook_name)) where a direct string match is applied between UI menu name of context menu and the registered manual hook name. Since the UI menu name change when multiple rows are selected (e.g. "manual task" for single row against "multiple taks (3)" for three selected rows) the match is no longer working.
Solution could be a regex match like this (as a proposal):
current:
697: if (jdata_menu_options[opt].manual_hook_ui_name == out_hook_name) {
change to:
697: var re = new RegExp(jdata_menu_options[opt].manual_hook_ui_name+"(\s\(\d+\))?");
698: if (out_hook_name.match(re)){

To Reproduce
Steps to reproduce the behavior:

  1. Go to asset/ioc/task list
  2. Click on one row and subseqeunt rows (holding shift key) to select multiple rows
  3. Right click on selected rows to open context menu
  4. Select self defined manual hook from kontext menu (manual hook must be defined via e.g. own module)
  5. error message appears: "hook not found"

Expected behavior
Starting registered manual hook code with multiple row information as input data.

Screenshots

  • no screenshot -

Desktop (please complete the following information):

  • OS: linux ubuntu
  • Browser firefox
  • Version 119.0 (64-bit)

Smartphone (please complete the following information):

  • Not tested

Additional context