T05 · Unauthorized Access and Privilege Escalation
- Location
references/platforms/gemini-cli/list-sessions.sh:87- Finding
Overbroad Home-Directory and Session Reconnaissance
- Content
View full analysis
project_root for matching candidates hash_to_path = {} def register_candidate(path): """Register a directory as a candidate if its hash exists in gemini tmp.""" abspath = os.path.abspath(path) h = sha256_hex(abspath) if h in existing_hashes: hash_to_path[h] = abspath # Scan base directories up to 3 levels deep for base in base_dirs: if not os.path.isdir(base): continue register_candidate(base) try: for e1 in os.scandir(base): if not e1.is_dir() or e1.name.startswith("."): continue register_candidate(e1.path) try: for e2 in os.scandir(e1.path): if not e2.is_dir() or e2.name.startswith("."): continue register_candidate(e2.path) try: for e3 in os.scandir(e2.path): if not e3.is_dir() or e3.name.startswith("."): continue register_candidate(e3.path) except (PermissionError, OSError): pass except (PermissionError, OSErro ...[truncated 3163 chars]- Remediation
View remediation
