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 extraction and normalization, identify every mutating path that shares it, then add a focused regression test proving traversal is rejected before storage changes.
- Assistant
The disk resolver already detects escapes, but too late: metadata is written first, and memory mode bypasses path resolution entirely. I’m moving the invariant to the storage-key boundary so both persistent and in-memory modes reject before any object metadata or bytes can change.
- Assistant
The regression coverage now checks the important atomicity property: failed puts leave metadata empty, failed deletes preserve an existing entry, memory mode behaves identically, and multipart initiation creates no upload state. I’m running the focused service tests first.
- Assistant
The first test run reached Maven’s test launcher but attempted to fetch a missing Surefire component, so I stopped it to honor the no-internet constraint. I’ll rerun offline; if that artifact is absent locally, I’ll still use compilation and any locally available test path to verify the change.
- Assistant
One additional mutation path needed special handling: batch delete could process valid keys before reaching an escaping key. I’m adding an upfront validation pass so a rejected batch is atomic and returns the same
InvalidKey400 through the existing S3 XML error mapping. - Assistant
Offline compilation of all production and test sources succeeds. The focused JUnit execution remains unavailable because the required Surefire JUnit provider is not cached locally; I’m doing the final diff and mutation-path review now.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.