Skip to content

[security] ${VAR} interpolation in tycoon.yml is an env-var exfiltration vector (Medium) #62

Description

@db-tycoon-stephen

Summary

tycoon.yml strings are run through ${VAR} / ${VAR:-default} expansion against the victim's full os.environ (_interpolate_recursive, applied to the entire parsed config). A malicious shared project can place ${MOTHERDUCK_TOKEN}, ${AWS_SECRET_ACCESS_KEY}, etc. into any field. The expanded secret then flows into generated files (nao_config.yaml, RULES.md, dbt/Rill YAML), is sent to the configured LLM provider, or is included in the notify webhook payload — all exfiltration channels.

Evidence

  • src/tycoon/project.py:90-110, 306_interpolate_recursive over the whole tycoon.yml

Threat model

Victim runs almost any tycoon command inside a shared project → silent exfiltration of their environment secrets.

Fix

  • Restrict interpolation to an allowlist of fields where it's intended (connection strings the user explicitly authored), or refuse to expand env-var names matching a secret-looking pattern.
  • At minimum, never echo expanded secret values into generated artifacts or network payloads, and document the behavior.
  • runner._check_unexpanded_env_vars already warns on unexpanded vars; the inverse (warn on unexpected expanded vars) would help.

Severity: Medium

Metadata

Metadata

Assignees

No one assigned

    Labels

    securitySecurity or safety hardening

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions