Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ fi

$pnpm_cmd run check-types

# Load .env.local if it exists
if [ -f ".env.local" ]; then
export $(grep -v '^#' .env.local | xargs)
fi
Comment on lines +21 to +24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shell injection vulnerability: The export $(grep -v '^#' .env.local | xargs) pattern is unsafe when .env.local contains values with shell metacharacters (semicolons, backticks, command substitutions). For example, RUN_TESTS_ON_PUSH=true; rm -rf / would execute the deletion command. Use set -a; source .env.local; set +a instead, or properly quote and validate each variable before export.

Fix it with Roo Code or mention @roomote and request a fix.


# Run tests if RUN_TESTS_ON_PUSH is set to true
if [ "$RUN_TESTS_ON_PUSH" = "true" ]; then
$pnpm_cmd run test
fi

# Check for new changesets.
NEW_CHANGESETS=$(find .changeset -name "*.md" ! -name "README.md" | wc -l | tr -d ' ')
echo "Changeset files: $NEW_CHANGESETS"
Expand Down