Summary
RustFS contains an improper privilege management vulnerability in the service-account creation flow. An attacker who can reach the relevant administrative operation and satisfy its existing authorization check may influence the target user and cause a newly created service account to receive owner-level privileges.
Affected context
The issue occurs in RustFS administrative service-account handling when the caller can invoke AddServiceAccount and control the target_user value. The authorization logic checks whether the caller has permission to create service accounts, but the resulting account's ownership and privilege context may not remain constrained to the intended target identity.
Exploit preconditions
- Attack surface: RustFS administrative service-account API
- Required access: Permission to reach the service-account creation operation and satisfy CreateServiceAccountAdminAction
- Trigger point: Processing of attacker-controlled target_user during AddServiceAccount
- Why exploitation is possible: The selected target identity is not sufficiently constrained before service-account authentication data is prepared, allowing the resulting root-parent account to be marked as an owner
Why this happens
The underlying flaw is an authorization-context mismatch. RustFS verifies a broad service-account creation permission but accepts a caller-controlled target_user without adequately binding that value to an authorized identity or privilege boundary. During authentication setup, the resulting root-parent service account is then assigned owner status, which maps to CWE-269: Improper Privilege Management because a security-sensitive privilege is granted without sufficiently enforcing the intended authorization relationship.
Potential impact
- An attacker may obtain a service account with owner-level privileges
- Unauthorized users could modify storage, identity, or administrative configuration
- Data may be accessed, altered, deleted, or exposed
- Compromised credentials could support persistence or lateral movement within connected systems
General mitigation guidance
Mitigation generally focuses on binding service-account creation to an explicitly authorized target identity and preventing privilege inheritance from attacker-controlled parameters.
Common defensive patterns include:
- Enforcing object-level authorization for the selected target_user
- Deriving ownership and privilege attributes from trusted server-side identity context
- Applying deny-by-default rules when assigning owner or root-level privileges
- Separating service-account creation permissions from owner-account provisioning
- Validating requested privilege scope against the caller's effective permissions
- Running administrative services with the minimum practical privileges
- Auditing and rotating service-account credentials when authorization boundaries may have been bypassed
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis of authorization checks that validate an action but not the target object or identity
- Code review signals involving caller-controlled user identifiers, ownership flags, or privilege assignment
- Tests that attempt to create accounts for unrelated users and verify that privilege scope remains bounded
- Policy enforcement requiring object-level authorization before administrative mutations
- Audit-log monitoring for unexpected owner-level service accounts or service-account creation by non-owner principals
Automated code review and authorization-focused testing tools may help identify mismatches between permission checks and affected resources.

