T09 · Insecure Skill Coding Practices
- Location
scripts/halo_login.py:28- Finding
Plaintext Credential and Session Storage Without Enforced File Permissions
- Content
View full analysis
dict: """Load credentials from config file.""" if not CONFIG_FILE.exists(): return None with open(CONFIG_FILE, "r") as f: return json.load(f) ``` ```python def save_session(session: requests.Session): """Save session cookies to file.""" ensure_config_dir() cookies = {} for cookie in session.cookies: cookies[cookie.name] = { "value": cookie.value, "domain": cookie.domain, "path": cookie.path } with open(SESSION_FILE, "w") as f: json.dump(cookies, f, indent=2) ``` ### Technical Analysis The application stores the Halo username, password, and authenticated session cookies as unencrypted JSON under `~/halo-manager`. The code does not explicitly assign restrictive permissions to the directory or files. Their effective permissions therefore depend on the process umask, existing file permissions, and local filesystem configuration. The session cookie is itself an authentication bearer secret. Consequently, encrypting only the password sent during login does not protect the account if `session.json` can be read. The use of ordinary `open(..., "w")` also does not protect against unsafe pre-existing files or symbolic links. This behavior is directly related to the Skill's authentication function, but retaining a ...[truncated 1252 chars]- Remediation
View remediation
