S3 object keys can escape above the bucket root during path normalization Reject keys…
- User
S3 object keys can escape above the bucket root during path normalization
Reject keys whose normalized path escapes above the bucket root with HTTP 400 and the S3 error code
InvalidKey, without creating, deleting, or modifying object storage.Interface
No new interfaces are introduced.
- Assistant
I’ll trace S3 key parsing and storage mutation paths, then add a narrow pre-mutation validation and focused compatibility tests for the
InvalidKeyresponse. - Assistant
The unsafe check already exists at the filesystem write boundary, but it runs after metadata has been updated and is bypassed entirely in memory mode. I’m moving the invariant ahead of every storage-key construction and pre-validating batch deletes so failures are atomic.
- Assistant
The fix and regression coverage are in place. Focused tests are running now, including a raw percent-encoded traversal request to verify the REST XML response and preservation of an existing object.
- Assistant
The service-level regressions pass. The first HTTP test exposed client-side URI normalization—the Java client rewrote the traversal before sending it—so I’m switching that test to a raw HTTP socket to ensure the emulator receives the encoded key unchanged.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.