Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions source/app/blueprints/rest/v2/alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
from app.models.errors import BusinessProcessingError
from app.models.errors import ObjectNotFoundError

import copy


# Fields that must be immutable on alert update. See GHSA-8hwq-v6vm-9grr
# / SBA-ADV-20260128-05 / CWE-863 — re-attributing alert_customer_id lets
Expand Down Expand Up @@ -252,6 +254,7 @@ def update(self, identifier):
identifier,
fallback_customer_access=ac_current_user_has_customer_access
)
pristine_alert = copy.copy(alert) # shallow copy for ongoing comparison
# Drop fields the caller must not be allowed to change on update
# (GHSA-8hwq-v6vm-9grr / SBA-ADV-20260128-05 / CWE-863). The
# customer_id is the worst: re-attributing an alert to a
Expand All @@ -262,7 +265,7 @@ def update(self, identifier):
activity_data = []

for key, value in request_data.items():
old_value = getattr(alert, key, None)
old_value = getattr(pristine_alert, key, None)

if type(old_value) is int:
old_value = str(old_value)
Expand All @@ -279,7 +282,7 @@ def update(self, identifier):

if request_data.get('alert_owner_id') == "-1" or request_data.get('alert_owner_id') == -1:
updated_alert.alert_owner_id = None
result = alerts_update(alert, updated_alert, activity_data)
result = alerts_update(pristine_alert, updated_alert, activity_data)
return response_api_success(self._schema.dump(result))

except ValidationError as e:
Expand Down
4 changes: 4 additions & 0 deletions source/app/iris_engine/module_handler/module_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,10 @@ def task_hook_wrapper(self, module_name, hook_name, hook_ui_name, data, init_use
:param caseid: Case associated
:return: A task status JSON task_success or task_failure
"""
# Reset session and connection pool inherited from parent process fork
db.session.remove()
db.engine.dispose()

try:
# Data is serialized, so deserialized
signature, pdata = data.encode("utf-8").split(b" ")
Expand Down