T09 · Insecure Skill Coding Practices
- Location
scripts/check.py:79- Finding
Password Exposure Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
scripts/check.py:79-80; documented usage atSKILL.md:32-35
Vulnerability Type: Sensitive information exposure through process arguments and shell history
Risk Level: MediumVulnerable code:
python parser = argparse.ArgumentParser(description="Check password strength") parser.add_argument("password", help="Password to check") args = parser.parse_args()Documented invocation:
bash python3 scripts/check.py "your-password-here"Technical Analysis
The password-strength checker requires the password to be supplied as a positional command-line argument. Command-line arguments are not an appropriate channel for secrets because they may be:
- Saved in the user's shell history.
- Captured by terminal auditing, telemetry, or command logging.
- Temporarily exposed through process inspection facilities, subject to operating-system permissions and configuration.
- Recorded by wrapper scripts, job runners, or endpoint-monitoring products.
Although the script does not transmit or persist the password itself, the input mechanism unnecessarily exposes the plaintext password outside the process. This conflicts with the Skill's intended handling of sensitive password data.
Attack Path
- A user follows the documented instructions and runs the checker with a real password:
bash python3 scripts/check.py "VictimRealPassword" - The shell may write the complete command, including the password, into its history.
- While the process is running, its arguments may also be available to an authorized local process-inspection or monitoring facility.
- A local user, administrator, support tool, monitoring agent, log collector, or later shell-history reader obtains the plaintext password.
- If the password is reused for another account or service, the exposed value may be used in subsequent credential-based attacks.
I
...[truncated 545 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the positional password argument and read the password interactively with
getpass.getpass(), which suppresses terminal echo:python import getpass password = getpass.getpass("Password to check: ") - Pass the resulting local variable to
calculate_entropy()rather than reading the secret fromargparse. - Update
SKILL.mdso users invoke only:bash python3 scripts/check.py - If non-interactive operation is necessary, provide an explicitly documented standard-input mode and warn users against passing secrets as command-line arguments. Avoid environment variables because they may also be exposed through process or diagnostic interfaces.
- Do not print, log, cache, or persist the submitted password.
- Add tests confirming that passwords do not appear in process arguments or normal output.
- Remove the positional password argument and read the password interactively with
