crewAI
crewAI copied to clipboard
training data pickle.load has no integrity check; load_agent_from_repository imports arbitrary remote module paths
Summary
Two unsafe primitives in the training and agent-repository paths:
PickleHandler.load()—pickle.load()with no integrity check. Any actor that can write the working directory (shared CI, multi-user host) can plant a malicious pickle file whose__reduce__gadget executes arbitrary code on the next trained crew kickoff. (CWE-502)load_agent_from_repository()—importlib.import_module(tool["module"])with no allowlist. A compromised agent-package endpoint or MITM can supply an arbitrary dotted module path, executing import-time code on the local Python path. (CWE-94) Both were reproduced first-hand against crewai 1.15.16 (see also #6798, closed by stale-bot without a maintainer read).
Suggested direction
- Pickle path: HMAC-SHA256 integrity verification — write a
.pkl.sigsignature file alongside the pickle onsave(), verify withhmac.compare_digest()beforeload()deserializes. Key auto-generated per host, stored outside the working directory with0600perms. - Repository path: a local, version-pinned module allowlist plus a check that the resolved attribute is a
BaseToolsubclass before instantiation, so an allowlisted module can't smuggle an arbitrary callable throughgetattr. PR #6871 implements this and is pending reopen once this issue exists.
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.