PutObjectRetention: policy conditions read the request header, the handler applies the request body
Summary
Summary
For a standalone PutObjectRetention request, the policy engine evaluates s3:object-lock-retain-until-date and s3:object-lock-mode from the x-amz-object-lock-* request headers. The handler then applies the mode and date from the XML request body. Nothing compares the two. A princ...
Affected packages
| Ecosystem | Package | Affected | Fixed |
|---|---|---|---|
| rust | rustfs |
<= 1.0.1 |
1.0.2 |
Original description The description as published by the source.
Summary
For a standalone PutObjectRetention request, the policy engine evaluates s3:object-lock-retain-until-date and s3:object-lock-mode from the x-amz-object-lock-* request headers. The handler then applies the mode and date from the XML request body. Nothing compares the two. A principal whose policy allows s3:PutObjectRetention only under a date condition can send a header that satisfies the condition and a body that does not, and the handler applies the body. In COMPLIANCE mode nobody can shorten or remove the resulting lock before the chosen date, the operator included.
Details
Line numbers below are from tag 1.0.0, where we measured it. Tag 1.0.1 and main at db2abcf0, checked on 2026-10-07, have the same logic at shifted lines.
rustfs/src/auth.rsfills the object-lock condition keysobject-lock-retain-until-date,object-lock-modeandobject-lock-legal-holdonly from thex-amz-object-lock-*request headers, lines 729-743.authorization_conditionsinrustfs/src/storage/access.rs, line 827, builds the condition map fromreq.headersandreq.uri.query()only. Its merge helpers add list-bucket query values andx-amz-tagging. Nothing adds values from a request body.put_object_retentionin the same file, line 3209, authorizesPutObjectRetentionActionwith those conditions. It never consultsreq.input.retentionfor the policy decision, and then it appliesreq.input.retention.
AWS documents `s3:object-lock-retain-…
Source: GitHub Repository Security Advisories (Game のスタック) GitHub Advisory OSV
References
- GITHUB_REPO_ADVISORY rustfs/rustfs