($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: Rahul Janani Pandi <RahulJanani.Pandi@windriver.com>
To: <openembedded-devel@lists.openembedded.org>
Cc: Rahul Janani Pandi <RahulJanani.Pandi@windriver.com>
Subject: [oe][meta-python][kirkstone][PATCH 1/1] python3-django: fix CVE-2024-24680
Date: Tue, 16 Apr 2024 10:40:54 +0000	[thread overview]
Message-ID: <20240416104054.2336674-1-RahulJanani.Pandi@windriver.com> (raw)

An issue was discovered in Django 3.2 before 3.2.24, 4.2 before 4.2.10,
and Django 5.0 before 5.0.2. The intcomma template filter was subject
to a potential denial-of-service attack when used with very long strings.

Since, there is no ptest available for python3-django so have not
tested the patch changes at runtime.

References:
https://security-tracker.debian.org/tracker/CVE-2024-24680
https://docs.djangoproject.com/en/dev/releases/4.2.10/

Signed-off-by: Rahul Janani Pandi <RahulJanani.Pandi@windriver.com>
---
 .../python3-django/CVE-2024-24680.patch       | 48 +++++++++++++++++++
 .../python/python3-django_2.2.28.bb           |  1 +
 2 files changed, 49 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-django/CVE-2024-24680.patch

diff --git a/meta-python/recipes-devtools/python/python3-django/CVE-2024-24680.patch b/meta-python/recipes-devtools/python/python3-django/CVE-2024-24680.patch
new file mode 100644
index 000000000..aec67453a
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-django/CVE-2024-24680.patch
@@ -0,0 +1,48 @@
+From 572ea07e84b38ea8de0551f4b4eda685d91d09d2
+From: Adam Johnson <me@adamj.eu>
+Date: Mon Jan 22 13:21:13 2024 +0000
+Subject: [PATCH] Fixed CVE-2024-24680 -- Mitigated potential DoS in intcomma
+ template filter
+
+Thanks Seokchan Yoon for the report.
+
+Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
+Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
+Co-authored-by: Shai Berger <shai@platonix.com>
+
+CVE: CVE-2024-24680
+
+Upstream-Status: Backport [https://github.com/django/django/commit/572ea07e84b38ea8de0551f4b4eda685d91d09d2]
+
+Signed-off-by: Rahul Janani Pandi <RahulJanani.Pandi@windriver.com>
+---
+ django/contrib/humanize/templatetags/humanize.py | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/django/contrib/humanize/templatetags/humanize.py b/django/contrib/humanize/templatetags/humanize.py
+index 194c7e8..ee22a45 100644
+--- a/django/contrib/humanize/templatetags/humanize.py
++++ b/django/contrib/humanize/templatetags/humanize.py
+@@ -71,13 +71,14 @@ def intcomma(value, use_l10n=True):
+             return intcomma(value, False)
+         else:
+             return number_format(value, force_grouping=True)
+-    orig = str(value)
+-    new = re.sub(r"^(-?\d+)(\d{3})", r'\g<1>,\g<2>', orig)
+-    if orig == new:
+-        return new
+-    else:
+-        return intcomma(new, use_l10n)
+
++    result = str(value)
++    match = re.match(r"-?\d+", result)
++    if match:
++        prefix = match[0]
++        prefix_with_commas = re.sub(r"\d{3}", r"\g<0>,", prefix[::-1])[::-1]
++        result = prefix_with_commas + result[len(prefix) :]
++    return result
+
+ # A tuple of standard large number to their converters
+ intword_converters = (
+--
+2.40.0
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 8c955e6bd..cbd2c69c0 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
@@ -10,6 +10,7 @@ SRC_URI += "file://CVE-2023-31047.patch \
             file://CVE-2023-41164.patch \
             file://CVE-2023-43665.patch \
             file://CVE-2023-46695.patch \
+            file://CVE-2024-24680.patch \
            "
 
 SRC_URI[sha256sum] = "0200b657afbf1bc08003845ddda053c7641b9b24951e52acd51f6abda33a7413"
-- 
2.40.0



                 reply	other threads:[~2024-04-16 10:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240416104054.2336674-1-RahulJanani.Pandi@windriver.com \
    --to=rahuljanani.pandi@windriver.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).