PYSEC-2026-4009 Path traversal and arbitrary directory deletion/overwrite via agent profile import in local-operator
- Exploited in the wild
- Not known
- Fix
- Available
What is PYSEC-2026-4009?
PYSEC-2026-4009 is a vulnerability in local-operator, published on 5 Sep 2026.
Official description
The /v1/agents/import endpoint and AgentRegistry.import_agent() in local-operator versions before 0.47.5 trust the id field inside agent.yml of an uploaded agent profile archive when constructing the destination directory. A crafted id containing directory traversal sequences makes shutil.rmtree and shutil.copy2 operate outside the agent registry, allowing an unauthenticated client with network access to the API to recursively delete arbitrary directories and write files with the privileges of the server process. Even without traversal, an imported archive could overwrite or delete existing local agent profiles.
Version 0.47.5 assigns a fresh server-generated identifier to every imported profile, never derives a filesystem path from archive metadata, creates destination directories exclusively, and binds lop serve to 127.0.0.1 by default.
Which versions are affected by PYSEC-2026-4009?
1 open source package ship an affected version, including local-operator.
| Package | Affected | Fixed in |
|---|---|---|
local-operator PyPI | All versions | 0.47.5 |
How do I fix PYSEC-2026-4009?
Upgrade local-operator to 0.47.5 or later.
Is PYSEC-2026-4009 being exploited?
There is no known exploitation of PYSEC-2026-4009 in the wild and no public exploit code.
Sources
Also known as GHSA-22mg-8gw7-636x.