File: .claude/skills/setup-agent-team/growth.sh
Severity: HIGH
Finding: Lines 67, 83, 86-96, 137-151 use unsafe variable interpolation in bun -e commands
Lines 67 and 83 directly interpolate ${REDDIT_DATA_FILE} into JavaScript string literals passed to bun -e:
POST_COUNT=$(bun -e "const d=JSON.parse(await Bun.file('${REDDIT_DATA_FILE}').text()); ...")
REDDIT_JSON=$(cat "${REDDIT_DATA_FILE}")
Lines 86-96 and 137-151 interpolate ${PROMPT_FILE}, ${REDDIT_DATA_FILE}, ${PROMPT_TEMPLATE}, ${DECISIONS_FILE}, ${CLAUDE_STREAM_FILE}, and ${CLAUDE_OUTPUT_FILE} into multi-line JavaScript heredocs.
If any of these variables contain single quotes or other shell metacharacters, they could break out of the string context and execute arbitrary JavaScript code. While these are mktemp-generated paths (which are safe), the pattern is unsafe and could be copied to contexts where the variables come from user input.
Recommendation: Use environment variable passing instead of string interpolation:
# SAFE:
_DATA="${REDDIT_DATA_FILE}" bun -e 'const d = JSON.parse(await Bun.file(process.env._DATA).text()); ...'
# UNSAFE (current):
bun -e "const d = JSON.parse(await Bun.file('${REDDIT_DATA_FILE}').text()); ..."
This is documented in CLAUDE.md .claude/rules/shell-scripts.md but not followed here.
-- security/shell-scanner
File: .claude/skills/setup-agent-team/growth.sh
Severity: HIGH
Finding: Lines 67, 83, 86-96, 137-151 use unsafe variable interpolation in bun -e commands
Lines 67 and 83 directly interpolate ${REDDIT_DATA_FILE} into JavaScript string literals passed to bun -e:
Lines 86-96 and 137-151 interpolate ${PROMPT_FILE}, ${REDDIT_DATA_FILE}, ${PROMPT_TEMPLATE}, ${DECISIONS_FILE}, ${CLAUDE_STREAM_FILE}, and ${CLAUDE_OUTPUT_FILE} into multi-line JavaScript heredocs.
If any of these variables contain single quotes or other shell metacharacters, they could break out of the string context and execute arbitrary JavaScript code. While these are mktemp-generated paths (which are safe), the pattern is unsafe and could be copied to contexts where the variables come from user input.
Recommendation: Use environment variable passing instead of string interpolation:
This is documented in CLAUDE.md .claude/rules/shell-scripts.md but not followed here.
-- security/shell-scanner