Compare commits
10 Commits
ad29e9e359
...
ae372fc0f7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae372fc0f7 | ||
|
|
42683a1e91 | ||
|
|
54394ee00c | ||
|
|
58cc564bcf | ||
|
|
33be4bc74c | ||
|
|
b10c6948fe | ||
|
|
9b41b25fde | ||
|
|
6d1c251c18 | ||
|
|
3948555110 | ||
|
|
b16f611310 |
@ -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.
|
|
||||||
BIN
3.9.0.tar.gz
BIN
3.9.0.tar.gz
Binary file not shown.
47
backport-CVE-2024-21506.patch
Normal file
47
backport-CVE-2024-21506.patch
Normal 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
BIN
pymongo-4.3.3.tar.gz
Normal file
Binary file not shown.
@ -1,14 +1,15 @@
|
|||||||
Name: python-pymongo
|
Name: python-pymongo
|
||||||
Version: 3.9.0
|
Version: 4.3.3
|
||||||
Release: 4
|
Release: 2
|
||||||
License: Apache License 2.0
|
License: Apache License 2.0
|
||||||
Summary: PyMongo - the Python driver for MongoDB
|
Summary: PyMongo - the Python driver for MongoDB
|
||||||
URL: https://github.com/mongodb/mongo-python-driver
|
URL: https://github.com/mongodb/mongo-python-driver
|
||||||
Source0: https://github.com/mongodb/mongo-python-driver/archive/%{version}.tar.gz
|
Source0: %{pypi_source pymongo}
|
||||||
Patch01: 0001-Use-ssl.match_hostname-from-the-Python-stdlib.patch
|
# patch source: https://github.com/mongodb/mongo-python-driver/commit/56b6b6dbc267d365d97c037082369dabf37405d2
|
||||||
|
Patch01: backport-CVE-2024-21506.patch
|
||||||
|
|
||||||
BuildRequires: python3-devel python3-setuptools
|
BuildRequires: python3-devel python3-setuptools
|
||||||
BuildRequires: python3-sphinx
|
BuildRequires: python3-sphinx gcc python3-pip python3-dns
|
||||||
|
|
||||||
%global _description \
|
%global _description \
|
||||||
The PyMongo distribution contains tools for interacting with \
|
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
|
%package -n python3-pymongo
|
||||||
Summary: Python driver for MongoDB
|
Summary: Python driver for MongoDB
|
||||||
Requires: python3-bson%{?_isa} = %{version}-%{release}
|
Requires: python3-bson = %{version}-%{release}
|
||||||
%{?python_provide:%python_provide python3-pymongo}
|
%{?python_provide:%python_provide python3-pymongo}
|
||||||
|
|
||||||
%description -n python3-pymongo %{_description}
|
%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
|
%package -n python3-pymongo-gridfs
|
||||||
Summary: Python GridFS driver for MongoDB
|
Summary: Python GridFS driver for MongoDB
|
||||||
Requires: python3-pymongo%{?_isa} = %{version}-%{release}
|
Requires: python3-pymongo = %{version}-%{release}
|
||||||
%{?python_provide:%python_provide python3-pymongo-gridfs}
|
%{?python_provide:%python_provide python3-pymongo-gridfs}
|
||||||
|
|
||||||
%description -n python3-pymongo-gridfs %{_description}
|
%description -n python3-pymongo-gridfs %{_description}
|
||||||
@ -46,25 +47,20 @@ BuildArch: noarch
|
|||||||
Summary: Development documents for python-pymongo
|
Summary: Development documents for python-pymongo
|
||||||
|
|
||||||
%description help
|
%description help
|
||||||
%{summary}.
|
The PyMongo distribution contains tools for interacting with MongoDB database from Python.
|
||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n mongo-python-driver-%{version} -p1
|
%autosetup -n pymongo-%{version} -p1
|
||||||
rm pymongo/ssl_match_hostname.py
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%py3_build
|
%py3_build
|
||||||
|
|
||||||
pushd doc
|
|
||||||
make %{?_smp_mflags} html
|
|
||||||
popd
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%py3_install
|
%py3_install
|
||||||
|
|
||||||
install -d -m755 %{buildroot}/%{_pkgdocdir}
|
chmod 755 %{buildroot}%{python3_sitearch}/bson/*.so
|
||||||
cp -arf doc/_build/html/* %{buildroot}/%{_pkgdocdir}
|
chmod 755 %{buildroot}%{python3_sitearch}/pymongo/*.so
|
||||||
|
|
||||||
%check
|
%check
|
||||||
python3 setup.py test
|
python3 setup.py test
|
||||||
@ -84,13 +80,28 @@ python3 setup.py test
|
|||||||
%{python3_sitearch}/gridfs
|
%{python3_sitearch}/gridfs
|
||||||
|
|
||||||
%files help
|
%files help
|
||||||
%{_pkgdocdir}
|
%{_docdir}/python3-pymongo
|
||||||
|
|
||||||
%changelog
|
%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
|
* Wed Oct 21 2020 chengzihan <chengzihan2@huawei.com> - 3.9.0-4
|
||||||
- Remove subpackage python2-bson, python2-pymongo, python2-pymongo-gridfs
|
- 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
|
- Fix Source0
|
||||||
|
|
||||||
* Fri Feb 21 2020 shanshishi <shanshishi@huawei.com> - 3.9.0-2
|
* Fri Feb 21 2020 shanshishi <shanshishi@huawei.com> - 3.9.0-2
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user