diff options
| author | Rahul Janani Pandi <RahulJanani.Pandi@windriver.com> | 2024-04-08 09:42:28 +0000 |
|---|---|---|
| committer | Armin Kuster <akuster808@gmail.com> | 2024-04-28 13:10:23 -0400 |
| commit | 717462f81159d00336733c62208b55db22ea1fdb (patch) | |
| tree | 40b6ac3e92c71505c35451e7a21417b90049a1bf /meta-python/recipes-devtools/python/python3-pillow/CVE-2023-50447-2.patch | |
| parent | 0fffd4d4221461efd0d0600634af1f5dcbd846e4 (diff) | |
| download | meta-openembedded-717462f81159d00336733c62208b55db22ea1fdb.tar.gz | |
python3-pillow: Fix CVE-2023-50447
Pillow through 10.1.0 allows PIL.ImageMath.eval Arbitrary Code
Execution via the environment parameter, a different vulnerability
than CVE-2022-22817 (which was about the expression parameter).
References:
https://security-tracker.debian.org/tracker/CVE-2023-50447
https://github.com/python-pillow/Pillow/blob/10.2.0/CHANGES.rst
Signed-off-by: Rahul Janani Pandi <RahulJanani.Pandi@windriver.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-pillow/CVE-2023-50447-2.patch')
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-pillow/CVE-2023-50447-2.patch | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-pillow/CVE-2023-50447-2.patch b/meta-python/recipes-devtools/python/python3-pillow/CVE-2023-50447-2.patch new file mode 100644 index 0000000000..13fbaf6d78 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-pillow/CVE-2023-50447-2.patch | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | From 45c726fd4daa63236a8f3653530f297dc87b160a | ||
| 2 | From: Eric Soroos <eric-github@soroos.net> | ||
| 3 | Date: Fri Oct 27 11:21:18 2023 +0200 | ||
| 4 | Subject: [PATCH] python3-pillow: Don't allow __ or builtins in env dictionarys | ||
| 5 | |||
| 6 | CVE: CVE-2023-50447 | ||
| 7 | |||
| 8 | Upstream-Status: Backport [https://github.com/python-pillow/Pillow/commit/45c726fd4daa63236a8f3653530f297dc87b160a] | ||
| 9 | |||
| 10 | Signed-off-by: Rahul Janani Pandi <RahulJanani.Pandi@windriver.com> | ||
| 11 | --- | ||
| 12 | src/PIL/ImageMath.py | 4 ++++ | ||
| 13 | 1 file changed, 4 insertions(+) | ||
| 14 | |||
| 15 | diff --git a/src/PIL/ImageMath.py b/src/PIL/ImageMath.py | ||
| 16 | index 71872a3fb..923a8eeae 100644 | ||
| 17 | --- a/src/PIL/ImageMath.py | ||
| 18 | +++ b/src/PIL/ImageMath.py | ||
| 19 | @@ -240,6 +240,10 @@ def eval(expression, _dict={}, **kw): | ||
| 20 | args.update(_dict) | ||
| 21 | args.update(kw) | ||
| 22 | for k, v in args.items(): | ||
| 23 | + if '__' in k or hasattr(__builtins__, k): | ||
| 24 | + msg = f"'{k}' not allowed" | ||
| 25 | + raise ValueError(msg) | ||
| 26 | + | ||
| 27 | if hasattr(v, "im"): | ||
| 28 | args[k] = _Operand(v) | ||
| 29 | |||
| 30 | -- | ||
| 31 | 2.40.0 | ||
