From 9b516a32dee89534cca80fd8acb16272c8c3b28f Mon Sep 17 00:00:00 2001 From: Yuriy Andamasov Date: Mon, 11 May 2026 01:39:38 +0300 Subject: ci(ai-validation): fail-fast on traversal paths (consistency w/ non-regular guard) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Copilot finding on PR #1959 (line 114): the path-traversal hardening block used `continue` (skip-with-warning) on detection of absolute / traversal paths, but the non-regular-tree-entry check below uses `exit 1`. The asymmetry meant a fork PR that smuggles in a path like `docs/../../outside.md` would silently bypass Pass 1 (no file copied into _changed_md/) and Pass 2 (LLM Read/Glob/Grep tools see no content) — reducing validation coverage on exactly the inputs that warrant the closest look. Change `continue` to `exit 1` so both unsafe-input checks have consistent visible-failure semantics. Maintainers must explicitly address an offending path rather than have it skipped. Mirrored byte-identically across all three open workflow PRs. --- .github/workflows/ai-validation.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ai-validation.yml b/.github/workflows/ai-validation.yml index 3d77ec08..425644f1 100644 --- a/.github/workflows/ai-validation.yml +++ b/.github/workflows/ai-validation.yml @@ -110,8 +110,14 @@ jobs: || "$path" == "../"* \ || "$path" == *"/.." \ || "$path" == ".." ]]; then - echo "::warning::Skipping unsafe path with traversal/absolute prefix: $path" - continue + # Fail-fast (don't `continue`) so an unsafe path can't silently + # bypass Pass 1 (no file copied into _changed_md/) and Pass 2 + # (LLM tools see no content) — same reasoning as the non-regular + # tree-entry check below: maintainers must explicitly decide to + # land such a path. Visible failure > silent skip on inputs that + # warrant the closest look. + echo "::error::Refusing to bundle: path has traversal/absolute prefix: $path" + exit 1 fi # Refuse to bundle non-regular tree entries (symlinks mode 120000, # submodules 160000, etc). Skipping silently would let a PR that -- cgit v1.2.3