fix(s3,lambda): checksum integrity, bucket-name + config validation (bug-hunt)#2279
Merged
Conversation
…bug-hunt)
S3:
- PutObject now verifies every supplied x-amz-checksum-<algo> header against
the checksum computed over the received body; a mismatch returns BadDigest
(previously the value was computed but never compared -> corrupt upload
stored silently). (1.13)
- is_valid_bucket_name rejects underscores, adjacent '..', IPv4-format names,
and reserved prefixes/suffixes (xn--, sthree-, -s3alias, --ol-s3, .mrap),
matching AWS general-purpose bucket rules. (1.14)
Lambda:
- CreateFunction now validates MemorySize/Timeout/Runtime; both Create and
UpdateFunctionConfiguration use the Smithy Timeout max (5400), not i64::MAX. (1.15)
- Put{Function,Provisioned}Concurrency and PutFunctionScalingConfig return
ResourceNotFoundException when the function doesn't exist instead of storing
a ghost config. (1.16)
- Scaling config is keyed per-qualifier (function:qualifier); previously all
versions/aliases collided onto the bare function name. (1.17)
Tests: s3 bucket-name unit cases; e2e checksum-mismatch, Lambda timeout-bound
and missing-function concurrency.
No new API surface (validation fixes to existing ops) -> no SDK/docs/metadata change.
The 1.16 fix makes PutFunctionScalingConfig return ResourceNotFoundException for a missing function (matching AWS), so the conformance test that relied on the function not existing now creates it via make_basic_function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bug-hunt findings 1.13–1.17.
S3
PutObjectverifies every suppliedx-amz-checksum-<algo>header against the checksum computed over the received body; mismatch →BadDigest. Previously computed but never compared (silent corrupt upload). (1.13)is_valid_bucket_namerejects underscores, adjacent.., IPv4-format names, and reserved prefixes/suffixes per AWS general-purpose rules. (1.14)Lambda
CreateFunctionnow validates MemorySize/Timeout/Runtime; Create+UpdateFunctionConfiguration use the Smithy Timeout max (5400) noti64::MAX. (1.15)Put{Function,Provisioned}Concurrency+PutFunctionScalingConfigreturnResourceNotFoundExceptionfor a missing function instead of a ghost config. (1.16)function:qualifier); versions/aliases no longer collide. (1.17)Test plan
valid_bucket_namesextended (underscore/../IPv4/reserved).s3_put_object_rejects_checksum_mismatch,lambda_create_function_validates_timeout_upper_bound,lambda_put_concurrency_on_missing_function_is_not_found.Surface
No new API surface (validation fixes to existing ops) → no SDK/docs/website/metadata change.
Summary by cubic
Fixes silent S3 upload corruption and tightens bucket-name rules, and aligns Lambda validations and scaling config behavior with AWS to prevent ghost configs and invalid inputs. No API changes.
PutObject: verify all providedx-amz-checksum-<algo>headers against the computed checksum; mismatch returnsBadDigest..., IPv4-like names, and reserved prefixes/suffixes (xn--,sthree-,amzn-s3-demo-,-s3alias,--ol-s3,.mrap).CreateFunction/UpdateFunctionConfiguration: validateMemorySize,Timeout(max 5400),Runtime, and field lengths.PutFunctionConcurrency,PutProvisionedConcurrencyConfig,PutFunctionScalingConfig: returnResourceNotFoundExceptionif the function does not exist.function:qualifier) to avoid version/alias collisions.Written for commit a909020. Summary will update on new commits.