Skip to content

Commit 458cc3f

Browse files
authored
Merge branch 'bugfix' into dependabot/pip/django-5.2.13
2 parents 0b84589 + 1d79125 commit 458cc3f

4 files changed

Lines changed: 38 additions & 7 deletions

File tree

components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "defectdojo",
3-
"version": "2.57.0",
3+
"version": "2.58.0-dev",
44
"license" : "BSD-3-Clause",
55
"private": true,
66
"dependencies": {

dojo/tasks.py

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from celery.utils.log import get_task_logger
77
from django.apps import apps
88
from django.conf import settings
9+
from django.core.exceptions import SuspiciousOperation
910
from django.core.management import call_command
1011
from django.db.models import Count, Prefetch
1112
from django.urls import reverse
@@ -293,7 +294,37 @@ def update_watson_search_index_for_model(model_name, pk_list, *args, **kwargs):
293294
continue
294295

295296
# Let watson handle the bulk indexing
296-
context_manager.end()
297+
try:
298+
context_manager.end()
299+
except SuspiciousOperation:
300+
# Some finding content (e.g. a very long tag-like string) triggered
301+
# Django's strip_tags SuspiciousOperation guard. Fall back to
302+
# per-instance indexing so we can skip the offending object(s)
303+
# instead of silently dropping the entire batch.
304+
# https://www.djangoproject.com/weblog/2025/may/07/security-releases/
305+
# https://github.com/DefectDojo/django-DefectDojo/issues/14649
306+
logger.warning(
307+
f"Batch watson index update for {model_name} hit SuspiciousOperation; "
308+
"falling back to per-instance indexing",
309+
)
310+
instances_added = 0
311+
instances_skipped = 0
312+
for instance in instances:
313+
single_ctx = SearchContextManager()
314+
single_ctx.start()
315+
try:
316+
single_ctx.add_to_context(engine, instance)
317+
single_ctx.end()
318+
instances_added += 1
319+
except SuspiciousOperation:
320+
logger.warning(
321+
f"Skipping watson index update for {model_name}:{instance.pk} "
322+
"— content triggered SuspiciousOperation in strip_tags",
323+
)
324+
instances_skipped += 1
325+
except Exception as e:
326+
logger.warning(f"Skipping watson index update for {model_name}:{instance.pk} - {e}")
327+
instances_skipped += 1
297328

298329
logger.debug(f"Completed async watson index update: {instances_added} updated, {instances_skipped} skipped")
299330

helm/defectdojo/Chart.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v2
2-
appVersion: "2.57.0"
2+
appVersion: "2.58.0-dev"
33
description: A Helm chart for Kubernetes to install DefectDojo
44
name: defectdojo
5-
version: 1.9.21
5+
version: 1.9.22-dev
66
icon: https://defectdojo.com/hubfs/DefectDojo_favicon.png
77
maintainers:
88
- name: madchap
@@ -33,5 +33,5 @@ dependencies:
3333
# - kind: security
3434
# description: Critical bug
3535
annotations:
36-
artifacthub.io/prerelease: "false"
37-
artifacthub.io/changes: "- kind: changed\n description: Bump DefectDojo to 2.57.0\n"
36+
artifacthub.io/prerelease: "true"
37+
artifacthub.io/changes: ""

helm/defectdojo/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ The HELM schema will be generated for you.
511511
512512
# General information about chart values
513513
514-
![Version: 1.9.21](https://img.shields.io/badge/Version-1.9.21-informational?style=flat-square) ![AppVersion: 2.57.0](https://img.shields.io/badge/AppVersion-2.57.0-informational?style=flat-square)
514+
![Version: 1.9.22-dev](https://img.shields.io/badge/Version-1.9.22--dev-informational?style=flat-square) ![AppVersion: 2.58.0-dev](https://img.shields.io/badge/AppVersion-2.58.0--dev-informational?style=flat-square)
515515
516516
A Helm chart for Kubernetes to install DefectDojo
517517

0 commit comments

Comments
 (0)