The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
fix: path traversal in install.sh, error logging in hooks
Affaan Mustafa6e5b45ed2883
diff --git a/install.sh b/install.shindex 9aff2bd46..f7d9c89b9 100755--- a/install.sh+++ b/install.sh@@ -69,6 +69,11 @@ if [[ "$TARGET" == "claude" ]]; then# Install each requested languagefor lang in "$@"; do+ # Validate language name to prevent path traversal+ if [[ ! "$lang" =~ ^[a-zA-Z0-9_-]+$ ]]; then+ echo "Error: invalid language name '$lang'. Only alphanumeric, dash, and underscore allowed." >&2+ continue+ filang_dir="$RULES_DIR/$lang"if [[ ! -d "$lang_dir" ]]; thenecho "Warning: rules/$lang/ does not exist, skipping." >&2@@ -101,6 +106,11 @@ if [[ "$TARGET" == "cursor" ]]; then# Install language-specific rulesfor lang in "$@"; do+ # Validate language name to prevent path traversal+ if [[ ! "$lang" =~ ^[a-zA-Z0-9_-]+$ ]]; then+ echo "Error: invalid language name '$lang'. Only alphanumeric, dash, and underscore allowed." >&2+ continue+ fiif [[ -d "$CURSOR_SRC/rules" ]]; thenfound=falsefor f in "$CURSOR_SRC/rules"/${lang}-*.md; dodiff --git a/scripts/hooks/check-console-log.js b/scripts/hooks/check-console-log.jsindex be2905342..2cf0b09fe 100755--- a/scripts/hooks/check-console-log.js+++ b/scripts/hooks/check-console-log.js@@ -59,8 +59,8 @@ process.stdin.on('end', () => {if (hasConsole) {log('[Hook] Remove console.log statements before committing');}- } catch {- // Silently ignore errors (git might not be available, etc.)+ } catch (err) {+ log(`[Hook] check-console-log error: ${err.message}`);}// Always output the original datadiff --git a/scripts/hooks/session-end.js b/scripts/hooks/session-end.jsindex de7c8afd4..cc4abd1a4 100644--- a/scripts/hooks/session-end.js+++ b/scripts/hooks/session-end.js@@ -157,10 +157,10 @@ ${summarySection}function buildSummarySection(summary) {let section = '## Session Summary\n\n';- // Tasks (from user messages)+ // Tasks (from user messages — escape backticks to prevent markdown breaks)section += '### Tasks\n';for (const msg of summary.userMessages) {- section += `- ${msg}\n`;+ section += `- ${msg.replace(/`/g, '\\`')}\n`;}section += '\n';