Repository navigation
Upgrade vulnerable dependencies (Dependabot backlog, November 2026) - #893
Merged
Merged
Conversation
Recompile the requirements files with --upgrade-package for each package with an open Dependabot alert. pywb moves to 2.10.1 because 2.9.1 pins werkzeug and gevent exactly. gevent/greenlet move to the versions the Dockerfile already installs. urllib3 stays pinned at 1.26.15 (gevent deadlocks, #716). Fix the context_test environ fixture, which used an invalid SCRIPT_NAME that werkzeug 3 rejects. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
GitHub's `ubuntu-latest` runners are moving to Ubuntu 26.04, and actions/setup-python has no 3.11.7 build for 26.04 (the oldest 3.11 build for it is 3.11.15), so the Backend job fails at "Setup python". 3.11.18 is the latest 3.11 release and is available on 22.04, 24.04 and 26.04. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Since Python 3.11.9, urllib.parse.parse_qsl() calls memoryview() on non-str input. The `context` fixture's http_environ was a MagicMock from create_autospec(), so the redirect tests fail on 3.11.9+ (including the Dockerfile's 3.11.11 and CI's new 3.11.18) with "memoryview: a bytes-like object is required, not 'MagicMock'". Use an empty dict, like a request with no query string. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
karenrasmussen
approved these changes
Nov 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consolidated upgrade of the packages with open Dependabot alerts in this repo (Vanta SOC2 "packages checked for vulnerabilities" tests). One PR instead of the individual Dependabot PRs.
How
requirements/*.txtwas recompiled withpip-compile --allow-unsafe --upgrade-package <pkg>for each vulnerable package only (no blanket--upgrade), plus the few packages whose pins blocked a fix (pathspec/pytokens for black, zope.event/zope.interface so setuptools can move). All copies of a pin move together. Compiled in apython:3.11.11linux/amd64 container (the Dockerfile's Python) so platform markers match CI/prod.# via -r requirements/requirements.ininstead of-r requirements.in; comments only.werkzeug==2.2.3andgevent==23.9.0.post1exactly, so neither can move without it. 2.10.x is the smallest release that unpins gevent and moves werkzeug to 3.1.7. It also replacespkg_resourceswith importlib and brotlipy with brotlicffi.pkg_resourcesany more (pywb 2.10 dropped it; zope.event 6 / zope.interface 8 use native namespace packages), so setuptools moves to 84.2.1 everywhere. I addedsetuptoolstorequirements/requirements.in: no package depends on it now, so without it pip-compile would drop it and the image would keep the base image's setuptools 65.5.1 instead of the 78.1.1 it has today.Versions
Alerts expected to close
199 of 341 open alerts: critical 12/15, high 37/115, medium 122/177, low 28/34.
The 142 that stay open are all either deferred below (89) or attached to a file that no longer exists (53).
Deferred
requirements.txt(41 high, 18 medium). It is pinned deliberately inrequirements.inbecause urllib3 >= 1.26.16 caused deadlocks under gevent in production (Pin urllib3 to v1.26.15 #716; Dependabot was stopped from bumping it in Stop Dependabot from updating urllib3 #727; upstream gevent and weakref.finalize potentially cause non-deterministic deadlock gevent/gevent#1957, Make custom queue class feature work well with gevent urllib3/urllib3#3289). Every fix needs 1.26.18+ or 2.x, so lifting the pin is a production behaviour change that should be tested on its own under real load. It should not ride along in a bulk dependency PR.pyOpenSSL<26.2, and pyOpenSSL 26.0/26.1 requirecryptography<47/<48, so this is the highest version pywb allows. 46.0.7 clears the advisories that 46.x can fix.safe_join()and Windows device names, so Windows only). pywb 2.10.x pinswerkzeug==3.1.7. Only pywb 2.11.0 unpins it, and 2.11.0 was released four days ago with a large set of rewriting/index changes (frameSec-Fetch-Dest,Refreshheader rewriting, new wombat). That is too much to take for a Windows-only advisory.requirements.txt(3 critical, 19 high, 25 medium, 6 low: PyYAML, uWSGI, babel, future, jinja2, pywb 2.4.2, ...). That file was deleted in the 2021 "Requirements reorg" (90bd841) and does not exist onmain, but GitHub's dependency graph still lists it as a manifest with its 2020 pins, and it keeps opening new alerts against it. No code change can close these. Someone with admin access needs to dismiss them as "inaccurate", or get the dependency graph to drop the stale manifest.Test changes
tests/unit/viahtml/context_test.py: theenvironfixture usedSCRIPT_NAME: "script"(no leading slash, which isn't a valid WSGI value) with port 9999. Werkzeug 2.2 silently turned that intohttp://via/.... Werkzeug 3 buildshttp://via:9999script/and raises on the port. The fixture now usesSCRIPT_NAME: ""and port 80, which gives the samehttp://via/...URLs, so every expected value is unchanged. For valid WSGI environs, werkzeug 2.2.3 and 3.1.7 return identicalget_current_url/get_hostresults; I checked withSCRIPT_NAME""and"/script". No production code changed.Testing (local)
tox -e lint,checkformatting,tests,coverage,functests(the CI command) on Python 3.11.7: all pass, coverage 100%.docker buildof the unchanged Dockerfile: succeeds. Ran the image with supervisord/nginx/uwsgi./_statusreturns 200, and proxyingexample.com,web.hypothes.isand a Wikipedia article returns 200 with wombat and the clientembed.jsinjected.static/pywb/wombat.jsis served. In the image: pywb 2.10.1, Werkzeug 3.1.7, gevent 24.2.1, greenlet 3.1.0, urllib3 1.26.15, setuptools 84.2.1.Before merging
pywb is the core of this service, and 2.9 -> 2.10 brings a newer wombat.js (client-side rewriting). Please smoke test on QA/staging with a few real sites (including iframes and a site that uses workers) before this goes to production.
🤖 Generated with Claude Code