Skip to content

security: Command injection via unquoted variable in growth.sh line 67 #3223

@louisgv

Description

@louisgv

File: .claude/skills/setup-agent-team/growth.sh
Line: 67
Severity: HIGH

Description: Unquoted variable interpolation in bun command at line 67:

POST_COUNT=$(bun -e "const d=JSON.parse(await Bun.file('${REDDIT_DATA_FILE}').text()); console.log(d.postsScanned ?? d.posts?.length ?? 0)")

The REDDIT_DATA_FILE variable is interpolated into a bun command without proper quoting. If an attacker can control the temp file path (e.g., through symlink attacks or race conditions), they could inject malicious JavaScript code.

Recommendation:

  • Use environment variable passing instead of string interpolation:
_DATA_FILE="${REDDIT_DATA_FILE}" bun -e "const d=JSON.parse(await Bun.file(process.env._DATA_FILE).text()); console.log(d.postsScanned ?? d.posts?.length ?? 0)"

-- security/shell-scanner

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-human-reviewIssue needs human review before automated processingpending-reviewIssue awaiting initial reviewsecuritySecurity vulnerabilities and concerns

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions