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/forms/test_init.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests/forms/test_init.py') diff --git a/tests/forms/test_init.py b/tests/forms/test_init.py index ffcbd8e..0f5cb23 100644 --- a/tests/forms/test_init.py +++ b/tests/forms/test_init.py @@ -113,8 +113,7 @@ def test_endpoint_does_not_do_dns_in_web_request( raise AssertionError("No DNS lookup belongs in form validation") monkeypatch.setattr( - "webmentions_ssg.url_security.dns.resolver.resolve_name", - unexpected_dns_lookup, + "webmentions_ssg.url_security.dns.resolver.resolve_name", unexpected_dns_lookup ) with app.test_request_context("/endpoint", method="POST"): for source in (VALID_SOURCE, "ftp://source.example/post", "not a URL"): @@ -125,7 +124,9 @@ def test_endpoint_does_not_do_dns_in_web_request( assert form.validate() is (source == VALID_SOURCE) -@pytest.mark.parametrize("source", ["http://127.0.0.1/", "http://[::1]/", "http://169.254.169.254/"]) +@pytest.mark.parametrize( + "source", ["http://127.0.0.1/", "http://[::1]/", "http://169.254.169.254/"] +) def test_endpoint_rejects_private_ip_literals(app: Flask, source: str) -> None: with app.test_request_context("/endpoint", method="POST"): form = EndpointForm( -- cgit v1.3.1