Skip to content

fix(iam): gate AssumeRoot on RootSessions + empty NotAction/NotResource matches nothing#1930

Merged
vieiralucas merged 2 commits into
mainfrom
fix/iam-assumeroot-empty-notaction
Jun 25, 2026
Merged

fix(iam): gate AssumeRoot on RootSessions + empty NotAction/NotResource matches nothing#1930
vieiralucas merged 2 commits into
mainfrom
fix/iam-assumeroot-empty-notaction

Conversation

@vieiralucas

@vieiralucas vieiralucas commented Jun 24, 2026

Copy link
Copy Markdown
Member

Summary (5.1 + 5.2, auth-when-enabled)

  • AssumeRoot (5.1) minted :root credentials for an arbitrary TargetPrincipal unconditionally, so a single sts:AssumeRoot grant escalated to root over every account with no organization trust. It now requires the centralized root-access RootSessions feature enabled in the caller's account (the org-level gate AWS enforces, set via EnableOrganizationsRootSessions); without it the call is denied. Checked after input validation so malformed requests still surface their validation error first.
  • Empty NotAction/NotResource matched everything (5.2) — [].all(...) is vacuously true — so a degenerate {Effect:Allow, NotAction:[], Resource:*} (which a resource policy with no put-time validation can carry) became a public allow-all. Empty NotAction/NotResource now match nothing (deny-by-default; AWS rejects such policies anyway).

Non-code surface

Auth enforcement correctness; no new API surface. No SDK/docs/metadata change applies (checked).

Test plan

  • assume_root_denied_without_root_sessions (and the existing success tests now enable RootSessions first).
  • empty_not_action_or_not_resource_matches_nothing.
  • cargo test -p fakecloud-iam --lib (494) passes; clippy clean.

Summary by cubic

Fix two IAM evaluation issues: gate cross-account AssumeRoot on RootSessions and make empty NotAction/NotResource match nothing. Prevents cross-account root escalation and accidental allow-all.

  • Bug Fixes
    • AssumeRoot into another account now requires the org RootSessions feature; same-account AssumeRoot remains allowed. Without it, returns AccessDenied.
    • Empty NotAction or NotResource no longer match everything; they now match nothing (deny by default).

Written for commit 473998c. Summary will update on new commits.

Review in cubic

…ce matches nothing

Two auth-when-enabled correctness fixes:

- AssumeRoot minted :root credentials for an arbitrary TargetPrincipal
  unconditionally, so a single sts:AssumeRoot grant escalated to root over every
  account with no organization trust. It now requires the centralized
  root-access RootSessions feature to be enabled in the caller's account (the
  org-level gate AWS enforces, EnableOrganizationsRootSessions); without it the
  call is denied (checked after input validation so malformed requests still
  surface their validation error). (5.1)

- An empty NotAction/NotResource matched everything (`[].all(...)` is vacuously
  true), so a degenerate `{Effect:Allow, NotAction:[], Resource:*}` — which a
  resource policy with no put-time validation can carry — became a public
  allow-all. Empty NotAction/NotResource now match nothing (deny-by-default;
  AWS rejects such policies anyway). (5.2)

Unit tests: AssumeRoot denied without RootSessions (and the existing success
tests enable it first); empty NotAction and empty NotResource both deny.
The 5.1 fix required organizations_root_sessions unconditionally, which broke
the recorded AWS baseline (conformance sts_assume_root) where same-account
AssumeRoot succeeds with no org setup. The actual escalation risk is
cross-account: a single sts:AssumeRoot grant minting :root over every member
account. Restrict the RootSessions gate to targets in a different account than
the caller; same-account AssumeRoot (member root managing itself) is always
allowed.

Adds a same-account-without-RootSessions success test; existing cross-account
success/denial tests unchanged.
@vieiralucas vieiralucas merged commit 5a88910 into main Jun 25, 2026
93 checks passed
@vieiralucas vieiralucas deleted the fix/iam-assumeroot-empty-notaction branch June 25, 2026 03:31
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.

1 participant