Skip to content

test(test-server): cross-language coverage for material-description decoding - #200

Draft
lucasmcdonald3 wants to merge 10 commits into
mainfrom
test/material-description-decoding-coverage
Draft

test(test-server): cross-language coverage for material-description decoding#200
lucasmcdonald3 wants to merge 10 commits into
mainfrom
test/material-description-decoding-coverage

Conversation

@lucasmcdonald3

@lucasmcdonald3 lucasmcdonald3 commented Jul 27, 2026

Copy link
Copy Markdown
  • Add material description tampering tests
  • Update PHP servers, the newer Guzzle version resolved by the SDK rejects the CURLOPT_* request options they passed (failing every request)
  • Bump all submodules to the tips of their tracked branches

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a new cross-language integration test to the test-server/java-tests harness to ensure all language runtimes cleanly reject (modeled S3EncryptionClientError) objects whose x-amz-matdesc metadata has been tampered to RFC 2047 encoded-words that decode to byte sequences ending with a high-bit byte, rather than crashing or returning generic server failures.

Changes:

  • Introduces MaterialDescriptionTamperTests with an encrypt phase that writes one V2 GCM (KMS) object per runtime.
  • Adds an @AfterAll tamper step that rewrites only x-amz-matdesc on copied objects using malicious RFC 2047 encoded-word payloads.
  • Adds a decrypt phase that asserts every runtime fails via Decrypt_fails for each tampered copy (i.e., modeled error vs. unexpected failure).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lucasmcdonald3
lucasmcdonald3 force-pushed the test/material-description-decoding-coverage branch from 2890b7c to 1cc5271 Compare July 27, 2026 16:56
…ription

Encrypt one V2-format and one V3-format object, corrupt the metadata that holds the material description, then confirm every language server rejects each object with a modeled error instead of crashing. Covers both formats by encrypting two objects rather than one per language.
@lucasmcdonald3
lucasmcdonald3 force-pushed the test/material-description-decoding-coverage branch from 1cc5271 to a802559 Compare July 27, 2026 17:04
@lucasmcdonald3
lucasmcdonald3 marked this pull request as draft July 27, 2026 17:05
Lucas McDonald added 2 commits July 27, 2026 17:21
…client

decryptClientId built the decrypt client with FORBID_ENCRYPT_ALLOW_DECRYPT
and no encryption algorithm. Servers that default to a committing suite
(Python/Java/.NET V4) reject that combination at client creation, so
v2/v3TamperedMaterialDescriptionIsRejected failed before decryption was
attempted. Pin ALG_AES_256_GCM_IV12_TAG16_NO_KDF so the policy is
self-consistent; ALLOW_DECRYPT still reads both the V2 and the committed
V3 tampered objects.
@lucasmcdonald3
lucasmcdonald3 force-pushed the test/material-description-decoding-coverage branch from 506e49b to fa038dc Compare July 27, 2026 17:57
…erify

Go: aws/amazon-s3-encryption-client-go#85 (aea828bfeffe4bde5afbbfebf8e08ef644a649ad). PHP: fork PR#1 (411d948378d7412f94d8c4fb23f64442b9a90f0f). Ruby: fork PR#1 (1139087e071c971308d107352cc41219710886c9).
@lucasmcdonald3
lucasmcdonald3 force-pushed the test/material-description-decoding-coverage branch from fa038dc to 4044f5f Compare July 27, 2026 18:00
Lucas McDonald added 6 commits July 27, 2026 22:33
…escription in php servers

Map "Unable to decode the material description" to S3EncryptionClientError
in both php get_object handlers. The php sdk rejects a malformed material
description with that message; without a mapping entry the rejection fell
through to GenericServerError (HTTP 500) and MaterialDescriptionTamperTests
failed for both php servers.

Bump the php sdk submodule to the fix-branch tip merged with the latest
aws/aws-sdk-php master (3.389.1).
The blanket submodule bump moved the specification submodule, changing requirement text so existing duvet annotation quotes no longer matched (make duvet errored). Restore the pin to the value the base branch uses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants