oh-my-customcodex 0.5.19 → 0.5.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -102,6 +102,16 @@
|
|
|
102
102
|
],
|
|
103
103
|
"description": "Block Bash/Write/Edit writes into .claude/ sensitive paths before Claude Code permission prompts fire"
|
|
104
104
|
},
|
|
105
|
+
{
|
|
106
|
+
"matcher": "tool == \"Bash\" && tool_input.command matches \"(^|[[:space:];&|])(status|path|argv)[[:space:]]*=\"",
|
|
107
|
+
"hooks": [
|
|
108
|
+
{
|
|
109
|
+
"type": "command",
|
|
110
|
+
"command": "bash .codex/hooks/scripts/shell-reserved-var-advisor.sh"
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"description": "Warn on zsh/bash reserved variable assignments such as status=, path=, or argv= before shell execution (R020/#1491)"
|
|
114
|
+
},
|
|
105
115
|
{
|
|
106
116
|
"matcher": "tool == \"Bash\"",
|
|
107
117
|
"hooks": [
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# shell-reserved-var-advisor.sh — advisory guard for zsh/bash special variable assignments.
|
|
3
|
+
# Trigger: PreToolUse (Bash matcher)
|
|
4
|
+
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
input=$(cat)
|
|
8
|
+
command=$(printf '%s' "$input" | jq -r '.tool_input.command // ""' 2>/dev/null || true)
|
|
9
|
+
|
|
10
|
+
if [ -z "$command" ]; then
|
|
11
|
+
printf '%s' "$input"
|
|
12
|
+
exit 0
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
# zsh exposes several lowercase special parameters as read-only or semantically
|
|
16
|
+
# dangerous. `status=...` is the frequent footgun in polling snippets; `path`
|
|
17
|
+
# and `argv` are arrays/special parameters. Match assignment starts after common
|
|
18
|
+
# shell separators or whitespace, but do not match safe names like run_status=.
|
|
19
|
+
if printf '%s\n' "$command" | grep -Eq '(^|[[:space:];&|])(status|path|argv)[[:space:]]*='; then
|
|
20
|
+
echo '[Hook] WARNING: reserved shell variable assignment detected (R020/#1491).' >&2
|
|
21
|
+
echo '[Hook] Avoid zsh/bash special names: status, path, argv.' >&2
|
|
22
|
+
echo '[Hook] Use safe names such as run_status, cmd_path, or args before executing.' >&2
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
printf '%s' "$input"
|
package/templates/manifest.json
CHANGED