From 53370723df05193938ce3c2d55a8e12f2a87b17b Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Fri, 30 Oct 2026 20:41:25 +0100 Subject: fix(core): replace Huey pickle serialization with JSON Prevent broker-controlled task and result payloads from deserializing arbitrary Python objects by using a restricted JSON serializer with an explicit type allowlist. Fail closed on serializer overrides and document broker isolation and migration requirements for existing pickle-backed deployments. --- tests/tasks/test_receiver.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tests/tasks/test_receiver.py') diff --git a/tests/tasks/test_receiver.py b/tests/tasks/test_receiver.py index 102410d..c795115 100644 --- a/tests/tasks/test_receiver.py +++ b/tests/tasks/test_receiver.py @@ -688,8 +688,9 @@ def test_fetch_source_rejects_unsafe_destination( client = httpx_client.return_value.__enter__.return_value client.stream.side_effect = UnsafeAddressError("Local address") - with app.app_context(), pytest.raises( - receiver.VerificationError, match="non-public address" + with ( + app.app_context(), + pytest.raises(receiver.VerificationError, match="non-public address"), ): receiver.fetch_source(SOURCE_URL) @@ -700,8 +701,9 @@ def test_fetch_source_treats_dns_failure_as_temporary( ) -> None: client = httpx_client.return_value.__enter__.return_value client.stream.side_effect = AddressResolutionError("DNS timeout") - with app.app_context(), pytest.raises( - receiver.TemporaryFetchError, match="could not be resolved" + with ( + app.app_context(), + pytest.raises(receiver.TemporaryFetchError, match="could not be resolved"), ): receiver.fetch_source(SOURCE_URL) -- cgit v1.3.1