Skip to content

Commit 1486d1c

Browse files
mitchh456claude
andcommitted
Add security warning when RQ uses default pickle serializer
Addresses CVE concern (CWE-502) where RQ's default pickle serializer can enable RCE via Redis. Scout's own code does not use pickle, but this warning helps users identify the risk in their RQ configuration. Closes #842 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 58a6eed commit 1486d1c

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/scout_apm/rq.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,20 @@ def ensure_job_instrumented():
5757
job_instrumented = True
5858
Job.perform = wrap_perform(Job.perform)
5959

60+
try:
61+
from rq.serializers import DefaultSerializer
62+
import pickle
63+
64+
if getattr(DefaultSerializer, "dumps", None) is pickle.dumps:
65+
logger.warning(
66+
"RQ is using the default pickle serializer, which is vulnerable to "
67+
"Remote Code Execution (RCE) via Redis (CWE-502). Consider switching "
68+
"to a safer serializer like rq.serializers.JSONSerializer. "
69+
"See https://github.com/rq/rq/issues/2389 for details."
70+
)
71+
except Exception:
72+
pass
73+
6074

6175
@wrapt.decorator
6276
def wrap_perform(wrapped, instance, args, kwargs):

0 commit comments

Comments
 (0)