Skip to content

activation cache uses pickle.load (unsafe deserialization) — correction: the zip-slip vector does NOT reproduce #2203

Description

@EvolveAegis

Correction (2026-08-04)

I need to correct this report. My original write-up claimed a zip-slip → pickle RCE chain. I re-tested the zip-slip leg locally and it does not reproduce: on Python 3.13, zipfile.ZipFile.extractall sanitizes traversal — entries with .., absolute paths, or sub/../ all land inside the target directory and do not escape. So the zip-slip write primitive I described is not real, and the "RCE chain" framing is withdrawn.

What does hold:

What still holds: pickle.load on the activation cache (unsafe deserialization, CWE-502)

  • src/memos/memories/activation/kv.py:158 and src/memos/memories/activation/vllmkv.py:164 both do data = pickle.load(f) over cache files.
  • A crafted pickle runs arbitrary code on load (confirmed: pickle.load of a __reduce__-based payload executed the canary).

I have not demonstrated a working write primitive that lets an attacker plant a malicious cache file on disk, so I am not claiming this is a proven RCE — it is an unsafe-deserialization sink that should be hardened regardless (treat the cache as untrusted input: use a non-executable format like JSON/safetensors, or load only from a trusted, integrity-checked location).

Apologies for the over-stated original report; I've edited it down to the verified sink.

Suggested change

Replace pickle.load on the activation cache with a safe format (JSON/safetensors) or a safe-pickle variant, and/or load only from a trusted, non-writable location with an integrity check.

Metadata

Metadata

Labels

ai:taskDispatched to AI coding agent | 已派发给 AI 编码任务ai:testingAI agent is running tests | AI 正在运行测试area:coreMOS 编排层 / 框架底座 / 跨模块问题status:in-progressSomeone or AI is working on it | 人工或 AI 正在处理types:bugSomething isn't working | 功能异常

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions