Project

General

Profile

Actions

Bug #80924

open
KB KB

rgw: If-Match and If-None-Match match any value that starts with the object's ETag

Bug #80924: rgw: If-Match and If-None-Match match any value that starts with the object's ETag

Added by Kyle Bader 2 months ago. Updated 2 months ago.

Status:
Fix Under Review
Priority:
Normal
Assignee:
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
tentacle, umbrella
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

Found reviewing RGW's parsers against AWS's Smithy model of S3. Reproduced on main at 7ed73efc1be on a single-host vstart cluster. By code review, tentacle has the same code.

The conditional headers compare the ETag as a prefix of the header's value:
  • If-Match: if_match_str.compare(0, etag.length(), etag, ...) in check_preconditions (rgw_rados.cc:7868), and in the read path (rgw_rados.cc:8459);
  • If-None-Match: the same, at rgw_rados.cc:7890 and 8474.
So:
  • any value that starts with the ETag matches it;
  • a list of ETags matches only when the first is the object's;
  • a weak ETag (W/"...") never matches.

RFC 7232 compares whole entity tags, and allows a list.

Reproducer: test_put_object_if_match_etag_with_suffix in s3-tests. A PutObject whose If-Match is the object's ETag with one more character is accepted, not answered 412.

A fix could parse the header as a list of entity tags (or *) and compare each whole, unquoted value, in all four places.


Related issues 1 (1 open — 0 closed)

Related to rgw - Bug #64439: If-Match Header Not Unquoted On Conditional PutObjectNew

Actions

KB Updated by Kyle Bader 2 months ago Actions #1

  • Related to Bug #64439: If-Match Header Not Unquoted On Conditional PutObject added

MH Updated by Matthew Heler 2 months ago Actions #2

  • Status changed from New to Fix Under Review
  • Assignee set to Kyle Bader
  • Backport changed from tentacle to tentacle, umbrella
  • Pull request ID set to 72117
Actions

Also available in: PDF Atom