mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[5.0.x] Fixed CVE-2025-26699 -- Mitigated potential DoS in wordwrap template filter.
Thanks sw0rd1ight for the report.
Backport of 55d89e25f4 from main.
This commit is contained in:
@@ -78,3 +78,14 @@ class FunctionTests(SimpleTestCase):
|
||||
"this is a long\nparagraph of\ntext that\nreally needs\nto be wrapped\n"
|
||||
"I'm afraid",
|
||||
)
|
||||
|
||||
def test_wrap_long_text(self):
|
||||
long_text = (
|
||||
"this is a long paragraph of text that really needs"
|
||||
" to be wrapped I'm afraid " * 20_000
|
||||
)
|
||||
self.assertIn(
|
||||
"this is a\nlong\nparagraph\nof text\nthat\nreally\nneeds to\nbe wrapped\n"
|
||||
"I'm afraid",
|
||||
wordwrap(long_text, 10),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user