From 16c70c3657728052d0736aed32081d84371cb573 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 16 Jun 2026 07:43:52 -0400 Subject: [PATCH] Fixes #22448: Ensure all objects are escaped under handle_protectederror() (#22449) --- netbox/utilities/error_handlers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/utilities/error_handlers.py b/netbox/utilities/error_handlers.py index 397098ded..8c0dce57d 100644 --- a/netbox/utilities/error_handlers.py +++ b/netbox/utilities/error_handlers.py @@ -29,7 +29,7 @@ def handle_protectederror(obj_list, request, e): # Formulate the error message err_message = _("Unable to delete {objects}. {count} dependent objects were found: ").format( - objects=', '.join(str(obj) for obj in obj_list), + objects=', '.join(escape(obj) for obj in obj_list), count=len(protected_objects) if len(protected_objects) <= 50 else _('More than 50') )