diff options
| author | Dennis Fink | 2026-10-30 20:41:25 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-10-30 20:41:25 +0100 |
| commit | 53370723df05193938ce3c2d55a8e12f2a87b17b (patch) | |
| tree | e67ec12d3635d141bdc670fbfc5fa6bfb87cd69c /contrib | |
| parent | 13a9d9ddce09230017699bc34ac3bf08ed2f84ed (diff) | |
| download | webmentions-ssg-53370723df05193938ce3c2d55a8e12f2a87b17b.tar.gz webmentions-ssg-53370723df05193938ce3c2d55a8e12f2a87b17b.zip | |
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.
Diffstat (limited to '')
| -rw-r--r-- | contrib/webmentions-ssg.example.cfg | 18 |
1 files changed, 17 insertions, 1 deletions
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" # --------------------------------------------------------------------------- |
