The ImportIam admin API validates permissions using ExportIAMAction instead of ImportIAMAction, allowing a principal with export-only IAM permissions to perform import operations. Since importing IAM data performs privileged write actions (creating/updating users, groups, policies, and service accounts), this can lead to unauthorized IAM modification and privilege escalation.
In ImportIam, the authorization check is implemented as follows:
validate_admin_request(
&req.headers,
&cred,
owner,
false,
vec![Action::AdminAction(AdminAction::ExportIAMAction)],
).await?;
However, this code resides in the Import IAM operation (struct ImportIam {}), which performs state-changing IAM writes.
The expected behavior is to validate against AdminAction::ImportIAMAction (or an equivalent import-specific admin action), not ExportIAMAction.
Prerequisites
Steps
Create or obtain an IAM principal with permission equivalent to:
AdminAction::ExportIAMAction
and without Import IAM privileges.
Prepare a valid IAM import ZIP archive containing, for example:
Send a request to the Import IAM endpoint (the same endpoint handled by ImportIam::call), authenticating with the export-only credentials.
Observe that:
Expected Result
Actual Result
{
"github_reviewed_at": "2026-01-08T20:36:17Z",
"github_reviewed": true,
"cwe_ids": [
"CWE-285"
],
"nvd_published_at": "2026-01-08T15:15:45Z",
"severity": "MODERATE"
}