Summary
A logic flaw in RustFS IAM's deny_only short-circuit allows restricted service accounts or STS credentials to mint new, unrestricted service accounts that inherit the parent's full privileges.
When IAM policy evaluation is bypassed in this way, attackers can escalate from a constrained identity to an effectively administrator-level identity, defeating session and inline policy restrictions.
Affected context
This vulnerability affects RustFS deployments running versions 1.0.0-alpha.13 through 1.0.0-alpha.78 that:
- Rely on RustFS IAM for access control to buckets, objects, or administrative APIs
- Use service accounts and/or STS-issued temporary credentials with scoped or restricted permissions
- Permit identities to call APIs that can create or manage other service accounts
In such environments, the flawed deny_only short-circuit in the IAM evaluator can cause policy restrictions applied to a calling identity to be ignored when issuing new service accounts, leading to over-privileged identities.
Exploit preconditions
- Attack surface: RustFS IAM / identity management APIs (e.g., service account creation, credential issuance).
- Required access:
- Valid but restricted RustFS service account or STS-based temporary credentials.
- Permission (intended or unintended) to invoke identity or service-account–management operations.
- Trigger point:
- Calling service-account creation or issuance APIs in a way that causes IAM to evaluate
deny_onlylogic and then propagate the resulting identity without reapplying full policy checks. - Why exploitation is possible:
- The IAM implementation uses a flawed short-circuit for
deny_onlyevaluation, effectively treating a "no explicit deny" outcome as implicitly allowed while constructing the new identity. - As a result, the newly created service account is not constrained by the caller's session/inline policies and can inherit or obtain broader privileges than the original restricted identity.
Why this happens
The core issue is an authorization logic error in RustFS IAM's policy evaluation pipeline, mapping to CWE-269: Improper Privilege Management and CWE-284: Improper Access Control.
The deny_only short-circuit appears to:
- Treat the absence of an explicit deny as sufficient to proceed, instead of requiring a positive allow verdict combined with inheritance of the caller's scoping constraints.
- Allow a restricted identity (e.g., session-limited or inline-policy–constrained) to create a new service account without consistently re-applying all relevant policies and restrictions.
Conceptually, the system fails to preserve the least privilege property when transitioning from one identity to another. Instead of propagating constraints, it constructs a new principal that is evaluated as if it were unconstrained, breaking the expected privilege boundary between "restricted session credentials" and "base account" capabilities.
Potential impact
- A constrained service account or STS session may escalate to an effectively unrestricted RustFS service account.
- Attackers can gain broad read/write access to buckets and stored objects, including sensitive or regulated data.
- Administrative operations (e.g., policy changes, account management, key rotation) may be performed by an attacker-controlled identity.
- Existing IAM policy constructs (session policies, inline restrictions) can be bypassed, undermining defense-in-depth.
- Compromised identities can be used to persist access, create additional backdoored accounts, or tamper with logging and audit data.
General mitigation guidance
Mitigation patterns should focus on robust privilege propagation, explicit allow semantics, and strong boundaries around identity management:
- Enforce full policy evaluation on identity transitions:
- Ensure that when a principal creates or issues another principal (service account, STS credential), the new identity's effective permissions are always the intersection of:
- The base account's permissions, and
- All session, inline, and resource policies constraining the caller.
- Avoid relying on "deny-only" shortcuts that implicitly grant broad access in the absence of explicit denies.
- Apply least privilege to identity-management APIs:
- Restrict which roles or accounts can create, rotate, or manage service accounts and STS credentials.
- Separate "data plane" roles (object access) from "control plane" roles (identity and policy management).
- Treat STS and scoped credentials as first-class constrained identities:
- Implement IAM logic so that temporary or scoped credentials can never create principals with broader permissions than their own effective policies.
- Explicitly model "privilege ceilings" that cannot be exceeded by any delegated or derived identity.
- Harden default IAM configurations:
- Use deny-by-default posture for sensitive APIs such as account creation, policy modification, and credential issuance.
- Encourage role-based patterns where identities do not need direct access to powerful IAM operations for everyday workflows.
- Privilege partitioning at the system level:
- Separate administrative RustFS instances, projects, or namespaces where identity management occurs from general data storage contexts.
- Use out-of-band approval or policy-as-code review for any changes to IAM roles and templates that can mint new identities.
How teams detect issues like this
Detection and assurance can be improved by combining policy-as-code, log analysis, and static review of IAM logic:
- Code-level and configuration review:
- Examine IAM evaluators for:
- Short-circuit logic that treats "no explicit deny" as sufficient for allow.
- Branches where identity creation is performed without re-evaluating effective permissions.
- Inconsistent propagation of session or inline policy scopes when generating new principals.
- Use static analysis or custom linters to flag:
deny_onlyor similar constructs used without a corresponding mandatory allow check.- Identity-creation code paths that do not call the central authorization routine.
- Policy-as-code validation:
- Define automated tests for IAM policies to verify that:
- Restricted identities cannot create principals with broader permissions.
- STS sessions and scoped roles are unable to bypass their own constraints.
- Integrate these checks into CI/CD to prevent regressions in IAM implementations.
- Runtime monitoring and anomaly detection:
- Log all service-account creation, STS issuance, and policy modification operations with caller and target identity details.
- Alert on patterns such as:
- Restricted or low-privilege roles creating highly privileged service accounts.
- Sudden spikes in identity-creation operations from previously quiet identities.
- Periodic access reviews:
- Regularly enumerate service accounts and correlate their effective permissions with their creators.
- Look for newly created accounts that have broader privileges than the accounts that created them.

