From 0b42f6a528df966729b24ecaaed67f85e5edc3dc Mon Sep 17 00:00:00 2001
From: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
Date: Tue, 8 Apr 2025 16:30:17 +0200
Subject: [5.1.x] Fixed CVE-2025-32873 -- Mitigated potential DoS in
strip_tags().
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Thanks to Elias Myllymäki for the report, and Shai Berger and Jake
Howard for the reviews.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
Backport of 9f3419b519799d69f2aba70b9d25abe2e70d03e0 from main.
---
tests/utils_tests/test_html.py | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
(limited to 'tests/utils_tests/test_html.py')
diff --git a/tests/utils_tests/test_html.py b/tests/utils_tests/test_html.py
index 75873061de..78db84e1a1 100644
--- a/tests/utils_tests/test_html.py
+++ b/tests/utils_tests/test_html.py
@@ -126,17 +126,30 @@ class TestUtilsHtml(SimpleTestCase):
(">br>br>br>X", "XX"),
("<" * 50 + "a>" * 50, ""),
+ (">" + "" + "" * 51, ""
with self.assertRaises(SuspiciousOperation):
strip_tags(value)
+ def test_strip_tags_suspicious_operation_large_open_tags(self):
+ items = [
+ ">" + "