T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- config.yaml:12
- Finding
- SSH Connection Uses an Unrestricted Root Account## Vulnerability Details **File Location**: `config.yaml:12-16` **Vulnerability Type**: Excessive SSH privileges and violation of least privilege **Risk Level**: High **Vulnerable Configuration**: ```yaml connections: default-server: host: hostname port: 22 username: root password: password ``` ### Technical Analysis The Skill is intended to inspect service status and read selected log data. These operations ordinarily require only narrowly scoped read access to designated log directories and, at most, permission to execute a limited set of status and filtering commands. Configuring the SSH connection to use `root` gives the Agent unrestricted control over the target host. This exceeds the minimum permissions required by the declared log-analysis functionality. Although `SKILL.md` instructs the Agent not to modify files or restart services unless requested, that is an instructional restriction rather than an enforceable access-control boundary. Any command-injection flaw, maliciously constructed incident request, incorrect command generation, or compromise of the Agent session would therefore execute within a root-level SSH context. ### Attack Path 1. An operator configures a real host under `default-server` while retaining `username: root`. 2. The Skill initiates an SSH session to perform log checks. 3. An attacker influences a diagnostic command, path, keyword, or other command input, or otherwise compromises the Agent session. 4. The resulting command is executed remotely as `root`. 5. The attacker can access or modify resources unrelated to log diagnosis because no operating-system privilege boundary limits the session. ### Impact Assessment Successful exploitation could provide complete administrative control over the configured remote server. Potential impact includes reading credentials and private application data, modifying services and configuration, accessing unrelated tenants ...[truncated 180 chars]
- Remediation
- ## Remediation Suggestions - Replace `root` with a dedicated service account created exclusively for log diagnostics. - Grant read permission only to explicitly approved log paths. - If elevated commands are unavoidable, configure `sudoers` to allow only exact, non-interactive commands with fixed arguments. - Restrict the SSH account using an authorized-key command, source-address restrictions, and disabled port forwarding, agent forwarding, and interactive shell access where practical. - Maintain an allowlist of permitted hosts, log directories, and commands. - Validate and safely quote all user-derived paths, search terms, time ranges, and service names before constructing remote commands. - Record and monitor all diagnostic SSH activity.
