Skip to content

Commit febbc00

Browse files
committed
Fix relative path bypass in methodology analysis read guard
When realpath is unavailable, the fallback assigned FILE_PATH verbatim which could remain relative. The project-root prefix check only matched absolute paths, allowing relative reads to slip through during the methodology analysis phase. Now normalize relative paths to absolute by prepending PROJECT_ROOT before the guard checks.
1 parent 9cf2544 commit febbc00

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"name": "humanize",
99
"source": "./",
1010
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
11-
"version": "1.16.0"
11+
"version": "1.16.1"
1212
}
1313
]
1414
}

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "humanize",
33
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
4-
"version": "1.16.0",
4+
"version": "1.16.1",
55
"author": {
66
"name": "humania-org"
77
},

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Humanize
22

3-
**Current Version: 1.16.0**
3+
**Current Version: 1.16.1**
44

55
> Derived from the [GAAC (GitHub-as-a-Context)](https://github.com/SihaoLiu/gaac) project.
66

hooks/loop-read-validator.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,21 @@ if [[ -n "$_MA_CHECK_DIR" ]]; then
9797
fi
9898
_ma_real_loop=$(realpath "$_MA_CHECK_DIR" 2>/dev/null || echo "")
9999
# Fallback to raw paths when realpath is unavailable (older macOS/BSD)
100-
[[ -z "$_ma_real_path" ]] && _ma_real_path="$FILE_PATH"
101-
[[ -z "$_ma_real_loop" ]] && _ma_real_loop="$_MA_CHECK_DIR"
100+
# Ensure paths are absolute so prefix guards cannot be bypassed
101+
if [[ -z "$_ma_real_path" ]]; then
102+
if [[ "$FILE_PATH" == /* ]]; then
103+
_ma_real_path="$FILE_PATH"
104+
else
105+
_ma_real_path="$PROJECT_ROOT/$FILE_PATH"
106+
fi
107+
fi
108+
if [[ -z "$_ma_real_loop" ]]; then
109+
if [[ "$_MA_CHECK_DIR" == /* ]]; then
110+
_ma_real_loop="$_MA_CHECK_DIR"
111+
else
112+
_ma_real_loop="$PROJECT_ROOT/$_MA_CHECK_DIR"
113+
fi
114+
fi
102115
if [[ "$_ma_real_path" == "$_ma_real_loop/"* ]]; then
103116
_ma_basename=$(basename "$_ma_real_path")
104117
# Allowlist: only methodology artifacts (not raw development records).

0 commit comments

Comments
 (0)