Description
buildEnvContext() in src/domain/expressions/model_resolver.ts (line 32-34) exposes ALL environment variables to CEL expressions via Deno.env.toObject(). Any definition using ${{ env.AWS_SECRET_ACCESS_KEY }} or similar will have the secret value resolved and persisted as plaintext YAML in .swamp/definitions-evaluated/.
Steps to Reproduce
- Set sensitive environment variables (e.g.,
AWS_SECRET_ACCESS_KEY, GITHUB_TOKEN)
- Create a model definition using
${{ env.AWS_SECRET_ACCESS_KEY }} in globalArguments
- Run any command that evaluates expressions
- Inspect
.swamp/definitions-evaluated/ — secrets are in plaintext YAML
Expected Behavior
Either restrict which env vars are accessible to CEL expressions (allowlist), or ensure evaluated definitions with secrets are never persisted to disk.
Actual Behavior
All env vars from the process environment are exposed and persisted as plaintext after expression evaluation.
Summary
This affects the expression resolver in model_resolver.ts. The fix would involve either restricting env var access via an allowlist pattern, or ensuring that evaluated definitions containing env references are marked as sensitive and excluded from disk persistence.
Description
buildEnvContext()insrc/domain/expressions/model_resolver.ts(line 32-34) exposes ALL environment variables to CEL expressions viaDeno.env.toObject(). Any definition using${{ env.AWS_SECRET_ACCESS_KEY }}or similar will have the secret value resolved and persisted as plaintext YAML in.swamp/definitions-evaluated/.Steps to Reproduce
AWS_SECRET_ACCESS_KEY,GITHUB_TOKEN)${{ env.AWS_SECRET_ACCESS_KEY }}in globalArguments.swamp/definitions-evaluated/— secrets are in plaintext YAMLExpected Behavior
Either restrict which env vars are accessible to CEL expressions (allowlist), or ensure evaluated definitions with secrets are never persisted to disk.
Actual Behavior
All env vars from the process environment are exposed and persisted as plaintext after expression evaluation.
Summary
This affects the expression resolver in
model_resolver.ts. The fix would involve either restricting env var access via an allowlist pattern, or ensuring that evaluated definitions containing env references are marked as sensitive and excluded from disk persistence.