T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:360
- Finding
- Exposure and Insecure Handling of Reusable Confluence Session Cookies<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:360-438` **Vulnerability Type**: Plaintext authentication-secret handling **Risk Level**: High ### Vulnerable Code ```powershell $cookie = "JSESSIONID=xxx; CONFLAuth=xxx" $imagesDir = "$outputDir\images" $maxRetries = 3 $result = curl.exe -L -o $outputFile $imageUrl ` -H "Cookie: $cookie" ` -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" ` --silent --show-error ` 2>&1 ``` The surrounding instructions direct the user to copy a complete browser cookie string, including `JSESSIONID`, `CONFLAuth`, and potentially other cookies, and provide it to the agent. ### Technical Analysis The skill handles reusable Confluence session credentials as plaintext input and then embeds them directly in PowerShell variables and `curl.exe` command-line arguments. This exposes the credentials to multiple unnecessary surfaces: - Conversation or agent execution history - Debugging and diagnostic logs - Shell transcripts and command history - Process command-line inspection - Child sessions created by the agent - Accidental inclusion in generated artifacts or error reports A complete session cookie may provide access equivalent to the authenticated user. Requesting all browser cookies also violates least-privilege principles because unrelated analytics, routing, or authentication cookies may be disclosed even when they are not necessary for the export. The use of HTTPS protects cookies while they are transmitted to Confluence, but it does not mitigate local plaintext exposure or disclosure through the agent context. ### Attack Path 1. A user signs in to a private Confluence deployment. 2. The skill instructs the user to copy reusable authentication cookies from browser storage. 3. The user submits the complete cookie string to the agent. 4. The agent places the cookie in a plaintext variable and supplies it as a command-line header to `curl.exe`. 5. A party with acce ...[truncated 955 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Do not ask users to paste complete browser cookie strings into the conversation. 2. Use an approved browser-session integration or operating-system secret store that does not expose raw credentials to the model. 3. Prefer a narrowly scoped Confluence API token or OAuth token with read-only access to the required space and pages. 4. Pass secrets through a protected mechanism such as an inherited file descriptor or restricted temporary configuration file rather than command-line arguments. 5. Restrict every authenticated request to the validated Confluence origin. Reject redirects to a different host before forwarding credentials. 6. Never send cookies to child sessions, generated documents, logs, status messages, or error output. 7. Redact `Cookie`, `Authorization`, `JSESSIONID`, and `CONFLAuth` values in all telemetry. 8. Clear secret variables immediately after the authenticated operation and ensure temporary secret material is securely removed. 9. Document credential revocation and session-expiration procedures for accidental disclosure. ]]>
