Skip to content

Commit cb20000

Browse files
Hardened path resolution in review-new-skills.sh
Added `readlink -f` to securely resolve the script's path and establish the canonical repository root, preventing path confusion if invoked via symlink or from an unexpected working directory. Co-authored-by: GalihRensuke <126875499+GalihRensuke@users.noreply.github.com>
1 parent 94a3777 commit cb20000

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

scripts/review-new-skills.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99

1010
set -euo pipefail
1111

12+
# HARDENED PATH RESOLUTION: Trace symlinks to the real framework source
13+
REAL_PATH=$(readlink -f "$0")
14+
SCRIPT_DIR="$(cd "$(dirname "$REAL_PATH")" && pwd)"
15+
REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
16+
cd "$REPO_ROOT" || exit 1
17+
1218
THRESHOLD="${THRESHOLD:-70}"
1319
SKILL_DIRS=()
1420
MODE="changed"

0 commit comments

Comments
 (0)