Skip to content

Commit be30d1f

Browse files
Merge branch 'bugfix' into fix/parser-tags-performance
2 parents 667c0e6 + 1d79125 commit be30d1f

6 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-dev",
3+
"version": "2.58.0-dev",
44
"license" : "BSD-3-Clause",
55
"private": true,
66
"dependencies": {

docs/content/supported_tools/parsers/file/invicti.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ For teams running Invicti Enterprise across multiple applications:
118118

119119
---
120120

121-
## Sample Scan Data
121+
### Sample Scan Data
122122

123123
Sample Invicti scans can be found [here](https://github.com/DefectDojo/django-DefectDojo/tree/master/unittests/scans/invicti).
124124

dojo/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
# Django starts so that shared_task will use this app.
55
from .celery import app as celery_app # noqa: F401
66

7-
__version__ = "2.57.0-dev"
7+
__version__ = "2.57.0"
88
__url__ = "https://github.com/DefectDojo/django-DefectDojo" # noqa: RUF067
99
__docs__ = "https://documentation.defectdojo.com" # noqa: RUF067

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v2
2-
appVersion: "2.57.0-dev"
2+
appVersion: "2.58.0-dev"
33
description: A Helm chart for Kubernetes to install DefectDojo
44
name: defectdojo
5-
version: 1.9.21-dev
5+
version: 1.9.22-dev
66
icon: https://defectdojo.com/hubfs/DefectDojo_favicon.png
77
maintainers:
88
- name: madchap

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-dev](https://img.shields.io/badge/Version-1.9.21--dev-informational?style=flat-square) ![AppVersion: 2.57.0-dev](https://img.shields.io/badge/AppVersion-2.57.0--dev-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)