T09 · Insecure Skill Coding Practices
- Location
scripts/notion_helper.sh:92- Finding
Notion API Token Exposed Through Process Arguments
- Content
View full analysis
/cmdline`. The practical accessibility of another process's arguments depends on operating-system configuration, user boundaries, container isolation, and process-inspection restrictions. This issue affects every helper operation because query, create, update, and get requests all pass the token through `curl` arguments. ### Attack Path 1. The victim invokes any helper command, such as `query`, `create`, `update`, or `get`. 2. The script reads the Notion token from the local secrets file into `NOTION_KEY`. 3. The shell expands the token into the `curl` authorization-header argument. 4. During the lifetime of the request, a local attacker or compromised process with adequate process-inspection permissions observes the `curl` argument vector. 5. The attacker extracts the bearer token from the authorization header. 6. The attacker uses the captured token to make independent Notion API requests. This path requires local process v ...[truncated 742 chars]- Remediation
View remediation
"$curl_config" curl --silent --config "$curl_config" \ -X GET "$BASE_URL/pages/$page_id" \ -H "Notion-Version: $API_VERSION" ``` The implementation should also verify that the selected temporary directory is private and that cleanup occurs for all script exit paths. ]]>
