T09 · Insecure Skill Coding Practices
- Location
SKILL.md:24- Finding
API Key Exposure Through Command-Line Arguments
- Content
View full analysis
# Query a specified Gregorian date python3 scripts/fetch_lunar_calendar.py # Query a specified lunar date python3 scripts/fetch_lunar_calendar.py 1 ``` The implementation also explicitly accepts an API key as a named command-line argument: ```python parser = argparse.ArgumentParser(description="TianAPI Lunar Calendar Fetcher") parser.add_argument("--key", help="API Key (optional; environment variable takes precedence)") parser.add_argument("--date", help="Query date (for example, 2024-07-13 or 2024-6-8)") ``` ### Technical Analysis The Skill encourages users to supply a TianAPI credential as a command-line argument. Secrets passed this way can be retained in interactive shell history and may be observable through process-inspection facilities while the process is running. They can also be captured by terminal logging, command auditing, debugging tools, or automation logs. The documentation uses positional arguments, while the implementation accepts `--key`. This inconsistency makes the documented examples nonfunctional, but the underlying insecure credential channel remains available through `--key`. Sending an authentication credential is necessary for the declared lunar-calendar service. Exposing that credential through process arguments is not necessary because the script already supports an environment variable and a local configuration file. ### Attack Path 1. A user follows the Skill's guidance or invokes the supported `--key` option with a valid Tia ...[truncated 789 chars]- Remediation
View remediation
