T09 · Insecure Skill Coding Practices
- Location
scripts/read.py:1- Finding
Documented Silent Password Input Is Echoed and Written to Standard Output
- Content
View full analysis
Vulnerability Details
File Location:
scripts/read.py:1-4
Related Documentation:SKILL.md:8-17, 24
Vulnerability Type: Plaintext disclosure of sensitive input caused by unimplemented option handling
Risk Level: MediumComplete Vulnerable Code:
python #!/usr/bin/env python3 import sys prompt = sys.argv[1] if len(sys.argv) > 1 else '' print(input(prompt), end='')Technical Analysis
The skill documentation claims that the tool supports
-sfor silent password entry,-pfor prompts, and-tfor timeouts. It specifically presents the following password-handling example:bash read-tool -s -p "Password: " PASSThe implementation does not parse any of these options. It treats only the first command-line argument as a literal prompt and calls Python's standard
input()function. Standard terminal input remains visibly echoed, so the documented-sbehavior is not provided.After reading the value, the implementation also sends the complete captured input to standard output using
print(). Consequently, a password entered according to the documented usage can be exposed both on the terminal during entry and through stdout. Standard output may subsequently be captured by shell pipelines, process supervisors, CI logs, terminal recording systems, or calling agents.The script also does not implement the documented timeout or variable-storage semantics. Although those discrepancies affect reliability, the security-relevant defect is the false assurance of silent input combined with unconditional plaintext output.
Attack Path
- A user or agent relies on
SKILL.mdand invokes the documented password example:bash read-tool -s -p "Password: " PASS - The implementation interprets
-sas an ordinary prompt rather than enabling silent mode. - The user enters a password while the terminal visibly echoes the characters.
- The script prints t ...[truncated 1013 chars]
- A user or agent relies on
- Remediation
View remediation
Remediation Suggestions
- Implement explicit argument parsing, such as with Python's
argparse, for the documented-p,-t, and-soptions. - When silent mode is enabled, read input with
getpass.getpass()or another mechanism that securely disables terminal echo. - Do not write sensitive input to stdout. Define a secure and explicit mechanism for returning or consuming values, and warn callers against placing secrets in logs or command-line arguments.
- Implement the documented timeout safely, or remove the timeout claim from
SKILL.md. - Reconcile the documented variable-storage behavior with the actual process model. A child process cannot directly assign a variable in its parent shell without a deliberate shell integration mechanism.
- Add automated tests confirming that silent input is not echoed, secrets are not printed, options are parsed correctly, and unsupported argument combinations fail safely.
- Until secure silent handling is implemented, remove the password example and clearly state that the tool must not be used to capture sensitive information.
- Implement explicit argument parsing, such as with Python's
