T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:205- Finding
Root-Level SSH Deployment Violates Least Privilege
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 205–207
Vulnerability Type: Direct privileged SSH deployment
Risk Level: MediumComplete Code Snippet:
bash scp -B -i ~/.ssh/deploy_ode_course player-data/eXX.js root@host:/www/wwwroot/moodle/ode-course/player-data/ scp -B -i ~/.ssh/deploy_ode_course podcast_video_v4.html root@host:/www/wwwroot/moodle/ode-course/ scp -B -i ~/.ssh/deploy_ode_course quiz-bank-expansion-3.js root@host:/www/wwwroot/moodle/Technical Analysis
The documented deployment procedure authenticates directly to the destination host as
rootusing a private SSH identity. Uploading static course assets only requires narrowly scoped write access to the relevant web directories; unrestricted superuser access is unnecessary.The operation is consistent with the Skill's declared deployment functionality, and the document does not expose the private key itself. Nevertheless, using a root-capable key breaks the principle of least privilege and substantially increases the consequences of key theft, deployment-host compromise, operator error, or malicious modification of files supplied to the deployment workflow.
Attack Path
- An attacker compromises the workstation, CI environment, agent context, or account that can read
~/.ssh/deploy_ode_course. - The attacker obtains the private key or causes the documented deployment command to run with attacker-controlled behavior.
- If the destination accepts that key for unrestricted root authentication, the attacker connects as
root. - The attacker modifies files outside the intended course directories, alters server configuration, installs persistent services, accesses hosted application data, or pivots to other resources available from the server.
This path depends on the referenced key actually being authorized for unrestricted root access; the repository does not contain enough evidence to confirm the destination's SS ...[truncated 614 chars]
- An attacker compromises the workstation, CI environment, agent context, or account that can read
- Remediation
View remediation
Remediation Suggestions
- Create a dedicated, unprivileged deployment account with no interactive administrative rights.
- Grant that account write access only to the required course deployment directories.
- Disable direct root SSH login by setting
PermitRootLogin noin the SSH server configuration. - Use a deployment-specific key that is not shared with administrative workflows and protect it with appropriate filesystem permissions and secret-management controls.
- Restrict the public key in
authorized_keysusing applicable options such as a forced command, source-address restrictions, disabled port forwarding, disabled agent forwarding, disabled X11 forwarding, and disabled PTY allocation. - Prefer a controlled deployment service or CI/CD job that validates artifact paths and content before publication.
- Log and monitor deployment authentication and file changes, and rotate the key immediately if exposure is suspected.
- Update the documentation so all sample commands use the restricted deployment account rather than
root.
