Summary
RustFS evaluates certain negated string and ARN policy operators incorrectly when combined with ForAllValues: or ForAnyValue: qualifiers. Before version 1.0.0-beta.12, partially overlapping policy and request values, including JWT groups or roles, could cause access to be granted to excluded principals or cause deny guardrails to fail.
Affected context
The issue occurs in RustFS policy evaluation when policies use ForAllValues: or ForAnyValue: with negated operators such as StringNotEquals, StringNotLike, ArnNotEquals, or ArnNotLike. It is particularly relevant to authorization rules based on request attributes such as jwt:groups and jwt:roles, including cases where request keys are absent or policy and request value sets partially overlap.
Exploit preconditions
- Attack surface: RustFS object-storage authorization and policy evaluation
- Required access: A request identity capable of reaching a protected RustFS endpoint; the required authentication level depends on the deployment policy
- Trigger point: Evaluation of a policy condition using a qualified negated string or ARN operator
- Why exploitation is possible: RustFS negates the aggregate result after quantification instead of applying the negation to each request-value predicate before applying ForAllValues: or ForAnyValue: semantics
Why this happens
The vulnerability is caused by incorrect ordering of logical negation and set quantification in policy evaluation. The implementation evaluates the positive aggregate result and then negates it, which can produce semantics different from evaluating the negated predicate for each request value before applying the qualifier. This maps to CWE-863: Incorrect Authorization, because the resulting decision may grant access contrary to the policy's intended principal or deny constraint.
Potential impact
- An excluded principal may receive access to protected objects or operations
- A deny guardrail may fail to block an unauthorized request
- Group- or role-based access boundaries may be bypassed
- Policies may behave inconsistently when authorization keys are absent
- Data confidentiality or integrity could be affected
General mitigation guidance
Mitigation generally focuses on ensuring that policy-condition evaluation follows the intended set-operator semantics and that authorization decisions fail safely.
Common defensive patterns include:
- Use an implementation with corrected quantifier and negation handling
- Prefer explicit, narrowly scoped allow rules and deny rules with clearly defined key-presence behavior
- Reduce reliance on ambiguous or complex combinations of negated operators and set qualifiers where simpler conditions are available
- Treat identity attributes such as JWT groups and roles as untrusted inputs until validated by the authorization boundary
- Apply least privilege to identities, buckets, objects, and administrative operations
- Test policies using overlapping values, absent keys, mixed-case values, and both allow and deny outcomes
How teams detect issues like this
Organizations can look for this issue through:
- Static and semantic analysis of policy evaluators for negation applied before or after quantification
- Code review signals involving ForAllValues:, ForAnyValue:, and negated string or ARN operators
- Policy tests covering partially overlapping sets, empty or absent request attributes, and JWT-derived groups or roles
- Differential testing against a reference implementation of the intended authorization semantics
- Authorization decision logging and alerting for access by principals that should be excluded
- Policy-as-code checks that require explicit handling of missing keys and reject ambiguous condition combinations

