Skip to content

fix(security): don't flag ../../ inside Markdown link targets as directory traversal - #19

Open
vladimirrterekhin-hit wants to merge 1 commit into
Evol-ai:mainfrom
vladimirrterekhin-hit:fix/markdown-link-traversal-fp
Open

fix(security): don't flag ../../ inside Markdown link targets as directory traversal#19
vladimirrterekhin-hit wants to merge 1 commit into
Evol-ai:mainfrom
vladimirrterekhin-hit:fix/markdown-link-traversal-fp

Conversation

@vladimirrterekhin-hit

Copy link
Copy Markdown

Fixes #18

../../ inside a Markdown link target (](../../x.md)) is a documentation
reference, not a filesystem operation, but D3 flagged it as medium
"Directory traversal pattern detected", pushing otherwise-clean skills from
PASS to CAUTION.

Change

  • lib/security-validator.js: narrow guard in the privilegePatterns loop +
    isInsideMarkdownLink() helper. Skips only the medium traversal finding when
    the match is inside an unclosed ](... link. No other pattern/severity
    affected.
  • scripts/tests/verify-local.js: runMarkdownLinkTraversalChecks()
    asserts doc links produce 0 traversal findings and that a real
    cat ../../../etc/passwd still flags. Uses the inline fs.mkdtempSync
    fixture convention (no committed fixture).

Verification: npm run verify:local green (after npm run build:oc).
+82 / −1 across 2 files.

🤖 Generated with Claude Code

…ctory traversal

../../ inside a Markdown link target (](../../x.md)) is a documentation
reference, not a filesystem operation, but D3 flagged it as medium
"Directory traversal pattern detected", pushing clean skills from PASS to
CAUTION. Adds a narrow guard (isInsideMarkdownLink) that skips only the
medium traversal finding inside an unclosed link; real shell/code traversal
is untouched. Adds runMarkdownLinkTraversalChecks to verify-local.js.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive: ../../ in Markdown link targets flagged as "Directory traversal"

1 participant