-
Notifications
You must be signed in to change notification settings - Fork 13
fix: patch 18 of 24 CVEs in pdp-v2 image (PER-15358) #318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dshoen619
merged 3 commits into
main
from
david/per-15358-fix-24-cves-8-critical-16-high-in-pdp-v2-docker-image
Jul 7, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| """Pytest configuration and compatibility shims for the horizon test-suite. | ||
|
|
||
| aioresponses (our HTTP mocking library) builds ``aiohttp.ClientResponse`` | ||
| instances directly. aiohttp 3.14 made ``stream_writer`` a *required* | ||
| keyword-only argument of ``ClientResponse.__init__`` (it is only read for its | ||
| ``output_size``), which the latest released aioresponses (0.7.9) does not pass, | ||
| so every mocked response raises:: | ||
|
|
||
| TypeError: ClientResponse.__init__() missing 1 required keyword-only | ||
| argument: 'stream_writer' | ||
|
|
||
| We intentionally stay on the aiohttp 3.14.x line: the June 2026 security fixes | ||
| (e.g. GHSA-63hw-fmq6-xxg2 and the other advisories in that batch) landed in | ||
| 3.14 and were not backported to 3.13.x, so pinning aiohttp down just to satisfy | ||
| aioresponses would reintroduce those CVEs into the shipped image. Instead we | ||
|
Comment on lines
+12
to
+15
|
||
| mirror the upstream aioresponses fix (PR #288, not yet released) by injecting a | ||
| dummy ``stream_writer``. This is a no-op on aiohttp < 3.14 and can be removed | ||
| once aioresponses publishes a release that includes PR #288. | ||
| """ | ||
|
|
||
| import inspect | ||
| from unittest.mock import Mock | ||
|
|
||
| import aioresponses.core as _aioresponses_core | ||
| from aiohttp.client_reqrep import ClientResponse as _ClientResponse | ||
|
|
||
| if "stream_writer" in inspect.signature(_ClientResponse.__init__).parameters: | ||
|
|
||
| class _StreamWriterCompatClientResponse(_ClientResponse): | ||
| """ClientResponse that supplies aiohttp 3.14's required stream_writer.""" | ||
|
|
||
| def __init__(self, *args, **kwargs): | ||
| if "stream_writer" not in kwargs: | ||
| kwargs["stream_writer"] = Mock(output_size=0) | ||
| super().__init__(*args, **kwargs) | ||
|
|
||
| # aioresponses._build_response falls back to this module-level name when the | ||
| # matcher has no explicit response_class, which is the case for all of our | ||
| # mocks. Patching it here routes every mocked response through the subclass. | ||
| _aioresponses_core.ClientResponse = _StreamWriterCompatClientResponse | ||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[MEDIUM] Unrelated pdp-tester CI migration bundled into a CVE-patch PR (duplicates open PR #319)
Problem: This PR's stated purpose is patching CVEs in the pdp-v2 image (the
requirements.txtcryptography bump + the aioresponses test shim). The entire k3d -> Docker-runtime migration of thepdp-testerjob (commit 75d974b) is unrelated to that goal and is the whole subject of a separate open PR, #319 (PER-15361). Both PRs edit.github/workflows/tests.yml, and the two copies have already diverged: #319 additionally addstimeout-minutes: 15on the job,cache: "pip"onsetup-python, and explicit non-zero-exit handling (... || status=$?then a laterexit 1) so a tester crash that does not printtest cases failedstill fails the step. This copy has none of those. Whichever PR merges first forces a conflict on the other; if this (older) copy lands first, #319's hardening is at risk of being dropped or re-litigated during conflict resolution.Suggestion: Drop the
tests.ymlchange from this PR and let #319 own the pdp-tester migration, keeping this PR scoped torequirements.txt+horizon/tests/conftest.py. Alternatively, if this PR should carry the migration, close #319 and port itstimeout-minutes/ pip-cache / exit-status handling here so the better version is the one that lands.