T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- references/iam-agency.md:99
- Finding
- Permanent OBS Agency Grants Excessive Account-Wide Storage Privileges<![CDATA[ ## Vulnerability Details **File Location**: `references/iam-agency.md:99-179` **Vulnerability Type**: Overprivileged persistent IAM delegation **Risk Level**: High ### Vulnerable Code ```bash hcloud IAM CreateAgencyCustomPolicy \ --role.display_name="policy_ai4s_llma4ad" \ --role.description="AI4S LLM4AD delegation policy" \ --role.description_cn="LLM4AD cross-service delegation policy" \ --role.type="AX" \ --role.policy.Version="1.1" \ --role.policy.Statement.1.Effect="Allow" \ --role.policy.Statement.1.Action.1="iam:agencies:assume" \ --role.policy.Statement.1.Action.2="obs:bucket:CreateBucket" \ --role.policy.Statement.1.Action.3="obs:bucket:DeleteBucket" \ --role.policy.Statement.1.Action.4="obs:bucket:DeleteBucketPolicy" \ --role.policy.Statement.1.Action.5="obs:bucket:GetBucketAcl" \ --role.policy.Statement.1.Action.6="obs:bucket:GetBucketLocation" \ --role.policy.Statement.1.Action.7="obs:bucket:GetBucketPolicy" \ --role.policy.Statement.1.Action.8="obs:bucket:GetBucketQuota" \ --role.policy.Statement.1.Action.9="obs:bucket:GetBucketStorage" \ --role.policy.Statement.1.Action.10="obs:bucket:GetBucketStoragePolicy" \ --role.policy.Statement.1.Action.11="obs:bucket:GetEncryptionConfiguration" \ --role.policy.Statement.1.Action.12="obs:bucket:HeadBucket" \ --role.policy.Statement.1.Action.13="obs:bucket:ListAllMyBuckets" \ --role.policy.Statement.1.Action.14="obs:bucket:ListBucket" \ --role.policy.Statement.1.Action.15="obs:bucket:ListBucketMultipartUploads" \ --role.policy.Statement.1.Action.16="obs:bucket:PutBucketAcl" \ --role.policy.Statement.1.Action.17="obs:bucket:PutBucketPolicy" \ --role.policy.Statement.1.Action.18="obs:bucket:PutBucketQuota" \ --role.policy.Statement.1.Action.19="obs:bucket:PutEncryptionConfiguration" \ --role.policy.Statement.1.Action.20="obs:bucket:PutLifecycleConfiguration" \ --role.policy.Statement.1.Action.21="obs:object:AbortMultipartUpload" \ --role.policy ...[truncated 3362 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace the broad action set with a purpose-built result-upload policy. 2. Scope the policy to the exact user-approved OBS bucket and, where supported, the exact output prefix. 3. Retain only operations necessary to upload results, such as narrowly scoped object writes and multipart-upload completion. 4. Remove the following categories unless the platform demonstrably requires them: - Bucket creation and deletion. - Bucket policy and ACL modification. - Quota, lifecycle, and encryption administration. - Unrelated object reads. - Object and version deletion. - Account-wide bucket enumeration. 5. If an API requires temporary read access, document each required action and constrain it to the selected resource. 6. Use a bounded agency duration rather than `FOREVER`. 7. Require explicit user confirmation that identifies the trusted principal, duration, bucket, prefix, and exact permissions before creation. 8. Document and automate post-task revocation or agency detachment. 9. Have the policy reviewed against Huawei Cloud's current resource-level IAM syntax before deployment. ]]>
