T09 · Insecure Skill Coding Practices
- Location
config.json:12- Finding
Unauthenticated Writable Terminal Exposed Through an SSH Reverse Tunnel
- Content
View full analysis
Vulnerability Details
File Location:
config.json:12-15;scripts/start_console.py:78-103, 155-176;SKILL.md:213-217
Vulnerability Type: Unauthenticated remote terminal exposure over plaintext HTTP
Risk Level: CriticalComplete Code Snippet:
json "ttyd": { "port": 7681, "path": "ttyd", "options": "-W -t fontSize=16" }python if server.get('ssh_alias'): ssh_args = [ 'ssh', '-R', f'{ttyd_port}:127.0.0.1:{ttyd_port}', ssh_target, '-N', *([] if is_windows else ['-f']), '-o', 'ServerAliveInterval=30', '-o', 'ServerAliveCountMax=3', '-o', 'ExitOnForwardFailure=yes', ] else: ssh_args = [ 'ssh', '-R', f'{ttyd_port}:127.0.0.1:{ttyd_port}', '-p', str(server['port']), f"{server['user']}@{server['host']}", '-N', *([] if is_windows else ['-f']), '-o', 'ServerAliveInterval=30', '-o', 'ServerAliveCountMax=3', '-o', 'ExitOnForwardFailure=yes', ]python ttyd_args = [ttyd_path, '-p', str(port)] if options: import shlex ttyd_args.extend(shlex.split(options)) ttyd_args.extend(['--cwd', project_path]) ttyd_args.append(shell) ttyd_args.extend(shell_args) ttyd_args.append(command)markdown 5. **Server configuration**: `GatewayPorts yes` and `AllowTcpForwarding yes`Technical Analysis
The configured
ttydoption-Wenables writable terminal interaction. The generatedttydcommand contains no authentication option and no TLS configuration. The application then creates an SSH reverse forward from the remote server port to the localttydlistener.The documentation directs users to enable
GatewayPorts yes. Depending on the SSH server configuration, this can make the reverse-forwarded port listen on a non-loopback interface and become reachable by othe ...[truncated 1373 chars]- Remediation
View remediation
Remediation Suggestions
- Do not enable writable remote access without authentication. Configure
ttydwith strong, unique credentials or a stronger identity-aware authentication proxy. - Bind the reverse-forwarded endpoint to the SSH server's loopback interface and place access behind a VPN or authenticated reverse proxy.
- Avoid globally enabling
GatewayPorts yes; use a narrowly scoped SSH configuration and firewall rule if remote exposure is explicitly required. - Enable HTTPS with a trusted certificate, or terminate TLS at a properly secured reverse proxy.
- Generate high-entropy, single-session credentials and avoid storing them in source-controlled configuration.
- Restrict the SSH server firewall so only explicitly trusted source addresses can reach the forwarded port.
- Run the console under a dedicated, unprivileged operating-system account with access only to the intended project.
- Add validation that refuses to start writable
ttydunless authentication and an approved network-access control are configured.
- Do not enable writable remote access without authentication. Configure
