Skip to content

Commit e19d2a0

Browse files
committed
chore(deps): upgrade urllib3 to 2.6.3
* Upgrades urllib3 from 1.26.20 to 2.6.3 to resolve security vulnerabilities: - GHSA-pq67-6m6q-mj2v - CVE-2025-66418 - CVE-2025-66471 - CVE-2026-21441 * Updates pyproject.toml constraint from "urllib3 (<2.0.0)" to "urllib3 (>=2.6.0,<3.0.0)". * Removes all vulnerability exceptions from scripts/test as they are now resolved (4 urllib3 CVEs) or patched (nbconvert CVE-2025- 53000 fixed in 7.17.0). * Also includes code quality fixes: - Fix pytest.raises to use context manager form (RUF061) - Format code with ruff Co-Authored-by: Peter Weber <[email protected]>
1 parent ca206fa commit e19d2a0

File tree

5 files changed

+507
-405
lines changed

5 files changed

+507
-405
lines changed

pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,10 @@ dependencies = [
7373
"dcxml (>=0.1.2)",
7474
"DeepDiff (>=5.5.0)",
7575
"docutils (<0.18.0)",
76-
# to avoid conflict for urllib3
7776
"dparse (>=0.5.2)",
7877
"Mako (>=1.2.2)",
7978
"jsonresolver",
80-
# needed for elasticsearch 7.13.4
81-
"urllib3 (<2.0.0)",
79+
"urllib3 (>=2.6.0,<3.0.0)",
8280
"pyparsing (>=3.1.1)",
8381
"dnspython (>2.4.2)",
8482
"cryptography (>41.0.7)",

rero_ils/theme/menus.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,10 @@ def init_menu_tools(app):
160160
"viewcode": request.view_args.get("viewcode", app.config.get("RERO_ILS_SEARCH_GLOBAL_VIEW_CODE")),
161161
"recordType": "collections",
162162
},
163-
visible_when=lambda: app.config.get("RERO_ILS_SEARCH_GLOBAL_VIEW_CODE")
164-
!= request.view_args.get("viewcode", app.config.get("RERO_ILS_SEARCH_GLOBAL_VIEW_CODE")),
163+
visible_when=lambda: (
164+
app.config.get("RERO_ILS_SEARCH_GLOBAL_VIEW_CODE")
165+
!= request.view_args.get("viewcode", app.config.get("RERO_ILS_SEARCH_GLOBAL_VIEW_CODE"))
166+
),
165167
text=TextWithIcon(icon='<i class="fa fa-graduation-cap"></i>', text="Exhibition/course"),
166168
order=2,
167169
id="collections-menu",
@@ -311,8 +313,9 @@ def is_not_read_only():
311313
rero_register(
312314
item,
313315
endpoint="security.register",
314-
visible_when=lambda: not app.config.get("RERO_ILS_PUBLIC_USERPROFILES_READONLY", False)
315-
and not current_user.is_authenticated,
316+
visible_when=lambda: (
317+
not app.config.get("RERO_ILS_PUBLIC_USERPROFILES_READONLY", False) and not current_user.is_authenticated
318+
),
316319
text=TextWithIcon(icon='<i class="fa fa-user-plus"></i>', text="Sign Up"),
317320
order=2,
318321
id="signup-menu",

scripts/test

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,7 @@ fi
7373

7474
function pretests () {
7575
info_msg "Check vulnerabilities:"
76-
# nbconvert 7.16.6 CVE-2025-53000
77-
add_exceptions "CVE-2025-53000"
78-
# urllib3 1.26.20 GHSA-pq67-6m6q-mj2v 2.5.0
79-
add_exceptions "GHSA-pq67-6m6q-mj2v"
80-
# urllib3 1.26.20 CVE-2025-66418 2.6.0
81-
add_exceptions "CVE-2025-66418"
82-
# urllib3 1.26.20 CVE-2025-66471 2.6.0
83-
add_exceptions "CVE-2025-66471"
84-
# urllib3 1.26.20 CVE-2026-21441 2.6.3
85-
add_exceptions "CVE-2026-21441"
86-
PIPAPI_PYTHON_LOCATION=`which python` pip-audit ${pip_audit_exceptions}
76+
PIPAPI_PYTHON_LOCATION=`which python` pip-audit
8777

8878
info_msg "Check json:"
8979
invenio reroils utils check_json tests/data rero_ils/modules data

tests/api/selfcheck/test_models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,5 @@ def test_selfcheckuser(app):
6868
comments="a third comment",
6969
)
7070
db.session.add(selfcheck_terminal)
71-
pytest.raises(IntegrityError, db.session.commit)
71+
with pytest.raises(IntegrityError):
72+
db.session.commit()

0 commit comments

Comments
 (0)