T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/audit-routing.sh:37- Finding
Overbroad Disclosure of SSH Configuration and Identity Metadata
- Content
View full analysis
Vulnerability Details
File Location:
scripts/audit-routing.sh:37-46, with equivalent diagnostic guidance inSKILL.md:92-93andreferences/patterns.md:76-79
Vulnerability Type: Excessive access to credential-related configuration and disclosure of sensitive operational metadata
Risk Level: MediumVulnerable Code
scripts/audit-routing.sh:37-46:bash echo "== SSH files ==" ls -la ~/.ssh 2>/dev/null || echo "~/.ssh not found" echo echo "== SSH permissions ==" stat -c '%a %U:%G %n' ~/.ssh ~/.ssh/* 2>/dev/null || true echo echo "== SSH config preview ==" sed -n '1,200p' ~/.ssh/config 2>/dev/null || echo "~/.ssh/config not found"Equivalent commands are recommended in
references/patterns.md:76-79:bash ls -la ~/.ssh stat -c '%a %U:%G %n' ~/.ssh ~/.ssh/* 2>/dev/null sed -n '1,200p' ~/.ssh/config git remote -vSKILL.md:92-93also recommends directly listing the SSH directory and printing the SSH configuration:bash ls -la ~/.ssh sed -n '1,200p' ~/.ssh/configTechnical Analysis
The Skill is intended to diagnose SSH key routing for one Git repository and the SSH alias used by its
originremote. However, the bundled audit script enumerates every file under the user's SSH directory, reports ownership and permissions for every entry, and prints up to 200 lines of the complete SSH client configuration.This collection is broader than necessary for repository-specific routing analysis. The SSH configuration can contain unrelated and security-sensitive operational metadata, including:
- Internal or external hostnames
- SSH usernames and nonstandard ports
- Private-key filenames and identity mappings
- Bastion or jump-host relationships
ProxyCommandorProxyJumpconfiguration- Organization-specific network topology
- Aliases associated with unrelated repositories or systems
The directory listing and permission report can also r ...[truncated 2370 chars]
- Remediation
View remediation
Remediation Suggestions
-
Remove the unconditional full-directory listing and complete SSH configuration preview from the default audit path.
-
Restrict diagnostics to the host alias inferred from the repository remote. Use the effective SSH configuration already produced by:
bash ssh -G "$alias_host"Report only fields required for routing analysis, such as
hostname,user,port,identityfile, andidentitiesonly. -
After obtaining the selected
identityfile, inspect only that specific path. Report whether it exists and whether its permissions meet the expected baseline. Do not enumerate unrelated files under~/.ssh. -
If raw SSH configuration inspection is necessary, require an explicit command-line option and informed user consent, for example:
bash scripts/audit-routing.sh --include-ssh-config /path/to/repo -
Redact sensitive values before printing or logging them. At minimum, redact unrelated hostnames, usernames, identity paths,
ProxyCommand,ProxyJump,LocalForward, andRemoteForwardvalues. -
Update
SKILL.mdandreferences/patterns.mdso their default diagnostic commands follow the same repository-scoped approach. Clearly warn users that raw SSH configuration may contain sensitive infrastructure metadata and should not be pasted into public tickets or shared logs. -
Add a concise privacy warning to the script and documentation stating that diagnostic output can reveal remote URLs and SSH identity information.
-
