T09 · Insecure Skill Coding Practices
- Location
scripts/add_user.sh:3- Finding
Bearer Tokens Exposed Through Command-Line Arguments
- Content
View full analysis
# 示例: ./add_user.sh https://panel.example.com:2053 "Bearer eyJ..." user@example.com 50 30 "[3,5]" PANEL_URL="$1" TOKEN="$2" ``` ```bash # scripts/list_users.sh:3-7 # 用法: ./list_users.sh # 示例: ./list_users.sh https://panel.example.com:2053 "Bearer eyJ..." PANEL_URL="$1" TOKEN="$2" ``` ```bash # scripts/online_users.sh:3-6 # 用法: ./online_users.sh PANEL_URL="$1" TOKEN="$2" ``` ```bash # scripts/server_status.sh:3-7 # 用法: ./server_status.sh # 示例: ./server_status.sh https://panel.example.com:2053 "Bearer eyJ..." PANEL_URL="$1" TOKEN="$2" ``` ### Technical Analysis All four scripts require a bearer token to be supplied as a positional command-line argument. Command-line arguments are not a secure credential transport mechanism because they may be: - Saved in interactive shell history. - Recorded by terminal management, auditing, or monitoring software. - Visible in process listings while the script is running, subject to operating-system process visibility controls. - Exposed in automation logs, job definitions, troubleshooting output, or copied command examples. The scripts subsequently place this token in the `Authorization` header. A disclosed token can therefore be replayed without knowing the administrator's password. The project's API documentation indicates that bearer tokens can authenticate administrative panel endpoints. The actual impact depends on the permissions assigned to the exposed token and the panel's access controls. ### Attack Path 1. An admin ...[truncated 1046 chars]- Remediation
View remediation
