diff options
| author | Gyorgy Sarvari <skandigraun@gmail.com> | 2026-01-15 13:40:55 +0100 |
|---|---|---|
| committer | Gyorgy Sarvari <skandigraun@gmail.com> | 2026-01-17 13:45:38 +0100 |
| commit | 5974cd90a8da4f0dd54a43cad14b4a4ef89e000f (patch) | |
| tree | c931fcf60738d2ad65e59fbb50b371c821d729ef | |
| parent | c8b4a0b77527389bbc9e9d440da425f92bf6037b (diff) | |
| download | meta-openembedded-5974cd90a8da4f0dd54a43cad14b4a4ef89e000f.tar.gz | |
python3-django: fix CVE-2023-36053 patch
This change is for python3-django_2.2.28.
The patch was accidentally backported incorrectly. The patch in general
introduces a field-length restrictrion on the email input fields, however
the patch was backported in a way that the restriction was applied on
file input fields instead of email fields.
This change amends the patch in a way to restrict the email field.
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-django/0001-Fix-patch-for-CVE-2023-36053.patch | 43 | ||||
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-django_2.2.28.bb | 1 |
2 files changed, 44 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-django/0001-Fix-patch-for-CVE-2023-36053.patch b/meta-python/recipes-devtools/python/python3-django/0001-Fix-patch-for-CVE-2023-36053.patch new file mode 100644 index 0000000000..48805df9cd --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-django/0001-Fix-patch-for-CVE-2023-36053.patch | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | From 85fd44420b007be726b502e3be58f56b0e44cc08 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 3 | Date: Thu, 15 Jan 2026 13:36:01 +0100 | ||
| 4 | Subject: [PATCH] Fix patch for CVE-2023-36053 | ||
| 5 | |||
| 6 | The patch was accidentally backported incorrectly. The patch in general | ||
| 7 | introduces a field-length restrictrion on the email input fields, however | ||
| 8 | the patch was backported in a way that the restriction was applied on | ||
| 9 | file input fields instead of email fields. | ||
| 10 | |||
| 11 | This change amends the patch in a way to restrict the email field. | ||
| 12 | |||
| 13 | CVE: CVE-2023-36053 | ||
| 14 | Upstream-Status: Inappropriate [Backport specific] | ||
| 15 | Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 16 | --- | ||
| 17 | django/forms/fields.py | 6 +++--- | ||
| 18 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
| 19 | |||
| 20 | diff --git a/django/forms/fields.py b/django/forms/fields.py | ||
| 21 | index b3156b9..bbb135f 100644 | ||
| 22 | --- a/django/forms/fields.py | ||
| 23 | +++ b/django/forms/fields.py | ||
| 24 | @@ -523,6 +523,9 @@ class EmailField(CharField): | ||
| 25 | default_validators = [validators.validate_email] | ||
| 26 | |||
| 27 | def __init__(self, **kwargs): | ||
| 28 | + # The default maximum length of an email is 320 characters per RFC 3696 | ||
| 29 | + # section 3. | ||
| 30 | + kwargs.setdefault("max_length", 320) | ||
| 31 | super().__init__(strip=True, **kwargs) | ||
| 32 | |||
| 33 | |||
| 34 | @@ -542,9 +545,6 @@ class FileField(Field): | ||
| 35 | def __init__(self, *, max_length=None, allow_empty_file=False, **kwargs): | ||
| 36 | self.max_length = max_length | ||
| 37 | self.allow_empty_file = allow_empty_file | ||
| 38 | - # The default maximum length of an email is 320 characters per RFC 3696 | ||
| 39 | - # section 3. | ||
| 40 | - kwargs.setdefault("max_length", 320) | ||
| 41 | super().__init__(**kwargs) | ||
| 42 | |||
| 43 | def to_python(self, data): | ||
diff --git a/meta-python/recipes-devtools/python/python3-django_2.2.28.bb b/meta-python/recipes-devtools/python/python3-django_2.2.28.bb index dedb2498cb..7735898ca5 100644 --- a/meta-python/recipes-devtools/python/python3-django_2.2.28.bb +++ b/meta-python/recipes-devtools/python/python3-django_2.2.28.bb | |||
| @@ -44,6 +44,7 @@ SRC_URI += "file://CVE-2023-31047.patch \ | |||
| 44 | file://0001-Fixed-test_utils.tests.HTMLEqualTests.test_parsing_e.patch \ | 44 | file://0001-Fixed-test_utils.tests.HTMLEqualTests.test_parsing_e.patch \ |
| 45 | file://0001-Made-RemoteTestResultTest.test_pickle_errors_detecti.patch \ | 45 | file://0001-Made-RemoteTestResultTest.test_pickle_errors_detecti.patch \ |
| 46 | file://0001-fix-quote-type-in-expected-error-message.patch \ | 46 | file://0001-fix-quote-type-in-expected-error-message.patch \ |
| 47 | file://0001-Fix-patch-for-CVE-2023-36053.patch \ | ||
| 47 | " | 48 | " |
| 48 | 49 | ||
| 49 | SRC_URI[sha256sum] = "0200b657afbf1bc08003845ddda053c7641b9b24951e52acd51f6abda33a7413" | 50 | SRC_URI[sha256sum] = "0200b657afbf1bc08003845ddda053c7641b9b24951e52acd51f6abda33a7413" |
