T09 · Insecure Skill Coding Practices
- Location
SKILL.md:82- Finding
Encrypted PDF Password Exposed in Command-Line Arguments and Shell History
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 82–85
Vulnerability Type: Plaintext sensitive data exposure through command-line usage
Risk Level: MediumVulnerable Code:
bash curl -s -X POST \ -H "Authorization: $BANKSTATEMENT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"passwords": [{"uuid": "bb2f3c62-331e-42ee-a931-d25a5ee0946f", "password": "yourpdfpassword"}]}' \ https://api2.bankstatementconverter.com/api/v1/BankStatement/setPassword | jqTechnical Analysis
The documentation instructs users to insert an encrypted PDF's password directly into a
curlcommand. When a real password replacesyourpdfpassword, the secret becomes part of the command-line arguments.Depending on the operating system and shell configuration, the password may be:
- Persisted in the user's shell history.
- Exposed temporarily through process inspection interfaces or monitoring tools.
- Included in terminal logs, support bundles, session recordings, or command auditing.
- Disclosed if the command is copied into tickets, chat messages, or diagnostic output.
Although the request uses HTTPS, transport encryption does not prevent local disclosure before the request is transmitted. The behavior is related to the skill's stated conversion function, but the secret-handling method is unsafe.
Attack Path
- A user replaces
yourpdfpasswordwith the actual password for a bank-statement PDF. - The user runs the documented command in an interactive shell.
- The shell records the full command in its history, or a local process-monitoring or audit mechanism captures its arguments.
- A local user, administrator, malware process, history collector, or person with access to diagnostic records retrieves the command.
- The observer extracts the plaintext PDF password.
- If the observer can obtain the encrypted statement, the password may be used to access its financial content ...[truncated 648 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not instruct users to place passwords literally in interactive command lines.
- Read the password without terminal echo, for example with
read -r -s, and clear the variable immediately after use. - Generate the JSON body through standard input or a temporary file created with mode
0600, rather than embedding the password incurlarguments. - If a temporary file is necessary, create it safely with
mktemp, set restrictive permissions, register a cleanup trap, and delete it immediately after the request. - Warn users that the password is sent to a third-party conversion service and direct them to review that service's retention and privacy policies.
- Recommend disabling shell-history recording for unavoidable secret-bearing operations and avoiding terminal session recording.
- Prefer a client implementation that accepts secrets through protected standard input or another mechanism that does not expose them in process arguments.
- Apply equivalent protected-secret handling to the API key, ideally through a credential manager or a narrowly scoped environment supplied only to the command that requires it.
