Compare commits

..

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
ae372fc0f7
!49 [sync] PR-39: Fix CVE-2024-21506
From: @openeuler-sync-bot 
Reviewed-by: @lyn1001 
Signed-off-by: @lyn1001
2024-04-08 01:26:26 +00:00
liweigang
42683a1e91 Fix CVE-2024-21506
Signed-off-by: liweigang <liweiganga@uniontech.com>
(cherry picked from commit 436bc9cc04089a0ec53924ce5e50754e8ed39d6c)
2024-04-07 16:48:19 +08:00
openeuler-ci-bot
54394ee00c
!26 upgrade to 4.3.3
From: @chen-jan 
Reviewed-by: @lyn1001 
Signed-off-by: @lyn1001
2023-05-29 10:13:15 +00:00
chen-jan
58cc564bcf upgrade to 4.3.3 2023-05-29 18:17:54 +08:00
openeuler-ci-bot
33be4bc74c
!15 upgrade package for openstack yoga
From: @liksh 
Reviewed-by: @ruebb 
Signed-off-by: @ruebb
2022-08-05 10:24:57 +00:00
liksh
b10c6948fe upgrade for openstack yoga 2022-07-24 20:59:29 +08:00
openeuler-ci-bot
9b41b25fde !9 update version to 3.11.3
From: @ffrog
Reviewed-by: 
Signed-off-by:
2021-08-19 06:40:20 +00:00
FFrog
6d1c251c18 update version to 3.11.3 2021-08-19 10:51:06 +08:00
openeuler-ci-bot
3948555110 !8 Completing build dependencies
From: @hht8
Reviewed-by: @small_leek
Signed-off-by: @small_leek
2021-06-01 16:14:43 +08:00
hht8
b16f611310 Completing build dependencies 2021-06-01 14:45:19 +08:00
5 changed files with 76 additions and 32 deletions

View File

@ -1,14 +0,0 @@
diff --git a/pymongo/pool.py b/pymongo/pool.py
index 859d0e0..f55fd8e 100644
--- a/pymongo/pool.py
+++ b/pymongo/pool.py
@@ -49,8 +49,7 @@ from pymongo.network import (command,
SocketChecker)
from pymongo.read_preferences import ReadPreference
from pymongo.server_type import SERVER_TYPE
-# Always use our backport so we always have support for IP address matching
-from pymongo.ssl_match_hostname import match_hostname, CertificateError
+from ssl import match_hostname, CertificateError
# For SNI support. According to RFC6066, section 3, IPv4 and IPv6 literals are
# not permitted for SNI hostname.

Binary file not shown.

View File

@ -0,0 +1,47 @@
From 56b6b6dbc267d365d97c037082369dabf37405d2 Mon Sep 17 00:00:00 2001
From: Shane Harvey <shnhrv@gmail.com>
Date: Wed, 27 Mar 2024 16:51:23 -0700
Subject: [PATCH] PYTHON-4305 Fix bson size check (#1564)
(cherry picked from commit 372b5d68d5a57ccc43b33407cd23f0bc79d99283)
---
bson/_cbsonmodule.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/bson/_cbsonmodule.c b/bson/_cbsonmodule.c
index 4e1881a275..da86cd8133 100644
--- a/bson/_cbsonmodule.c
+++ b/bson/_cbsonmodule.c
@@ -2405,6 +2405,7 @@ static PyObject* get_value(PyObject* self, PyObject* name, const char* buffer,
uint32_t c_w_s_size;
uint32_t code_size;
uint32_t scope_size;
+ uint32_t len;
PyObject* code;
PyObject* scope;
PyObject* code_type;
@@ -2424,7 +2425,8 @@ static PyObject* get_value(PyObject* self, PyObject* name, const char* buffer,
memcpy(&code_size, buffer + *position, 4);
code_size = BSON_UINT32_FROM_LE(code_size);
/* code_w_scope length + code length + code + scope length */
- if (!code_size || max < code_size || max < 4 + 4 + code_size + 4) {
+ len = 4 + 4 + code_size + 4;
+ if (!code_size || max < code_size || max < len || len < code_size) {
goto invalid;
}
*position += 4;
@@ -2442,12 +2444,9 @@ static PyObject* get_value(PyObject* self, PyObject* name, const char* buffer,
memcpy(&scope_size, buffer + *position, 4);
scope_size = BSON_UINT32_FROM_LE(scope_size);
- if (scope_size < BSON_MIN_SIZE) {
- Py_DECREF(code);
- goto invalid;
- }
/* code length + code + scope length + scope */
- if ((4 + code_size + 4 + scope_size) != c_w_s_size) {
+ len = 4 + 4 + code_size + scope_size;
+ if (scope_size < BSON_MIN_SIZE || len != c_w_s_size || len < scope_size) {
Py_DECREF(code);
goto invalid;
}

BIN
pymongo-4.3.3.tar.gz Normal file

Binary file not shown.

View File

@ -1,14 +1,15 @@
Name: python-pymongo
Version: 3.9.0
Release: 4
Version: 4.3.3
Release: 2
License: Apache License 2.0
Summary: PyMongo - the Python driver for MongoDB
URL: https://github.com/mongodb/mongo-python-driver
Source0: https://github.com/mongodb/mongo-python-driver/archive/%{version}.tar.gz
Patch01: 0001-Use-ssl.match_hostname-from-the-Python-stdlib.patch
Source0: %{pypi_source pymongo}
# patch source: https://github.com/mongodb/mongo-python-driver/commit/56b6b6dbc267d365d97c037082369dabf37405d2
Patch01: backport-CVE-2024-21506.patch
BuildRequires: python3-devel python3-setuptools
BuildRequires: python3-sphinx
BuildRequires: python3-sphinx gcc python3-pip python3-dns
%global _description \
The PyMongo distribution contains tools for interacting with \
@ -26,7 +27,7 @@ This package is an implementation of the BSON format for Python 3 version.
%package -n python3-pymongo
Summary: Python driver for MongoDB
Requires: python3-bson%{?_isa} = %{version}-%{release}
Requires: python3-bson = %{version}-%{release}
%{?python_provide:%python_provide python3-pymongo}
%description -n python3-pymongo %{_description}
@ -34,7 +35,7 @@ This package is a native Python 3 version driver for MongoDB.
%package -n python3-pymongo-gridfs
Summary: Python GridFS driver for MongoDB
Requires: python3-pymongo%{?_isa} = %{version}-%{release}
Requires: python3-pymongo = %{version}-%{release}
%{?python_provide:%python_provide python3-pymongo-gridfs}
%description -n python3-pymongo-gridfs %{_description}
@ -46,25 +47,20 @@ BuildArch: noarch
Summary: Development documents for python-pymongo
%description help
%{summary}.
The PyMongo distribution contains tools for interacting with MongoDB database from Python.
%prep
%autosetup -n mongo-python-driver-%{version} -p1
rm pymongo/ssl_match_hostname.py
%autosetup -n pymongo-%{version} -p1
%build
%py3_build
pushd doc
make %{?_smp_mflags} html
popd
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
cp -arf doc/_build/html/* %{buildroot}/%{_pkgdocdir}
chmod 755 %{buildroot}%{python3_sitearch}/bson/*.so
chmod 755 %{buildroot}%{python3_sitearch}/pymongo/*.so
%check
python3 setup.py test
@ -84,13 +80,28 @@ python3 setup.py test
%{python3_sitearch}/gridfs
%files help
%{_pkgdocdir}
%{_docdir}/python3-pymongo
%changelog
* Sun Apr 07 2024 liweigang <liweiganga@uniontech.com> - 4.3.3-2
- Fix CVE-2024-21506
* Thu May 18 2023 chenchen <chen_aka_jan@163.com> - 4.3.3-1
- upgrade to 4.3.3
* Sun Jul 24 2022 liksh <liks11@chinaunicom.com.cn> - 4.0-1
- upgrade to 4.0 for openstack yoga
* Fri Aug 06 2021 OpenStack_SIG <openstack@openeuler.org> - 3.11.3-1
- Update version to 3.11.3
* Mon May 31 2021 huanghaitao <huanghaitao8@huawei.com> - 3.9.0-5
- Completing build dependencies
* Wed Oct 21 2020 chengzihan <chengzihan2@huawei.com> - 3.9.0-4
- Remove subpackage python2-bson, python2-pymongo, python2-pymongo-gridfs
* Thu 10 2020 liuweibo <liuweibo10@huawei.com> - 3.9.0-3
* Wed Oct 21 2020 liuweibo <liuweibo10@huawei.com> - 3.9.0-3
- Fix Source0
* Fri Feb 21 2020 shanshishi <shanshishi@huawei.com> - 3.9.0-2