T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:133
- Finding
- Bearer Token Exposed Through curl Process Arguments<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:133-137` **Additional Locations**: `references/api_v0.md:31-35`, `references/api_v0.md:70` **Vulnerability Type**: Bearer token disclosure through command-line arguments **Risk Level**: Medium ### Vulnerable Code ```bash curl -sS -H "Authorization: Bearer $FOURTODO_API_TOKEN" -H "Accept: application/json" "https://4to.do/api/v0/workspaces" curl -sS -H "Authorization: Bearer $FOURTODO_API_TOKEN" -H "Accept: application/json" "https://4to.do/api/v0/todos?workspace=ws_...&show=all" curl -sS -X POST -H "Authorization: Bearer $FOURTODO_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data-raw '{"name":"...","quadrant":"IU","workspace_id":"ws_..."}' "https://4to.do/api/v0/todos" curl -sS -X POST -H "Authorization: Bearer $FOURTODO_API_TOKEN" -H "Accept: application/json" "https://4to.do/api/v0/todos/todo_.../complete" curl -sS -X POST -H "Authorization: Bearer $FOURTODO_API_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" --data-raw '{"moved_todo_id":"todo_...","previous_todo_id":"todo_...","next_todo_id":null,"quadrant":"IN"}' "https://4to.do/api/v0/todos/reorder" ``` ### Technical Analysis The shell expands `$FOURTODO_API_TOKEN` before starting `curl`. Consequently, the complete `Authorization` header, including the bearer token, is placed in curl's process argument vector. On systems where process command lines are visible to other local processes, a process with sufficient same-user, debugging, container-host, or administrative access may inspect facilities such as `/proc/<pid>/cmdline` or process-monitoring output while curl is running. This conflicts with the Skill's stated objective of using leak-resistant secret injection. The outbound API communication itself is consistent with the declared functionality: task data and authentication credentials are sent only to the documented HTTPS endpoint at `https://4to.do/api/v0`. No transmission ...[truncated 1586 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Do not place bearer tokens directly in command-line arguments. - Supply sensitive headers through a protected curl configuration delivered over standard input or a restricted file descriptor, rather than through `-H "Authorization: Bearer ..."` in the argument vector. - Ensure the token is removed from the child process environment when it is no longer required, where the runtime permits this. - If a temporary configuration file is unavoidable: - Create it with owner-only permissions, such as mode `0600`. - Use a securely generated, non-predictable path. - Delete it immediately after the request. - Install cleanup handling for failures and interrupted runs. - Prefer the hosting platform's secret store for initial injection rather than embedding tokens in prompts, repositories, shell history, logs, or broadly readable configuration files. - Restrict permissions on any OpenClaw configuration containing the token to the account that runs the Skill. - Configure the API token with the narrowest available permissions and lifetime, and rotate it immediately if command-line disclosure is suspected. - Update every affected example in both `SKILL.md` and `references/api_v0.md` so users are not instructed to adopt the insecure pattern. ]]>
