fix(kinesis,ec2,sns,iam,ecs,secretsmanager,bedrock): validation + pagination correctness (bug-hunt)#2286
Merged
Conversation
…ination correctness (bug-hunt) Validation cluster from the 2026-07-15 bug hunt (1.37-1.43). - secretsmanager (1.37): BatchGetSecretValue with Filters never skipped an incoming NextToken nor emitted one, so page 2 was impossible. Now offset- paginates and returns NextToken while results remain. - ec2 (1.38): AssociateAddress fabricated a phantom association for an unknown AllocationId (or PublicIp). Now returns InvalidAllocationID.NotFound / InvalidAddress.NotFound / MissingParameter, only associating a real address. - sns (1.39): Subscribe accepted any Protocol string, creating a phantom subscription that could never deliver. Unknown protocols now return InvalidParameter. - iam/sts (1.40): inline session Policy was length-checked but never validated as JSON. A non-JSON / non-object policy now returns MalformedPolicyDocument (AssumeRole / AssumeRoleWithSAML / AssumeRoleWithWebIdentity / GetFederationToken). - ecs (1.41): ListTaskDefinitions sort=DESC was undone by paginate_arns re-sorting ascending. Added a direction-aware paginate_arns_dir so DESC pages advance in reverse. - kinesis (1.42): ListShards defaulted MaxResults to 10000; AWS returns up to 1000 when omitted. Corrected the default (max requestable stays 10000). - bedrock (1.43): ListInferenceProfiles emitted the last item's Id as the token but resumed by comparing it to the ARN, and computed the offset against the APPLICATION-only list before prepending SYSTEM_DEFINED profiles — page 2 skipped/duplicated rows. Now a single opaque offset into the combined list. Tests: e2e for secretsmanager pagination, ec2 phantom-association rejection, sns unknown-protocol rejection, bedrock no-skip/no-dup pagination; unit for ecs descending pagination and sts policy-JSON validation.
# Conflicts: # crates/fakecloud-e2e/tests/sns.rs
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
Validation cluster from the 2026-07-15 bug hunt (findings 1.37-1.43) — seven
services accepting bad input or paginating incorrectly.
paginate_arns_dirTest plan
secretsmanager::..._paginates_with_filters,ec2_vpc_control_plane::associate_address_rejects_unknown_allocation_id,sns::sns_subscribe_rejects_unknown_protocol,bedrock::..._paginates_without_skip_or_dup.ecs::paginate_arns_dir_descending_pages_in_reverse,sts::validate_session_policy_json_accepts_object_rejects_garbage.cargo build/clippy --all-targets/fmtclean across all seven crates + fakecloud-e2e.No new public API surface (input validation + pagination fixes on existing ops),
so no SDK/docs regeneration needed. Noted in passing: aws-sdk-ec2 does not parse
EC2's query-protocol error envelope into
meta().code()— a separate,pre-existing format gap, so the ec2 test asserts on the raw error text.
Summary by cubic
Fixes validation and pagination across seven services to match AWS behavior, preventing phantom resources and incorrect page results. Aligns error codes and NextToken handling.
NextToken.AllocationId/PublicIpwithInvalidAllocationID.NotFound/InvalidAddress.NotFoundorMissingParameter; no phantom associations.ProtocolwithInvalidParameter.Policymust be a JSON object; otherwiseMalformedPolicyDocument(AssumeRole, AssumeRoleWithSAML, AssumeRoleWithWebIdentity, GetFederationToken).MaxResultsto 1000 when omitted (was 10000).Written for commit 2a94764. Summary will update on new commits.