Repository navigation
Description
From the pre-1.0 security audit (spore-host/spore-host#649, 2026-11-11), audit id iam-1. Verified: confirmed, severity high (reviewer said critical).
Where: cmd/onboard.go:145 (at origin/main on 2026-11-11)
Evidence
The only refusal in the suite is in spawn/pkg/aws/sweep_role.go (forbiddenTrustAccounts + CheckSweepRoleAccounts). grep -rn 942542972736 across all repos finds no other guard. spawn onboard (cmd/onboard.go:115-145) takes accountID from STS and calls ensurePortalOnboardRole(..., accountID, phoneHomeRole, ...) without any account or Organizations check. It then writes portalTrustPolicy (onboard.go:196-205): {"Principal":{"AWS":},"Action":"sts:AssumeRole","Condition":{"StringEquals":{"sts:ExternalId":...}}}. phoneHomeRole can be any ARN from --phone-home-role or SPORE_PORTAL_PHONE_HOME_ROLE_ARN. pkg/config CheckAccount (account_guard.go:79) only compares against a pinned expected account. Three CloudFormation templates have no Rules assertion on AWS::AccountId: spore-host/deployment/cloudformation/portal-onboarding-role.yaml (trusts PhoneHomeLambdaRoleArn/ProberLambdaRoleArn in spore-host-infra), spawn/deployment/cloudformation/ttl-reaper-cross-account-role.yaml:97 (trusts arn:aws:iam::${ReaperAccountId}:root, default 966362334030; its description says to 'Deploy this template in EVERY AWS account that spawn launches spores into'), and bot-cross-account-role.yaml.
Scenario
An operator runs spawn onboard, or the web quick-create of portal-onboarding-role.yaml, or deploys the reaper cross-account template while their credentials point at 942542972736 or at the management account of their AWS Organization. Each path creates a role in that account that spore-host-infra (966362334030) can assume. That is exactly the trust that was auto-detected and force-denied in 12 minutes on 2026-09-26, and the reaper coverage gap (#613/#624/#625) is the reason someone would deploy the reaper template there. ExternalId does not mitigate it (constraint_account_trust_boundary). It needs an operator mistake, not an attacker, but the boundary is absolute and these paths have no guard at all.
Verifier
spawn/cmd/onboard.go:115-145 takes accountID from STS and calls ensurePortalOnboardRole with no forbidden-account or Organizations check. portalTrustPolicy (onboard.go:196-205) trusts any --phone-home-role ARN under an ExternalId. The only refusal list is forbiddenTrustAccounts in spawn/pkg/aws/sweep_role.go:268, and it is only reached from the sweep path. grep finds no Rules: section in spore-host/deployment/cloudformation/portal-onboarding-role.yaml, spawn/deployment/cloudformation/ttl-reaper-cross-account-role.yaml (its Description says 'Deploy this template in EVERY AWS account', and ReaperAccountId defaults to 966362334030) or bot-cross-account-role.yaml. spawn/account_boundary_test.go only scans ARNs that are committed in the spawn repo. It cannot catch a trust built at runtime in whichever account the caller's credentials point to. Downgraded from critical: triggering it takes an operator who already holds IAM write in 942542972736 or in a management account and runs the tool there. No attacker path exists, and ExternalId does not matter to the boundary rule.
Suggested fix
Move forbiddenTrustAccounts and CheckSweepRoleAccounts into a shared package (for example pkg/orgaccount) and call it, failing closed, from spawn onboard before ensurePortalOnboardRole. Apply the same check to any CLI that writes trust for the reaper or bot. Add a CloudFormation Rules section to every cross-account template, for example Rules: NotForbidden: Assertions: [{Assert: !Not [!Equals [!Ref 'AWS::AccountId', '942542972736']]}]. Have phone-home and accountlifecycle refuse to register 942542972736 or a known management account. Add a CI test that greps every template for a trust without this rule.
Deployed-state check
Run aws iam list-roles in 942542972736 (read-only, by its owner) for spore-portal-onboard, spawn-ttl-reaper-ec2 and SpawnBotCrossAccount, and scan the portal accounts DynamoDB table and REAPER_ROLE_ARNS on spawn-ttl-reaper-production for any 942542972736 ARN.
Also raised as: input-1, instance-1, tenant-1.
Activity
Refuse cross-account trust into 942542972736 or an Organizations mana…
Refuse cross-account trust into 942542972736 or an Organizations mana…