Skip to content

fix(cli): exclude AI agent config directories from scanning (#75)#76

Merged
jeremyjs merged 1 commit into
mainfrom
fix/self-scan-opencode-false-positive
Jun 6, 2026
Merged

fix(cli): exclude AI agent config directories from scanning (#75)#76
jeremyjs merged 1 commit into
mainfrom
fix/self-scan-opencode-false-positive

Conversation

@jeremyjs

@jeremyjs jeremyjs commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Problem

After PR #73 introduced the .opencode/ directory, the dogfood self-scan binding gate fails on every PR with a critical false positive:

  • Rule: native:A03-SQL-INJECTION
  • File: .opencode/plugins/xcoder.ts:127
  • Issue: The native rule matches the word "create" (from "create a feature branch first") + template literal ${...} on the same line, flagging it as SQL injection.

This breaks the self-scan on every PR.

Fix

Adds .opencode/ and .claude/ to SKIP_DIRS in packages/cli/src/scanner.ts. These directories contain AI agent runtime configuration and plugins, not user application code. They belong in the same category as node_modules/, .git/, and __pycache__ — directories that should never be scanned for application vulnerabilities.

Verification

  • pnpm lint passes
  • pnpm typecheck passes
  • pnpm build passes
  • pnpm test passes (28/28)

Closes #75

Adds  and  to  in . These
directories contain AI agent runtime configuration and plugins (e.g.
), not user application code.

Without this exclusion, the native SQL injection rule produces a false
positive because it matches the word "create" (from natural language text
"create a feature branch first") combined with template literal
interpolation in agent plugin source.

The false positive currently breaks the self-scan binding gate on every
PR after #73 introduced the  directory.
@vercel

vercel Bot commented Jun 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
owasp-wtf-web Ready Ready Preview, Comment Jun 6, 2026 7:06am

Request Review

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

🛡️ OWASP.WTF self-scan

Total findings: 0 • Risk score: 100

Severity Count
critical 0
high 0
medium 0
low 0
info 0

Workflow run · Code scanning results

@jeremyjs
jeremyjs merged commit 2c111b3 into main Jun 6, 2026
7 checks passed
@jeremyjs
jeremyjs deleted the fix/self-scan-opencode-false-positive branch June 6, 2026 07:46
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.

Self-scan false positive: native SQL injection rule flags .opencode/ agent plugin

1 participant