T09 · Insecure Skill Coding Practices
- Location
scripts/send_image.py:115- Finding
Application Secret Exposed Through Command-Line Arguments
- Content
View full analysis
5 else "feishu" ``` `scripts/send_file.py:114-118`: ```python file_path = sys.argv[1] receive_id = sys.argv[2] app_id = sys.argv[3] app_secret = sys.argv[4] file_name = sys.argv[5] if len(sys.argv) > 5 else os.path.basename(file_path) ``` The usage instructions in `SKILL.md` likewise direct users to provide the application secret as a positional command-line argument: ```bash python3 skills/feishu-send-file/scripts/send_image.py [domain] ``` ```bash python3 skills/feishu-send-file/scripts/send_file.py [file_name] ``` ### Technical Analysis Both scripts accept the Feishu application secret through `sys.argv`. Command-line arguments are not an appropriate secret transport mechanism because they can be retained in shell history, captured by process monitoring and observability systems, included in diagnostic output, or exposed through operating-system process inspection to users with sufficient local visibility. The secret is legitimately required to obtain a tenant access token from the official Feishu or Lark authentication endpoint. The vulnerability is therefore not the transmission of the secret to that API, but its unnecessary exposure through the local process command line. No hardcoded secret was found, and the scripts do not intentionally print the secret. Nevertheless, command-line argument handling expands the credential's exposure surface beyond what the declared file-sending functional ...[truncated 1241 chars]- Remediation
View remediation
