T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/verify_facts.py:174- Finding
Cross-Task Dossier Discovery and Unauthorized File Access
- Content
View full analysis
Vulnerability Details
File Location:
scripts/verify_facts.py:174-270; additional exposure inscripts/guide.py:131-157and reuse byscripts/render_dossier.py:1193-1203
Vulnerability Type: Cross-task workspace access and tenant isolation failure
Risk Level: HighVulnerable Code
python def task_drive_roots() -> list: roots = [] state = os.environ.get("OUROBOROS_SKILL_STATE_DIR") if state: for parent in pathlib.Path(state).resolve().parents: cand = parent / "task_drives" if cand.is_dir(): roots.append(cand) break for cand in (pathlib.Path("/data/task_drives"), pathlib.Path.home() / "ouroboros-data" / "data" / "task_drives"): if cand.is_dir() and cand not in roots: roots.append(cand) return roots def find_in_task_drives(rel: pathlib.Path): best = None recent = [] AMBIGUOUS.clear() now = time.time() for root in task_drive_roots(): try: dirs = [d for d in root.iterdir() if d.is_dir()] except OSError: continue for d in dirs: f = d / rel try: if f.is_file(): m = f.stat().st_mtime if now - m <= CONCURRENT_WINDOW_SEC: recent.append(f) if now - m <= FRESH_INPUT_HOURS * 3600 and (best is None or m > best[0]): best = (m, f) except OSError: continue if len(recent) > 1: AMBIGUOUS.extend(str(f) for f in recent) return None return best[1] if best else None def resolve_input(raw: str) -> tuple: p = pathlib.Path(raw).expanduser() tried = [] candidates = [p] if not p.is_absolute(): v = os.environ.get("OUROBOROS_TASK_DRIVE") ...[truncated 4577 chars]- Remediation
View remediation
Remediation Suggestions
- Restrict input lookup to the current
OUROBOROS_TASK_DRIVE. - If the current task directory is unavailable, require an explicit absolute path rather than scanning global task roots.
- Remove fallback enumeration of
/data/task_drivesand~/ouroboros-data/data/task_drives. - Remove sibling-task enumeration from
guide.py status; inspect only the current task's files. - If cross-task access is an intended administrative feature, require a platform-issued task identifier and verify ownership or an explicit authorization capability before opening the file.
- Canonicalize the selected path with
resolve()and verify that it is contained within the authorized current-task root. - Do not use freshness or filename uniqueness as authorization controls.
- Add tests proving that a relative filename cannot resolve to a sibling task, even when that sibling file is newer or is the only matching candidate.
- Restrict input lookup to the current
