fix: reduce false positives from real-world repo analysis#142
Open
JBAhire wants to merge 2 commits into
Open
Conversation
Tested g0 against 16 OSS repos (langchain, crewAI, AutoGPT, MCP servers,
spring-ai, etc.) and found 70% of 7,983 findings were false positives.
Root causes and fixes:
1. Test file filtering too lenient (engine.ts)
- Expanded isTestFile() patterns: .github/, __mocks__/, _test_/,
testing/, testutils/, testdata/, _tests.py, Tests.java
- Changed default from "keep downgraded critical/high in test files"
to "remove all test-file findings" (--include-tests still works)
2. CVE version comparison bug (cve-feed.ts)
- Maven ${project.version}, pnpm workspace:*, workspace:^ were
parsed as NaN, which compared as "less than" any version
- Added early return for non-numeric version placeholders
- Eliminated 430 false critical CVE findings across 7 repos
3. Utility-code suppression too conservative (pipeline.ts)
- Previously only suppressed when agents/tools were detected
- Now also suppresses when >80% of findings are utility-code
- Prevents noise floods in large repos where parsers miss entry points
4. Server file endpoint detection (reachability.ts)
- Added server.(py|ts|js) pattern to endpoint detection
- MCP server files now classified as endpoint-reachable instead of
utility-code, preserving real findings in server repos
Round 2 of FP analysis against 14 OSS repos (4,578 -> 482 findings). Fixes: 1. CVE matching: add affectedPackages to CVEEntry so CVE-2026-28363 only matches openclaw, not langchain/ollama/google-generativeai. Also filter intelligence findings from test files (SSRF test IOCs). 2. Blanket agent_property rules: downgrade AA-GI-059, AA-IA-096, AA-MP-086, AA-RA-068, AA-DL-102 to info/low — these check for properties no parser ever populates, making them 100% FP. 3. Framework library detection: new isFrameworkLibFile() downgrades confidence to low for findings in langchain_core/, crewai/src/, autogen_agentchat/, etc. Hidden by default --min-confidence medium. 4. AA-CF-056 capped at 3 findings and downgraded to medium — was firing 101 times (once per CrewAI agent) for the same systemic issue. 5. AA-RA-041/AA-HO-075: add file_not_matches context for MCP fetch servers. Also add file_not_matches support to yaml-compiler for both ast_matches and code_matches check types. 6. AA-TS-142: scope to Python only — was firing on React .tsx files matching setTimeout/setInterval. 7. AA-TS-184: enforce frameworks filter on agent_property checks — rule declared frameworks: [mcp] but fired on langchain agents.
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.
Summary
Scanned g0 against 14 real-world OSS repos and eliminated 89% of false positives (4,578 → 482 findings) across two rounds of fixes.
Repos tested
langchain, langchainjs, langgraph, crewAI-examples, MCP servers, MCP python-sdk, openai-agents-python, swarm, autogen, vercel ai-chatbot, langchain4j, langchaingo, spring-ai, open-interpreter
Final Results (default
--min-confidence medium)Round 1 Fixes (commit 1)
isTestFile()patterns, remove ALL test-file findings by default${project.version},workspace:*as non-numericserver.(py|ts|js)pattern for MCP serversRound 2 Fixes (commit 2)
affectedPackagesfield so CVE-2026-28363 only matches openclaw (eliminated 430 false critical CVEs)isFrameworkLibFile()downgrades confidence for langchain_core/, crewai/src/, autogen_agentchat/ (hidden by default)file_not_matchescontext for AA-RA-041/AA-HO-075 (new yaml-compiler feature)frameworks: [mcp]Test plan