T09 · Insecure Skill Coding Practices
Warning
- Location
- references/templates.md:43
- Finding
- Unredacted Persistence of Authorization-Bearing API Responses<![CDATA[ ## Vulnerability Details **File Location**: `references/templates.md:43` **Vulnerability Type**: Plaintext storage of potentially sensitive API responses **Risk Level**: Medium ### Vulnerable Code Snippet ```markdown ## 5) Delete media assets - API: `DeleteVideo` - Required params template: - `VideoIds`: `<video-id-1,video-id-2>` ## Evidence Checklist - Save request payloads and API responses under `output/aliyun-vod-manage/`. - Keep a mapping of input file names to returned media IDs. ``` The affected instruction is: ```markdown - Save request payloads and API responses under `output/aliyun-vod-manage/`. ``` ### Technical Analysis The evidence policy instructs the agent to persist complete request payloads and API responses without requiring secret-field redaction, restrictive file permissions, encryption, or retention limits. This workflow explicitly includes authorization-producing operations such as `CreateUploadVideo` and `GetVideoPlayAuth` in `references/templates.md:5-25`. Responses from these operations may contain temporary upload credentials, upload authorization data, playback authorization material, or signed resource information. Persisting complete responses can therefore place reusable authorization data in plaintext under the output directory. The risk is not caused by the metadata-download script, which only retrieves public OpenAPI metadata and does not access credentials. It arises when the broader Skill workflow applies the evidence instruction to authenticated VOD operations. ### Attack Path 1. A user invokes the Skill for an operation such as `CreateUploadVideo` or `GetVideoPlayAuth`. 2. Alibaba Cloud returns temporary upload or playback authorization material. 3. Following the evidence checklist, the agent saves the complete API response under `output/aliyun-vod-manage/`. 4. The generated file inherits default filesystem permissions and remains available without a defined deletion period. 5. Another local user, a ...[truncated 953 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace the blanket response-retention instruction with an allowlist-based evidence policy. 2. Never persist fields containing upload authorization, playback authorization, security tokens, signatures, cookies, AccessKey secrets, or signed URLs. 3. Store only non-sensitive evidence such as request IDs, API names, timestamps, region identifiers, operation status, and redacted resource identifiers. 4. Add operation-specific redaction for responses from `CreateUploadVideo`, `CreateUploadImage`, `GetVideoPlayAuth`, and similar authorization-producing APIs. 5. Create evidence files with owner-only permissions, such as mode `0600`, and create the output directory with mode `0700`. 6. Define a short retention period and securely delete authorization-bearing evidence after troubleshooting or validation is complete. 7. Prevent generated evidence from entering source control, CI artifacts, shared logs, or backups unless it has passed an explicit secret scan. 8. Continue delegating credential resolution to official Alibaba Cloud SDK credential providers rather than directly parsing `~/.alibabacloud/credentials`. ]]>
