T09 · Insecure Skill Coding Practices
- Location
references/workflow-manage.md:7- Finding
Session Token Exposure Through Command-Line Arguments
- Content
View full analysis
--take 50 --session ``` Similar command-line token usage appears throughout the publishing and revision workflows: ```bash node cli.mjs validate-session --session ``` ```bash node cli.mjs upload-image --session ``` The CLI explicitly accepts the session as a command-line option: ```javascript session:{type:`string`,description:`PA-User-Session token`} ``` ### Technical Analysis `PA-User-Session` is an authenticated browser session credential. Passing it through `--session` places the secret in the process argument vector. Depending on the operating system and execution environment, command arguments may be exposed through: - Shell history files. - Process inspection utilities. - Agent or tool invocation logs. - Terminal recording and observability systems. - CI/CD job logs or debugging output. - Local users with permission to inspect processes. The CLI sends this token in the `PA-User-Session` header to the fixed PANews endpoint at `https://universal-api.panewslab.com`. This transmission is necessary for the declared functionality and no unrelated receiver was found. The vulnerability is the local handling of the credential before transmission. `references/workflow-apply-column.md:21-22` correctly warns that command-line tokens may be exposed and recommends environment variables or a credential store. The other workflows contradict that guidance by repeatedly demonstrating `--session `. ### Attack Path 1. A user or agent follows one of the documented examples and invokes the CLI with ...[truncated 1145 chars]- Remediation
View remediation
` from every workflow example. 2. Consistently use a protected credential source, such as: - An operating-system credential store. - A dedicated secret manager. - Standard input with echo disabled. - A narrowly scoped environment variable when stronger storage is unavailable. 3. Prefer stdin or an OS credential store over environment variables because environment values may also be observable in some process and diagnostic environments. 4. Deprecate the `--session` option or require an explicit unsafe-compatibility flag before accepting credentials through process arguments. 5. Ensure agent and tool integrations redact values associated with `session`, `PA-User-Session`, `PANEWS_USER_SESSION`, `PA_USER_SESSION`, and `PA_USER_SESSION_ID`. 6. Add automated documentation checks that reject examples containing `--session` followed by a token placeholder. 7. Document session revocation and rotation procedures for users who may already have exposed a token. ]]>
