Skip to content

fix: resolve issues #3911 and #3939#3948

Open
Hardikrepo wants to merge 1 commit into
aws:developfrom
Hardikrepo:develop
Open

fix: resolve issues #3911 and #3939#3948
Hardikrepo wants to merge 1 commit into
aws:developfrom
Hardikrepo:develop

Conversation

@Hardikrepo

Copy link
Copy Markdown

Summary

  • Security: Logical ID uniqueness check can be bypassed via substring matching #3911 - Security: Logical ID uniqueness check bypass
    Normalized all \do_not_verify\ values in \�erify_logical_id.py\ from plain strings to lists. Python's \in\ operator on a string performs substring matching, allowing a crafted resource type like \AWS::Serverless::Fun\ to bypass the uniqueness check. Using lists ensures exact element matching.

  • Globals.Function Architectures should be overridden by resource-level Architectures #3939 - Globals.Function Architectures concatenates instead of overrides
    Added _list_override_properties = frozenset({'Architectures'})\ to \GlobalProperties\ in \globals.py. When \Architectures\ is set at both global and resource level, the resource-level value now replaces the global value entirely. Previously, SAM concatenated both lists (e.g. [x86_64, arm64]), which is invalid since Lambda only supports one architecture.

Files Changed

File Change
\samtranslator/translator/verify_logical_id.py\ Normalize all \do_not_verify\ values to lists
\samtranslator/plugins/globals/globals.py\ Add _list_override_properties\ and update _merge_dict\
\ ests/translator/test_verify_logical_id.py\ New test file - 9 tests for #3911
\ ests/plugins/globals/test_globals.py\ 2 new test cases for #3939

Test Plan

  • 55/55 tests pass
  • Substring and superstring bypass scenarios explicitly tested
  • Architectures override and inheritance both tested
  • No existing tests regressed

Fixes #3911
Fixes #3939

aws#3911 - Security: normalize do_not_verify values to lists so `in`
performs exact element matching instead of substring matching,
preventing logical ID uniqueness check bypass via crafted resource types.

aws#3939 - Globals.Function: Architectures at resource level now overrides
the global value instead of being concatenated, since Lambda only
supports a single architecture value. Introduced _list_override_properties
frozenset in GlobalProperties to handle this class of properties.

Tests: added tests/translator/test_verify_logical_id.py (9 tests)
and 2 new cases in tests/plugins/globals/test_globals.py.
@Hardikrepo Hardikrepo requested a review from a team as a code owner June 29, 2026 15:16
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.

Globals.Function Architectures should be overridden by resource-level Architectures

1 participant