T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- references/iam-policies.md:5
- Finding
- Unnecessary Account-Wide MRS IAM Permissions<![CDATA[ ## Vulnerability Details **File Location**: `references/iam-policies.md`, lines 5–33 **Vulnerability Type**: Excessive cloud permissions and violation of least privilege **Risk Level**: Medium ### Vulnerable Code ```markdown | API Action | Permission | Purpose | |--------------------|------------------------|---------------------------------------| | mrs:clusters:get | View cluster details | Get cluster basic information | | mrs:clusters:list | List clusters | Confirm cluster exists | | mrs:host:list | List hosts | Get host list | ## Minimum Permission Policy JSON ```json { "Version": "1.1", "Statement": [ { "Effect": "Allow", "Action": [ "mrs:clusters:get", "mrs:clusters:list", "mrs:host:list" ], "Resource": ["*"] } ] } ``` ## Permission Failure Handling 1. When any command fails due to permission errors, read this document 2. Display the required permission list and policy JSON to the user 3. Guide the user to create a custom policy in the IAM console and grant authorization 4. Pause execution and wait for user confirmation that permissions have been granted ``` ### Technical Analysis The documented IAM policy grants the identity permission to enumerate hosts and clusters and retrieve cluster details across the wildcard resource scope. These permissions are not required by the skill's stated static-analysis workflow. `SKILL.md` explicitly says that the skill cannot connect to MRS cluster hosts, cannot execute collection commands, processes user-supplied files locally, and requires no authentication for the checking process. The IAM policy therefore contradicts the declared operating model and expands the identity's access beyond the task's legitimate requirements. The policy is read-only and does not directly permit cluster modification. Nevertheless, ...[truncated 1527 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the IAM policy and permission-granting workflow from this static file-analysis skill because its documented core functionality does not require cloud API access. 2. Clearly state that users should provide the Redis metadata file directly and that no cloud authorization is necessary for analysis. 3. If cloud-based cluster or host discovery is intentionally implemented later, isolate it as an optional workflow that requires explicit user consent. 4. Request only API actions that are demonstrably used by the implemented workflow. 5. Restrict permissions to specific projects, clusters, or other supported resource conditions instead of using `"Resource": ["*"]`. 6. Document whether each Huawei Cloud MRS action supports resource-level restrictions. Where resource scoping is unavailable, use project-level isolation, IAM conditions, a dedicated read-only identity, and short-lived credentials. 7. Do not recommend granting permissions merely because an unspecified command reports an authorization failure. First identify the failed operation and verify that it is necessary for the requested task. 8. Add a permission preflight that displays the exact optional operation, requested scope, and reason before directing the user to change IAM authorization. ]]>
