io_operations: remove the pickle-based model import path before it is re-enabled #32

Open
opened 2026-10-06 13:50:02 +00:00 by ffrauenberger · 0 comments
Owner

Severity: improvement (medium: remote code execution once the import is re-enabled)

Where

  • app/io_operations/export_operations.py:77-106
  • app/io_operations/import_operations.py:51-69
  • app/ui/home_ui/home_controller.py:93-95
  • app/ui/export_ui/export_controller.py:158-166
  • app/config.py:29-32

Problem

  • Export Model downloads pickle.dumps(mining_model).
  • HomeController.process_file contains a "pickle" branch that calls ImportOperations.read_model, i.e. pickle.load on the uploaded file.
  • This branch is unreachable today only because .pickle is missing from import_file_types_mapping. The README advertises "Load ProcessIntel native process models" (#62), so someone is likely to "fix" this by adding .pickle.

pickle.load on attacker-controlled data executes arbitrary code. On the hosted service this would be remote code execution as the service user.

Related: #53, #62.
Overlaps with upstream GitHub issue SWISDATA/processintel#6 Model Format and Import.

Fix

  • Remove ImportOperations.read_model and the "pickle" branch in HomeController.process_file, so the unsafe import cannot be re-enabled by adding a file extension
  • Replace the pickle export with a versioned, data-only format (see #53 and upstream SWISDATA/processintel#6)

from issues/SEC-002-pickle-used-for-model-export-and-import.md (code analysis of commit 6bcc646, 2026-10-03)

**Severity:** improvement (medium: remote code execution once the import is re-enabled) ## Where - `app/io_operations/export_operations.py:77-106` - `app/io_operations/import_operations.py:51-69` - `app/ui/home_ui/home_controller.py:93-95` - `app/ui/export_ui/export_controller.py:158-166` - `app/config.py:29-32` ## Problem - *Export Model* downloads `pickle.dumps(mining_model)`. - `HomeController.process_file` contains a `"pickle"` branch that calls `ImportOperations.read_model`, i.e. `pickle.load` on the **uploaded file**. - This branch is unreachable today only because `.pickle` is missing from `import_file_types_mapping`. The README advertises *"Load ProcessIntel native process models"* (#62), so someone is likely to "fix" this by adding `.pickle`. `pickle.load` on attacker-controlled data executes arbitrary code. On the hosted service this would be remote code execution as the service user. Related: #53, #62. Overlaps with upstream GitHub issue [SWISDATA/processintel#6](https://github.com/SWISDATA/processintel/issues/6) *Model Format and Import*. ## Fix - Remove `ImportOperations.read_model` and the `"pickle"` branch in `HomeController.process_file`, so the unsafe import cannot be re-enabled by adding a file extension - Replace the pickle export with a versioned, data-only format (see #53 and upstream [SWISDATA/processintel#6](https://github.com/SWISDATA/processintel/issues/6)) --- from `issues/SEC-002-pickle-used-for-model-export-and-import.md` (code analysis of commit 6bcc646, 2026-10-03)
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ffrauenberger/ProcessIntel#32
No description provided.