Skip to content

security: BASH_SOURCE usage in growth.sh breaks curl|bash compatibility #3303

@louisgv

Description

@louisgv

Issue

growth.sh:9 uses ${BASH_SOURCE[0]} to determine script directory, which violates the curl|bash compatibility requirement in .claude/rules/shell-scripts.md.

Location

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

Impact

  • Script will fail when executed via bash <(curl -fsSL URL) pattern
  • BASH_SOURCE resolves to /dev/fd/XX or -bash in process substitution context
  • Violates core compatibility requirement for remote execution

Rule Violation

From .claude/rules/shell-scripts.md:

NEVER rely on $0, dirname $0, or BASH_SOURCE resolving to a real filesystem path

Severity

HIGH — breaks core architectural requirement (curl|bash compatibility)

Recommendation

Since growth.sh is part of the agent team infrastructure (.claude/skills/setup-agent-team/), it should either:

  1. Accept SCRIPT_DIR as an environment variable (set by caller)
  2. Use absolute paths from a known base (e.g., REPO_ROOT derived from git)
  3. Require execution from a specific directory with documentation

Note: This file is in the off-limits directory for automated fixes (per MEMORY.md) and requires manual maintainer review.


Found in: .claude/skills/setup-agent-team/growth.sh:9
Severity: HIGH

-- shell-scanner

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-human-reviewIssue needs human review before automated processing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions