Skip to content

Commit e55b260

Browse files
committed
fix: replace unsafe env loading with secure source method in pre-push hook
- Replace export RUN_TESTS_ON_PUSH=true with set -a; source .env.local; set +a - Prevents shell injection from malicious environment variable values - Eliminates risk of commands like 'RUN_TESTS_ON_PUSH=true; rm -rf /' being executed
1 parent c6a02bb commit e55b260

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.husky/pre-push

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ $pnpm_cmd run check-types
2020

2121
# Load .env.local if it exists
2222
if [ -f ".env.local" ]; then
23-
export $(grep -v '^#' .env.local | xargs)
23+
set -a
24+
source .env.local
25+
set +a
2426
fi
2527

2628
# Run tests if RUN_TESTS_ON_PUSH is set to true

0 commit comments

Comments
 (0)