You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Keep project moves inside the authorized destination root #1896
Follow-up from the reviewed CodeRabbit deep scan (K13). This ticket tracks one distinct fix; duplicate scan rows are consolidated here.
Reviewed evidence and scope
K13 (scan ID 63e1e6fe-e753-41af-a5c8-94d72228ccf2, review A, Medium): move_project accepts a replacement absolute path without preserving project_root. Local/API configuration boundary, not proof of a Cloud tenant escape.
Source at current baseline: src/basic_memory/services/project_service.py:740.
Fix and validation
Keep project moves inside the authorized destination root.
Recheck current callers and supported behavior before choosing the smallest complete fix.
Add a bounded regression at the affected public or service boundary; demonstrate it fails without the fix.
Preserve legitimate inputs and tenant/project boundaries. Run focused tests plus repository static/type checks.
The scan/review establishes the code-level concern described above; it does not establish production exploitation. Conditional branches and local/tooling-only exposure must retain that scope.
Type: bug (security hardening). Labeled bug; the existing security label is kept.
Component: Services/API and MCP project management (ProjectService.move_project). This is not Cloud-specific, and the issue says it isn't a proven tenant escape.
Priority: Medium, in line with the scan's rating. It's a local/API configuration boundary and not proof of production exploitation.
Complexity: Simple to medium.
Observations
In src/basic_memory/services/project_service.py (move_project, around lines 725-760), new_path is expanded and absolutized, then saved to config and the DB. When config.project_root is set, the code skips directory creation but never checks that the resolved path is inside project_root. A caller can therefore move a project outside the authorized root.
Suggested direction
Validate resolved_path against project_root when it is set, and fail fast with ValueError.
Check how project creation enforces the same constraint and reuse that helper, so add and move behave the same.
Resolve symlinks and .. before the containment check.
Check update_project in the same file. It also accepts an arbitrary path without any root check, though it's marked no cover.
Add a regression test at the service boundary, and at the API router if it's cheap. It should fail without the fix. Existing in-root moves and the no-project_root local mode must keep working.
No duplicate issues were found. I did not implement anything, per triage scope.
Activity
claude commentedon Oct 28, 2026
Claude finished @phernandez's task in 17s —— View job
Triage
bug; the existingsecuritylabel is kept.ProjectService.move_project). This is not Cloud-specific, and the issue says it isn't a proven tenant escape.Observations
In
src/basic_memory/services/project_service.py(move_project, around lines 725-760),new_pathis expanded and absolutized, then saved to config and the DB. Whenconfig.project_rootis set, the code skips directory creation but never checks that the resolved path is insideproject_root. A caller can therefore move a project outside the authorized root.Suggested direction
resolved_pathagainstproject_rootwhen it is set, and fail fast withValueError...before the containment check.update_projectin the same file. It also accepts an arbitrary path without any root check, though it's markedno cover.project_rootlocal mode must keep working.No duplicate issues were found. I did not implement anything, per triage scope.
fix(core): preserve configured project root during moves (basicmachin…