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. --- contrib/webmentions-ssg.example.cfg | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/webmentions-ssg.example.cfg b/contrib/webmentions-ssg.example.cfg index 02b0744..33afdfa 100644 --- a/contrib/webmentions-ssg.example.cfg +++ b/contrib/webmentions-ssg.example.cfg @@ -105,7 +105,23 @@ MAX_TARGET_BYTES = 1_000_000 # Background tasks (Huey) # --------------------------------------------------------------------------- # Use a shared, persistent backend for production app and worker processes. -# Redis must be running and reachable by both. +# Huey messages and results use a restricted JSON serializer; do not configure +# a pickle serializer in either process. Keep both on the same app version. +# +# SECURITY: Only the web app and trusted worker should be able to write to the +# broker. Redis should bind to loopback or a private network, with protected +# mode, firewall rules, authentication/dedicated ACLs and TLS when remote. +# Do not expose Redis to public networks or untrusted tenants: even without +# pickle, an attacker who can write jobs can invoke registered tasks. +# For file/SQLite backends, restrict directory and database permissions to +# the app/worker account. For Postgres, use a dedicated least-privilege role +# and private/ACL-restricted network access. +# +# MIGRATION FROM PICKLE: Drain outstanding jobs on the old trusted deployment +# first, stop all producers and workers, and clear or migrate old queue, +# scheduled-task and result data before restarting *both* with JSON. +# Old pickle payloads cannot be read by the new serializer. Do not deserialize +# legacy data from any backend that untrusted parties could have modified. HUEY_URL = "redis://127.0.0.1:6379/0" # --------------------------------------------------------------------------- -- cgit v1.3.1