T09 · Insecure Skill Coding Practices
- Location
scripts/send_file.py:139- Finding
Application Secrets Exposed Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Locations:
scripts/send_file.py:139-151scripts/send_image.py:139-150SKILL.md:51-67SKILL.md:72-85
Vulnerability Type: Sensitive credential exposure through process arguments and shell history
Risk Level: MediumVulnerable Code
scripts/send_file.py:python file_path = sys.argv[1] receive_id_type = sys.argv[2] receive_id = sys.argv[3] app_id = sys.argv[4] app_secret = sys.argv[5] file_name = sys.argv[6] if len(sys.argv) > 6 else os.path.basename(file_path) domain = sys.argv[7] if len(sys.argv) > 7 else "feishu"scripts/send_image.py:python image_path = sys.argv[1] receive_id_type = sys.argv[2] receive_id = sys.argv[3] app_id = sys.argv[4] app_secret = sys.argv[5] domain = sys.argv[6] if len(sys.argv) > 6 else "feishu"The documented invocation pattern also instructs users to supply the secret directly:
text python3 scripts/send_file.py file_path receive_id_type receive_id app_id app_secret python3 scripts/send_image.py image_path receive_id_type receive_id app_id app_secretTechnical Analysis
Both scripts accept the Feishu or Lark application secret as a positional command-line argument. Command-line arguments are commonly exposed through operating-system process inspection interfaces and process-monitoring utilities. Depending on the operating system and local security configuration, other users or services may be able to inspect the argument list while the script is running.
Interactive use may also store the complete command, including the application secret, in shell history. Terminal logging, automation logs, job definitions, diagnostic reports, and monitoring products may retain the same value.
The scripts send the supplied credentials over HTTPS only to allowlisted official Feishu or Lark authentication endpoints. The subsequent file and image uploads are consistent with the Skill's declared purpose. No arbitrary network destination or intentio ...[truncated 1540 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove
app_secretfrom positional command-line arguments in both scripts. - Read the secret from a protected secret manager, credential helper, or environment variable supplied by a secure execution environment.
- For interactive invocation, use
getpass.getpass()so the secret is not echoed or retained as part of the command. - If credentials must be loaded from a file, require restrictive file permissions and avoid printing the path or contents in logs.
- Update
SKILL.mdso command examples never contain a secret argument. - Keep application permissions limited to the minimum Feishu or Lark scopes needed to upload and send files or images.
- Ensure exceptions and diagnostic output never include the application secret or authorization token.
- Rotate any application credentials that may already have been exposed through shell history, process monitoring, terminal capture, or automation logs.
- Remove
