Summary
RustFS can incorrectly omit existing-object-tag conditions when external OPA authorization is enabled, allowing authenticated users to bypass S3 tag-based policy restrictions. The issue becomes risky when authorization decisions depend on existing object tags and the affected OPA integration is used.
Affected context
The vulnerability occurs in RustFS deployments using external OPA authorization through the RUSTFS_POLICY_PLUGIN_URL setting. It affects the policy-processing path for OPA-backed authorization when S3 policies contain s3:ExistingObjectTag/* conditions, particularly in releases where the OPA authorization mode does not correctly preserve those conditions.
Exploit preconditions
- Attack surface: RustFS S3 authorization and external OPA policy integration
- Required access: An authenticated RustFS user or client capable of making object-storage requests
- Trigger point: An authorization decision involving policies that restrict access based on existing object tags
- Why exploitation is possible: OPA authorization state is initialized with an incorrect flag, causing existing-object-tag conditions to be omitted before policy evaluation is completed
Why this happens
The underlying bug is an authorization-state initialization error in the OPA mode of RustFS. The system sets the needs_existing_object_tag property incorrectly, so later policy-merging logic may discard s3:ExistingObjectTag/* conditions instead of carrying them into the authorization decision. This maps to CWE-863: Incorrect Authorization, because access-control requirements are not consistently enforced for an authenticated principal.
Potential impact
- Authenticated users may bypass tag-based access restrictions
- Users could access or modify objects that should be denied by existing-tag conditions
- Data confidentiality or integrity may be reduced
- Tenant or workload isolation could be weakened where tags enforce authorization boundaries
General mitigation guidance
Mitigation generally focuses on preserving authorization conditions throughout policy evaluation and reducing reliance on implicit authorization state.
Common defensive patterns include:
- Ensure all authorization modes retain and evaluate object-tag conditions consistently
- Use explicit, schema-validated representations for tag-based policy requirements
- Apply deny-by-default behavior when required authorization context is missing or ambiguous
- Minimize permissions granted to authenticated users and separate tenant or workload policies
- Add regression tests covering existing-object-tag conditions across every authorization backend
- Monitor policy changes and restrict who can configure external authorization integrations
How teams detect issues like this
Organizations can identify similar issues through:
- Static analysis and code review of authorization flags, policy-merging functions, and conditional request-context handling
- Regression tests that compare allow and deny outcomes for matching and non-matching existing object tags
- Integration tests covering every authorization backend and policy condition type
- Policy enforcement requiring deny-by-default behavior when authorization attributes are omitted
- Audit-log analysis for requests succeeding without the object tags required by policy
- Automated security review tools that trace authorization conditions from parsing through final decision points

