fix(bin): pass settings path and hook command via env vars#858
Open
garagon wants to merge 1 commit intogarrytan:mainfrom
Open
fix(bin): pass settings path and hook command via env vars#858garagon wants to merge 1 commit intogarrytan:mainfrom
garagon wants to merge 1 commit intogarrytan:mainfrom
Conversation
Same fix pattern as garrytan#819: replace direct shell variable interpolation inside bun -e scripts with environment variables read via process.env. Shell interpolation of $SETTINGS_FILE and $HOOK_CMD into JavaScript string literals allows paths containing quotes to break out of the string context and execute arbitrary code. Files changed: - bin/gstack-team-init: $SETTINGS → process.env.GSTACK_SETTINGS_PATH - bin/gstack-settings-hook: $SETTINGS_FILE → process.env.GSTACK_SETTINGS_PATH, $HOOK_CMD → process.env.GSTACK_HOOK_CMD (also removes nested bun subprocess)
Contributor
Author
|
CI note: the E2E eval failures require ANTHROPIC_API_KEY which is not available on fork PRs. Free tests (build-image) pass. The change only replaces shell variable interpolation with process.env reads in two bin scripts — no impact on eval test paths. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replace direct shell variable interpolation inside
bun -escripts withenvironment variables read via
process.envingstack-team-initandgstack-settings-hook.Why
Same pattern fixed in #819 (gstack-learnings-search): shell variables
interpolated into JavaScript string literals allow paths containing quotes
to break the string context.
A settings path like
/tmp/it's-a-test/settings.jsonproduces:Environment variables are read as-is by
process.envwithout shellinterpretation.
Files
bin/gstack-team-init:$SETTINGS→process.env.GSTACK_SETTINGS_PATHbin/gstack-settings-hook:$SETTINGS_FILE→process.env.GSTACK_SETTINGS_PATH,$HOOK_CMD→process.env.GSTACK_HOOK_CMD