T09 · Insecure Skill Coding Practices
- Location
scripts/feishu_image.py:132- Finding
Feishu Application Secret Exposed Through Command-Line Arguments
- Content
View full analysis
3 else None cmd_secret = sys.argv[4] if len(sys.argv) > 4 else None send_image(image_path, chat_id, cmd_app_id, cmd_secret) ``` ### Technical Analysis The command-line interface permits the Feishu App ID and App Secret to be supplied as process arguments. Command-line arguments are not a secure secret-transport mechanism because they may be exposed through: - Shell command history - Process inspection utilities - Process-monitoring and endpoint-management software - Terminal session recordings - CI/CD build logs - Wrapper scripts and diagnostic output The project documentation also presents command-line credential submission as a supported configuration method. Although environment variables are recommended, retaining this alternative makes accidental credential disclosure likely. The exposed App Secret can be combined with the App ID to request a Feishu tenant access token. The effective privileges depend on the permissions granted to the associated Feishu application. ### Attack Path 1. A user invokes the script with the App ID and App Secret as positional arguments. 2. The command is retained in shell history, logs, terminal recordings, or the operating system's process metadata. 3. Another local user, monitoring agent, log reader, or compromised process obtains the arguments. 4. The attacker submits the recovered credentials to Feishu's tenant access-token endpoint. 5. The attacker uses the resulting token to exercise the Feishu application's granted permissions, potentially including image uploads and message delivery. ### Impact Assessment Successful exploitation exposes the Feishu application's identity and secret. An attacker could operate as that application within the scope of its ...[truncated 333 chars]- Remediation
View remediation
