fix(skill-eval): filter safe-paths false-positives on markdown doc-link ../ (ag-eatf #safe-paths-doclink-filter)#796
Merged
Conversation
…nk ../ (ag-eatf) The safe-paths ms rule is a blunt regex flagging every ../, including the relative markdown doc-links that are the repo-wide SKILL.md convention (47+ skills). SKILL.md is documentation, not executed, so a ../ inside a markdown link target or relative doc-path is not a real traversal threat — it red the gate on every skill-touching PR (blocked #776, gated #759/#764/#767). Filter keeps safe-paths blocking ONLY when a ../ survives stripping markdown link targets + relative doc-path tokens (i.e. a real non-doc ../). Real threats (e.g. ../../etc/passwd in a description) still block; doc-links downgrade to advisory. +2 bats cases proving both directions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
scripts/skill-eval.shtreated ms'ssafe-pathsrule as blocking on every../. That rule is a blunt regex, and../relative markdown doc-links are the repo-wide SKILL.md convention (47+ skills, e.g.[x](../other/SKILL.md),../../docs/...md). SKILL.md is documentation, not executed code, so those are false positives — they reddedskill-eval→summaryon every skills-touching PR (blocked #776; gated #759/#764/#767 in this session's drain).Fix
Added a file-level filter:
safe-pathsstays blocking only when a../survives stripping (1) markdown inline-link targets](...)and (2) relative doc-path tokens (*.md/.markdown/.mdx/.txt/.rst) — i.e. a real, non-doc../. Otherwise the findings downgrade to advisory annotations (announced, not silenced).Net effect: purely removes false positives; real protection is preserved. A genuine traversal (e.g.
../../../../etc/passwdin a description) still blocks — verified. No regression to the other blocking rules.Evidence
bats tests/scripts/skill-eval.bats→ 12/12 pass (10 prior + 2 new ag-eatf cases: doc-links downgrade→PASS; real non-doc../→BLOCK).agent-nativeanddomainskills (previously red on safe-paths) now PASS; a mixed real-threat fixture BLOCKs.Closes-scenario: ag-eatf#safe-paths-doclink-filter
Bounded-context: BC2-Validation
Evidence: scripts/skill-eval.sh