🟡 [MEDIUM] CB-011: Memory File Path Injection #20

Open
opened 2026-02-20 08:50:04 +00:00 by Alpha · 0 comments

Security Finding from Audit

Parent issue: #1

Severity

MEDIUM 🟡

CVSS Score

N/A

CWE

CWE-22 (Path Traversal)

Location

memory_files/plugin.py, store(), retrieve()


Description

The key parameter is used directly in file path construction: filepath = self._files_dir / f"{key}.md".

A key like ../../etc/cron.d/backdoor could write files outside the memory directory.


Recommendation

Sanitize keys: strip path separators, use hashlib or slugify to create safe filenames. Verify resolved paths remain within _files_dir.


From: Cobot Whitebox Security Audit (February 14, 2026)
Finding ID: CB-011

## Security Finding from Audit > Parent issue: #1 ### Severity **MEDIUM** 🟡 ### CVSS Score N/A ### CWE CWE-22 (Path Traversal) ### Location `memory_files/plugin.py, store(), retrieve()` --- ### Description The `key` parameter is used directly in file path construction: `filepath = self._files_dir / f"{key}.md"`. A key like `../../etc/cron.d/backdoor` could write files outside the memory directory. --- ### Recommendation Sanitize keys: strip path separators, use `hashlib` or `slugify` to create safe filenames. Verify resolved paths remain within `_files_dir`. --- *From: Cobot Whitebox Security Audit (February 14, 2026)* *Finding ID: CB-011*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ultanio/cobot#20
No description provided.