T09 · Insecure Skill Coding Practices
Warning
- Location
- form_fill.sh:8
- Finding
- Sensitive form data exposed through command-line arguments<![CDATA[ ## Vulnerability Details **File Location**: `form_fill.sh:8-36` **Vulnerability Type**: Sensitive data exposure through process arguments and shell history **Risk Level**: Medium ### Vulnerable Code ```bash # Usage: # ./form_fill.sh <pdf_path> <form_fields_json_string> # # Example: # ./form_fill.sh application.pdf '{"full_name": "Jane Doe", "dob": "1990-03-15"}' if [ $# -lt 2 ]; then echo "Usage: $0 <pdf_path> '<form_fields_json>'" >&2 echo "Example: $0 form.pdf '{\"name\": \"Jane Doe\"}'" >&2 exit 1 fi PDF_PATH="$1" FORM_FIELDS="$2" ``` ### Technical Analysis The shell interface requires all form values to be supplied as the second command-line argument. The Skill documentation demonstrates form data that can include names, dates of birth, addresses, Social Security numbers, income, insurance details, and other sensitive information. Command-line arguments are not an appropriate transport for such data because they may be: - Recorded in interactive shell-history files. - Visible to local process-inspection tools while the command is running. - Captured by process accounting, endpoint monitoring, audit systems, or terminal-session recording. - Retained in CI/CD logs or Agent execution transcripts. Quoting the JSON prevents shell expansion but does not prevent history or process-list exposure. The network upload is necessary for the declared cloud form-filling functionality, but placing sensitive values directly in process arguments exceeds the minimum local exposure necessary to perform that upload. ### Attack Path 1. A user follows the documented usage and invokes the script with PII embedded in the JSON command-line argument. 2. The shell records the complete command in its history, or a local monitoring facility captures the process arguments. 3. A local user, administrator, monitoring operator, compromised process, or later reader of archived logs accesses the recorded command. 4. The attacker extracts the form values without n ...[truncated 595 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace the JSON command-line argument with a path to a permission-restricted JSON file: ```bash ./form_fill.sh application.pdf form_fields.json ``` 2. Alternatively, read the data from standard input so it does not appear in the process argument list: ```bash ./form_fill.sh application.pdf < form_fields.json ``` 3. Validate that the input is a JSON object and reject unsupported input types. 4. Recommend restrictive permissions for files containing form data, such as mode `0600`. 5. Explicitly warn users not to put SSNs, financial data, medical data, credentials, or other sensitive values directly on the command line. 6. Avoid echoing the supplied JSON in normal or error output. 7. Document that local input is transmitted to the external DeepRead service and require informed user consent before submission. ]]>
