Skip to content

security: Plugin config from launch --config files is written into EC2 user-data and a world-readable /etc/spawn/plugins.json #1590

Closed

Description

@scttfrdmn

From the pre-1.0 security audit (spore-host/spore-host#649, 2026-11-11), audit id secrets-7. Verified: confirmed, severity low (reviewer said low).

Where: pkg/launcher/bootstrap.go:623 (at origin/main on 2026-11-11)

Evidence

bootstrap.go:611-624: declJSON, _ := json.Marshal(cfg.Plugins); cat > /etc/spawn/plugins.json <<'EOFPLUGINS' %s EOFPLUGINS; chmod 644 /etc/spawn/plugins.json. plugin.Declaration (pkg/plugin/spec.go:198-201) carries Config map[string]string. cmd/launch_config.go:978-985 takes cfg.Plugins, including their config, from the --config YAML. Registry plugins define secret-valued config: code-server password, rstudio-server password, jupyterlab token; spore-host-plugin-tailscale auth_key (README line 12).

Scenario

A user who sets a plugin password, token or auth_key in a launch config file has it embedded in user-data. Any principal with ec2:DescribeInstanceAttribute (userData), which is in ReadOnlyAccess, can read it, and so can every local user on the instance through the 0644 file.

Verifier

spawn/pkg/launcher/bootstrap.go:612-624 marshals cfg.Plugins, Config map included, into the user-data script and runs chmod 644 /etc/spawn/plugins.json. cmd/launch_config.go:978-985 takes the plugin declarations, config included, from --config YAML. spore-plugins/plugins/code-server/plugin.yaml:27 and rstudio-server define a password config key. The secret is readable through DescribeInstanceAttribute userData and by local users. It only affects users who put secrets in their launch config, so low.

Suggested fix

Write plugins.json 0600 (spored runs as root). Mark secret config keys in the plugin schema (e.g. secret: true) and refuse them at launch time, or route them through the launch-config object or the push API instead of user-data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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