Skip to content

fix(launcher/entrypoint): env carry array + widen verbose redaction - #1499

Open
Moon-Knight13 wants to merge 2 commits into
felddy:developfrom
Moon-Knight13:fix/env-carry-array-and-verbose-redaction
Open

fix(launcher/entrypoint): env carry array + widen verbose redaction#1499
Moon-Knight13 wants to merge 2 commits into
felddy:developfrom
Moon-Knight13:fix/env-carry-array-and-verbose-redaction

Conversation

@Moon-Knight13

Copy link
Copy Markdown

Two small, independent fixes in the container launch path.

1. launcher.sh — carry env vars as an array (correctness)

The carry list is expanded unquoted into env -i, so any passlisted variable whose value contains a space breaks the exec command line:

NODE_OPTIONS="--max-old-space-size=4096 --enable-source-maps"

splits into NODE_OPTIONS=--max-old-space-size=4096 plus a stray --enable-source-maps, which env treats as the program to run — exec fails and the container crash-loops through backoff instead of starting Foundry.

Build the carry set as a bash array so each NAME=VALUE reaches env as one argument. The ${arr[@]+...} expansion guards the empty-array case under set -o nounset on bash < 4.4.

Repro:

NODE_OPTIONS='--a --b' bash -c '<carry loop>; env -i $LIST env'
# -> env: '--b': No such file or directory

2. entrypoint.sh — widen verbose env-dump redaction (security)

The redaction regex (.*PASSWORD|KEY.*)=.* misses variables where the sensitive token is not adjacent to =: FOUNDRY_PASSWORD_SALT, and any *_SECRET / *_TOKEN names, are printed in clear in the CONTAINER_VERBOSE environment dump. Match the sensitive keyword anywhere in the variable name and add SECRET / TOKEN / SALT.

Both changes are limited to src/launcher.sh and src/entrypoint.sh; no behavior change outside the described cases.

The carry list was expanded unquoted into 'env -i', so any passlisted
variable whose value contains a space breaks the exec command line.
Example: NODE_OPTIONS="--max-old-space-size=4096 --enable-source-maps"
splits into 'NODE_OPTIONS=--max-old-space-size=4096' plus a stray
'--enable-source-maps', which env treats as the program to run — exec
fails and the container crash-loops through backoff instead of starting
Foundry.

Build the carry set as a bash array instead; each NAME=VALUE reaches
env as one argument. The ${arr[@]+...} expansion guards the
empty-array case under 'set -o nounset' on bash <4.4.

Repro:
  NODE_OPTIONS='--a --b' bash -c '<old carry loop>; env -i $LIST env'
  -> env: '--b': No such file or directory
The redaction regex '(.*PASSWORD|KEY.*)=.*' misses variables where the
sensitive token is not adjacent to '=': FOUNDRY_PASSWORD_SALT, and any
*_SECRET/*_TOKEN names, are printed in clear in the CONTAINER_VERBOSE
environment dump. Match the sensitive keyword anywhere in the variable
name instead, and add SECRET/TOKEN/SALT to the list.
@Moon-Knight13
Moon-Knight13 requested a review from felddy as a code owner August 9, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant