T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:129- Finding
Account-Wide COS Permissions Violate Least Privilege
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 129-138
Vulnerability Type: Excessive cloud permissions
Risk Level: HighVulnerable Code
json { "version": "2.0", "statement": [ { "effect": "allow", "action": [ "name/cos:*" ], "resource": "*" } ] }Technical Analysis
The documented access policy grants every Tencent Cloud COS action against every COS resource available to the associated identity. This exceeds the permissions needed for individual workflows such as listing objects, uploading files, or estimating storage costs.
The policy permits sensitive administrative and destructive operations, including bucket configuration changes, ACL changes, object deletion, lifecycle modification, and bucket deletion. The implementation includes destructive functionality such as forced bucket clearing and deletion, so the excessive policy is practically usable rather than merely theoretical.
This also conflicts with the documentation's stated recommendation to apply least privilege. A single broadly authorized credential is exposed to all supported operations without resource-level restrictions, bucket-prefix restrictions, or separation between read-only and administrative roles.
Attack Path
- An attacker obtains the configured Tencent Cloud sub-user credentials through host compromise, accidental
.envexposure, malicious dependency execution, or another credential disclosure. - The attacker authenticates to Tencent Cloud COS using the unrestricted identity.
- The attacker enumerates all accessible buckets because the policy is not scoped to specific resources.
- The attacker reads objects, changes bucket ACLs or lifecycle policies, uploads or replaces content, or deletes objects.
- The attacker may permanently delete buckets and their contents where the account and COS service permit those actions.
Impact Ass
...[truncated 559 chars]
- An attacker obtains the configured Tencent Cloud sub-user credentials through host compromise, accidental
- Remediation
View remediation
Remediation Suggestions
- Replace
name/cos:*with an explicit allowlist of only the APIs required by each workflow. - Restrict
resourceto designated bucket ARNs and, where supported, approved object prefixes. - Create separate identities or policies for read-only operations, uploads, lifecycle administration, and destructive operations.
- Do not grant bucket deletion, ACL modification, or policy-management permissions to routine upload and download roles.
- Require explicit operator approval and stronger authentication for destructive administrative actions.
- Apply Tencent Cloud policy conditions such as source network, request context, and resource constraints where available.
- Rotate any credentials that have already been used with the broad policy and review COS audit logs for unauthorized activity.
- Add automated policy checks that reject wildcard actions and wildcard resources unless a documented exception is approved.
- Replace
