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
Let me examine how deleteObject and getObject flow, and check the order of store mutations vs. path validation:
- Assistant
Now the edits. First, the service-side validation helper next to
resolveObjectPath: - Assistant
Now wire it into the entry points, before any mutation:
- Assistant
Now the controller fix for the virtual-host fallback:
- Assistant
Compiles. Now let me look at the test setup to add regression tests:
- Assistant
Now add regression tests at the end of
S3ServiceTest: - Assistant
Now add an integration test covering the virtual-host bypass. Let me check for existing virtual-host style integration tests to match conventions:
- Assistant
Now run the unit tests:
- Assistant
All 47 unit tests pass. Now the integration tests (virtual-host + the main S3 integration suite):
- Assistant
Now run the full S3 test package to catch regressions in versioning, multipart, copy, etc.:
- Assistant
The entire S3 package passes. Let me also check other services that call into
S3Service(e.g., CloudFormation, Lambda, Firehose) for regressions: - Assistant
Pre-existing failure confirmed — the ECR CloudFormation test fails on the pristine tree too (unrelated Docker/ECR dependency). Let me review the final diff:
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.