From eed53d0011622e70b936e203005f0e6f4ac48965 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Thu, 13 Apr 2023 10:10:56 +0200 Subject: [3.2.x] Fixed CVE-2023-31047, Fixed #31710 -- Prevented potential bypass of validation when uploading multiple files using one form field. Thanks Moataz Al-Sharida and nawaik for reports. Co-authored-by: Shai Berger Co-authored-by: nessita <124304+nessita@users.noreply.github.com> --- tests/forms_tests/widget_tests/test_clearablefileinput.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/forms_tests/widget_tests/test_clearablefileinput.py') diff --git a/tests/forms_tests/widget_tests/test_clearablefileinput.py b/tests/forms_tests/widget_tests/test_clearablefileinput.py index dee44c4239..6cf1476cb2 100644 --- a/tests/forms_tests/widget_tests/test_clearablefileinput.py +++ b/tests/forms_tests/widget_tests/test_clearablefileinput.py @@ -176,3 +176,8 @@ class ClearableFileInputTest(WidgetTest): self.assertIs(widget.value_omitted_from_data({}, {}, 'field'), True) self.assertIs(widget.value_omitted_from_data({}, {'field': 'x'}, 'field'), False) self.assertIs(widget.value_omitted_from_data({'field-clear': 'y'}, {}, 'field'), False) + + def test_multiple_error(self): + msg = "ClearableFileInput doesn't support uploading multiple files." + with self.assertRaisesMessage(ValueError, msg): + ClearableFileInput(attrs={"multiple": True}) -- cgit v1.3