Skip to content

feat(env): harden env parsing - #334

Open
Mario Savarese (marsavar) wants to merge 2 commits into
mainfrom
marsavar/harden-env-parsing
Open

feat(env): harden env parsing#334
Mario Savarese (marsavar) wants to merge 2 commits into
mainfrom
marsavar/harden-env-parsing

Conversation

@marsavar

@marsavar Mario Savarese (marsavar) commented Aug 7, 2026

Copy link
Copy Markdown

feat(env): harden env parsing

The current implementation generates a single string with double-space-separated
export KEY=VALUE commands. This assumes that both the key and the value are sane,
but it is possible that they may be malformed. If that is the case, the enclave cannot
boot successfully

This commit ensures that the key is a POSIX complaint variable name, and that values
are shell-quoted.

If an env variable name is malformed, this is added to the debug logs.

test: add e2e tests to exercise malformed variable path

Adds e2e tests.

The current implementation generates a single string with double-space-separated
`export KEY=VALUE` commands. This assumes that both the key and the value are sane,
but it is possible that they may be malformed. If that is the case, the enclave cannot
boot successfully

This commit ensures that the key is a POSIX complaint variable name, and that values
are shell-quoted.

If an env variable name is malformed, this is added to the debug logs.
@marsavar
Mario Savarese (marsavar) marked this pull request as ready for review August 7, 2026 16:55
@marsavar
Mario Savarese (marsavar) requested a review from a team as a code owner August 7, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant