Repository navigation
Description
From the pre-1.0 security audit (spore-host/spore-host#649, 2026-11-11), audit id iam-4. Verified: confirmed, severity medium (reviewer said high).
Where: pkg/aws/sweep_role.go:319 (at origin/main on 2026-11-11)
Evidence
CheckSweepRoleAccounts: m, err := mgmt(ctx); if err != nil { warn("could not tell whether account %s is an AWS Organizations management account ..."); return nil }. Any DescribeOrganization error (AccessDenied, throttle, network, a non-us-east-1 partition) therefore allows creation. The mgmt lookup uses the compute credentials (cmd/sweep_role.go:45-48), so orchestratorAccount is only compared with the compute account's organization's management account (lines 324-330). If the infra/orchestrator account is the management account of a different organization, it is never caught, even though forbiddenTrustAccounts' own comment says 'trusted into it or out of it'. organizations:DescribeOrganization is also absent from the umbrella least-privilege doc (docs/reference/iam-permissions.md); it appears only in spawn/docs/reference/cli-iam-actions.md.
Scenario
A user whose compute credentials are in an org management account, with iam:CreateRole but an explicit deny or missing grant on organizations:DescribeOrganization (or a transient Organizations error), runs a detached sweep or spawn sweep setup. spawn prints a warning and creates SpawnSweepCrossAccountRole in the management account, trusting SpawnSweepOrchestratorRole in spore-host-infra. That is a trust into a management account, which the code is meant to make impossible. Only the hardcoded 942542972736 is refused in all cases.
Verifier
spawn/pkg/aws/sweep_role.go:316-321: when mgmt(ctx) returns an error the code warns and returns nil. The doc comment at :303-305 says this fail-open is deliberate. orgaccount.ManagementAccount maps only AWSOrganizationsNotInUseException to "" and every other failure to an error, so AccessDenied, an SCP deny or a throttle all let creation go ahead. spawn/cmd/sweep_role.go:45-48 runs the lookup with the compute config only, so the orchestrator account is compared only against the compute org's management account. A management account of a different org on the infra side is never detected. organizations:DescribeOrganization appears only in spawn/docs/reference/cli-iam-actions.md. The hardcoded 942542972736 and 966362334030 are still always refused (:308-315), which keeps this at medium.
Suggested fix
Fail closed. When DescribeOrganization errors with anything other than AWSOrganizationsNotInUseException, refuse with a message naming the missing permission, and offer an explicit, logged override flag only if there is a real need. Also resolve the orchestrator account's organization with the infra credentials and refuse when it is that organization's management account. Add organizations:DescribeOrganization to the documented baseline.
Also raised as: input-2, instance-8, tenant-2.
Activity
Refuse cross-account trust into 942542972736 or an Organizations mana…
Refuse cross-account trust into 942542972736 or an Organizations mana…