crewAI icon indicating copy to clipboard operation
crewAI copied to clipboard

training data pickle.load has no integrity check; load_agent_from_repository imports arbitrary remote module paths

Open Varshith-Kali opened this issue 1 month ago • 3 comments

Summary

Two unsafe primitives in the training and agent-repository paths:

  1. 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)
  2. 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.sig signature file alongside the pickle on save(), verify with hmac.compare_digest() before load() deserializes. Key auto-generated per host, stored outside the working directory with 0600 perms.
  • Repository path: a local, version-pinned module allowlist plus a check that the resolved attribute is a BaseTool subclass before instantiation, so an allowlisted module can't smuggle an arbitrary callable through getattr. PR #6871 implements this and is pending reopen once this issue exists.

Varshith-Kali avatar Oct 09 '26 17:10 Varshith-Kali

OSS-212

linear[bot] avatar Oct 19 '26 21:10 linear[bot]

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.

github-actions[bot] avatar Nov 19 '26 12:11 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Nov 24 '26 12:11 github-actions[bot]