/

CVE-2026-22042

Severity:

HIGH RISK

(8.8)

Authorization and Access Control in RustFS ImportIam Admin

CVE-2026-22042

Analyzed

Vulnerability type

Category:

Authorization and Access Control

CWE:

CWE-285, CWE-863

Impact:

Privilege Escalation and Unauthorized IAM Modification

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A logic error in RustFS's ImportIam admin API causes it to validate permissions using ExportIAMAction instead of ImportIAMAction, effectively treating export-only principals as authorized importers.

Under deployments where users or services are granted export-only IAM privileges, an attacker with those permissions could abuse the ImportIam endpoint to create or modify IAM entities and escalate privileges.

Affected context

This vulnerability affects RustFS deployments that expose the ImportIam administrative API in environments where:

  • IAM permissions distinguish between export and import operations, and
  • Certain principals are intentionally limited to export-only IAM capabilities.

Because ImportIam incorrectly reuses the ExportIAMAction permission for its authorization check, principals that should only read/export IAM data may also perform IAM imports (writes) if they can reach the admin API.

Exploit preconditions

  • Attack surface: RustFS admin/API interface exposing the ImportIam endpoint.
  • Required access: Valid credentials or an identity with permissions equivalent to ExportIAMAction but not intended to have import/write IAM rights.
  • Trigger point: Invocation of the ImportIam API to import IAM configuration or data.
  • Why exploitation is possible: The implementation validates access using the wrong action (ExportIAMAction) rather than ImportIAMAction, so the authorization layer incorrectly grants write-like IAM operations to export-only principals.

Why this happens

The core issue is an incorrect authorization decision caused by using the wrong permission/verb for access control. Instead of checking whether a caller is allowed to execute ImportIAMAction (a privileged write operation that can alter users, groups, policies, and service accounts), the ImportIam endpoint checks for ExportIAMAction, which is intended for read/export operations.

This maps to:

  • CWE-285: Improper Authorization, where the system grants access that is inconsistent with intended policy.
  • CWE-863: Incorrect Authorization, where the logic validates permissions but against the wrong capability or resource.

Abstractly, this is a privilege model mismatch: the code conflates two distinct operations (import vs. export) and reuses an authorization predicate that is too permissive for the more powerful operation.

Potential impact

  • Unauthorized creation, update, or deletion of IAM users, groups, roles, and policies.
  • Escalation of privileges by granting broader roles or permissions to attacker-controlled identities.
  • Creation of backdoor service accounts or access keys for persistent unauthorized access.
  • Disruption of access control by modifying or removing existing IAM policies.
  • Indirect compromise of data and services that rely on RustFS IAM for authorization decisions.

General mitigation guidance

Effective mitigation centers on correctly separating and enforcing IAM actions and reducing the blast radius of administrative APIs:

  • Define distinct, least-privilege actions for read/export and write/import IAM operations, and ensure each API endpoint checks only the specific action it requires.
  • Use centralized authorization helpers or policy engines to avoid duplicated, ad hoc permission checks and to keep mappings between APIs and actions explicit.
  • Restrict network and authentication access to administrative endpoints such as ImportIam, limiting them to tightly controlled operators or automation roles.
  • Apply defense-in-depth by requiring elevated scopes, multi-party approval, or additional verification for IAM-changing operations.
  • Maintain clear role definitions so that "export-only" or read-only personas cannot perform any write, import, or configuration-changing tasks, even if a single endpoint is misconfigured.

How teams detect issues like this

Organizations can look for this class of issue using:

  • Static analysis and code review:
  • Verify that each admin or IAM-modifying endpoint references the correct permission constant or policy action.
  • Flag code where multiple endpoints share a single broad permission for conceptually different operations (e.g., export vs. import).
  • Review mappings between REST/RPC methods and authorization rules for inconsistencies or copy-paste mistakes.
  • Policy and configuration review:
  • Periodically audit IAM roles to confirm that export-only roles do not have effective write/import capabilities via any API.
  • Examine logs for export-focused principals calling IAM import or other configuration-changing operations.
  • Automated checks:
  • Integrate automated authorization tests in CI/CD that assert "read-only" roles cannot exercise state-changing APIs.
  • Use automated security scanners or policy-as-code tools to ensure that admin endpoints always require appropriately scoped actions.

Sources

SourceLink
github.comgithub.com/rustfs/rustfs/security/advisories/GHSA-vcwh-pff9-64cc

Frequently asked

questions

Exploitation is possible wherever an attacker can obtain or compromise an identity that is intended to be limited to export-only IAM operations but can still reach the ImportIam admin API. It does not automatically grant access to unauthenticated users, but it breaks the separation between export and import permissions.

An attacker must have valid credentials or control over an account that has ExportIAMAction (or equivalent) permissions and network/API access to the RustFS admin interface. No additional special system privileges are required beyond that mis-scoped IAM role.

The safest pattern is to ensure each IAM-related endpoint performs action-specific authorization checks using a centralized authorization layer. ImportIam should strictly require a dedicated import/write IAM action, and tests should verify that export-only roles are denied.

Prevention relies on clearly modeling permissions, using strongly typed or enumerated actions, and binding each endpoint to its intended action through shared helpers or policy engines. Complement this with automated authorization tests, regular role audits, and code review practices that explicitly verify permission constants for every privileged API.

Find out what's already
exploitable in your codebase.