Skip to content

security: Dashboard per-user instance isolation is Lambda-side only; any Google/GitHub/Globus sign-in can read every tenant's instances directly #1585

Closed

Description

@scttfrdmn

From the pre-1.0 security audit (spore-host/spore-host#649, 2026-11-11), audit id tenant-4. Verified: plausible, severity medium (reviewer said high).

Mitigated live 2026-11-11: the Cognito authenticated role no longer has EC2 read or the cross-account AssumeRole, and unauthenticated identities are off (#649). What remains is removing SpawnDashboardCrossAccountReadRole and its setup script.

Where: lambda/dashboard-api/scripts/setup-cross-account-role.sh:40 (at origin/main on 2026-11-11)

Evidence

Trust: "Principal": {"AWS": "arn:aws:iam::${INFRA_ACCOUNT_ID}:role/Cognito_SpawnDashboard_Auth_Role"} with "Action": ["ec2:DescribeInstances"], "Resource": "*". The Cognito identity pool accepts any accounts.google.com / auth.globus.org / GitHub-bridge token for the public client IDs in spore-host web/js/auth.js. Its authenticated role itself has ec2:DescribeInstances/DescribeTags on * (spore-host scripts/setup-dashboard-cognito.sh). instances.go applies the only isolation, a tag:spawn:iam-user filter, and gaps_test.go confirms 'every signed-in dashboard user can assume [SpawnDashboardCrossAccountReadRole] directly from the browser'.

Scenario

An outsider signs into the dashboard with any personal Google account, takes the Cognito credentials from the browser, and calls sts:AssumeRole on SpawnDashboardCrossAccountReadRole in 435415984226 and then ec2:DescribeInstances in every region. They get every tenant's instances: IPs, IAM user ARNs (spawn:iam-user), DNS names, team IDs, pre-stop commands and other spawn:* tags. The Cognito role alone does the same against the infra account. Withholding terminate (#1349) does not fix the read side.

Verifier

Isolation does live only in the Lambda. spawn's own gaps_test.go:20-27 states that every signed-in dashboard user can assume SpawnDashboardCrossAccountReadRole directly from the browser. web/js/main.js:296-312 does exactly that with sts.assumeRole, and the trust (lambda/dashboard-api/scripts/setup-cross-account-role.sh:33-45) names Cognito_SpawnDashboard_Auth_Role with no condition. However, a cross-account AssumeRole also needs sts:AssumeRole in the caller's identity policy, and the repo's Cognito auth-role policy (spore-host/scripts/setup-dashboard-cognito.sh:174-198) grants only ec2 Describe* and GetCallerIdentity. The grant that makes this work must therefore exist only out-of-band. Whether any Google, GitHub or Globus account can obtain the role depends on the identity pool's providers and role-mapping, which I cannot see. The exposure is read-only metadata (tags, IPs, ARNs, webhook URLs in tags) in 435415984226, so medium rather than high.

Suggested fix

Restrict who can obtain the authenticated role: an allow-list via Cognito role-mapping rules on a verified claim, or a developer-authenticated identity issued only after the email/CLI link check. Do the member-account read with session tags (Cognito principal tags → ec2:ResourceTag/spawn:iam-user = ${aws:PrincipalTag/...}) so that IAM, not the Lambda, enforces per-user scope. Remove the EC2 grants from the Cognito auth role in the infra account.

Deployed-state check

Check Cognito_SpawnDashboard_Auth_Role's inline/attached policies for sts:AssumeRole on arn:aws:iam::435415984226:role/SpawnDashboardCrossAccountReadRole. Check the identity pool's SupportedLoginProviders and whether it has role-mapping rules or a claim allow-list. Check whether 435415984226 hosts instances of more than one user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:security

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions