Skip to content

fix(miniflare): validate R2 S3 x-amz-checksum-* against body - #16948

Closed
umeraamir69 wants to merge 1 commit into
cloudflare:mainfrom
umeraamir69:fix/r2-s3-checksum-16945
Closed

umeraamir69 wants to merge 1 commit into
cloudflare:mainfrom
umeraamir69:fix/r2-s3-checksum-16945

Conversation

@umeraamir69

@umeraamir69 umeraamir69 commented Nov 16, 2026 •

Copy link
Copy Markdown

Fixes #16945.

The local R2 S3 endpoint ignored signed x-amz-checksum-* headers while verifying Content-MD5. PutObject/UploadPart now validate CRC32, CRC32C, SHA-1, and SHA-256 digests against the body and return 400 BadDigest on mismatch. SHA-1 / SHA-256 on UploadPart return 501 NotImplemented, matching real R2. CRC64NVME and checksum store/echo remain documented gaps.

Test plan

  • vitest run test/plugins/r2/s3.spec.ts (87 passed)
  • New coverage: matching/mismatching x-amz-checksum-sha256, SHA1/CRC32/CRC32C PutObject, SHA256 UploadPart → NotImplemented

  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: bug fix for local S3 checksum validation; no public API or docs change

Devin Review

Return BadDigest on mismatch for CRC32/CRC32C/SHA-1/SHA-256 (and
NotImplemented for SHA checksums on UploadPart), matching real R2.
@changeset-bot

changeset-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c3aa613

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
miniflare Patch
@cloudflare/deploy-helpers Patch
@cloudflare/pages-shared Patch
@cloudflare/remote-bindings Patch
@cloudflare/runtime-types Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-plugin Patch
wrangler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

Hi @umeraamir69. Thanks for taking the time to contribute to Workers SDK.

This PR has been automatically closed because you are not currently a registered (vouched) collaborator for this repository.

AI tools now let our team generate proposed code changes quickly. Reviewing changes, checking that they solve the right problem, and maintaining code quality over time still take substantial care and effort. We therefore limit PRs to registered collaborators so we can focus that effort where it is most useful.

For the majority of external contributors, the most effective way to help is through issues: describing a problem or use case, providing a minimal reproduction, investigating its cause, or helping us verify a fix. Those contributions help us understand what needs to change and are very welcome.

We will take an initial look at this PR and decide whether it is something we want to invest time in reviewing and maintaining. We may reopen it if we decide to proceed, but we cannot guarantee that it will be reopened or receive a full review.

@github-actions github-actions Bot closed this Nov 16, 2026
@github-project-automation github-project-automation Bot moved this from Untriaged to Done in workers-sdk Nov 16, 2026
@workers-devprod
workers-devprod requested review from a team and jamesopstad and removed request for a team November 16, 2026 06:46
@workers-devprod

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • .changeset/r2-s3-flexible-checksum-validate.md: [@cloudflare/wrangler]
  • packages/miniflare/src/workers/r2/s3/index.worker.ts: [@cloudflare/wrangler]
  • packages/miniflare/src/workers/r2/s3/operations.worker.ts: [@cloudflare/wrangler]
  • packages/miniflare/test/plugins/r2/s3.spec.ts: [@cloudflare/wrangler]

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[miniflare] Local R2 S3 endpoint does not validate signed x-amz-checksum-* headers (real R2 returns BadDigest)

2 participants