CVE-2026-22042: RustFS has IAM Incorrect Authorization in ImportIam that Allows Privilege Escalation
Summary 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.
Published Jan 8, 2026
Affected packages
rustfs
- Ecosystem
- Rust (crates.io)
- Affected
- < 1.0.0-alpha.79
- Fixed in
- 1.0.0-alpha.79
- Check
cargo tree -i rustfs
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
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.
---
Details
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.
---
PoC
Prerequisites
- A RustFS deployment with IAM enabled.
- An IAM user or role that has Export IAM permission but does not have Import IAM or full admin permissions.
- Access credentials for that user.
Steps
- Create or obtain an IAM principal with permission equivalent to:
AdminAction::ExportIAMActionand without Import IAM privileges.
- Prepare a valid IAM import ZIP archive containing, for example:
- A new policy granting administrative permissions
- A user or service account bound to that policy
- Send a request to the Import IAM endpoint (the same endpoint handled by
ImportIam::call), authenticating with the export-only credentials.
- Observe that:
- The request passes authorization.
- IAM entities from the archive are created or modified successfully.
Expected Result
- The request should be rejected with an authorization error (e.g., AccessDenied).
Actual Result
- The request succeeds, and IAM state is modified.
Credited to Threonine.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Rust (crates.io) vulnerabilities
All Rust (crates.io) entriesGHSA-mm2q-qcmx-gw4w
RustFS: ListServiceAccount authorizes against wrong admin action, enabling cross-user enumeration and root service account takeover
high7.4May 5, 2026CVE-2026-40937
RustFS: Missing admin authorization on notification target endpoints allows unauthenticated configuration of event webhooks
high8.3No fixApr 22, 2026CVE-2026-39360
RustFS has an authorization bypass in multipart UploadPartCopy enables cross-bucket object exfiltration
medium4.3No fixApr 8, 2026CVE-2026-27607
RustFS: Missing Post Policy Validation leads to Arbitrary Object Write
high8.1Feb 25, 2026CVE-2026-27822
Rust has Critical Stored XSS in Preview Modal, leading to Administrative Account Takeover
critical9.0Feb 25, 2026CVE-2026-21862
RustFS has SourceIp bypass via spoofed X-Forwarded-For/Real-IP headers
high7.7Feb 3, 2026
