Skip to content

fix(cli): reject mapping keys that inject extra .env assignments #511

Closed

Description

@macalbert

Description

The CLI accepts mapping keys containing equals signs and newlines. Since keys are written verbatim, one mapping creates additional environment assignments while the command reports success.

Reproduced on CLI 0.13.2, commit c317813caa358cb4fb00cebb97a069e7cd96e6fd, Windows, Node.js 24.20.0. The compiled CLI used the real AWS SDK against a local HTTP SSM/STS stub with fictional values; no real cloud credentials were used.

Reproduction

Use this map (JSON escapes represent a real newline in the parsed key):

{"SAFE=prefix\nINJECTED": "/simple"}

Have /simple return fictional value fictional-value-123, then run node lib/envilder/apps/cli/entry/Index.js --map=map.json --envfile=result.env.

Actual: exit code 0 and:

SAFE=prefix
INJECTED=fictional-value-123

Expected: reject the invalid mapping key with an actionable error before provider calls or destination writes.

Acceptance Criteria

  • Should_RejectMappingKey_When_NameContainsNewlineCarriageReturnOrEquals.
  • Should_PreserveDestination_When_MappingContainsInvalidVariableNames.
  • Enforce the variable-name grammar already defined by the map-file specification.
  • Preserve valid names and reserved metadata-key behavior.
  • Tests pass: pnpm test.
  • Lint passes: pnpm lint; rebuilt Action passes pnpm verify:gha.

Technical Notes

Activity

  1. moved this from Backlog to In progress in Envilder projecton Sep 7, 2026
  2. added 3 commits that reference this issue on Sep 19, 2026
    a2218c1
    70376fa
    9d7ffaa
  3. moved this from In progress to Done in Envilder projecton Sep 21, 2026
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

    needs-triageAwaiting triage and prioritization

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions