feat: source-sink security scanning + Parameter data flow#561
Conversation
Two complementary features for security and data flow analysis: 1. Source-Sink Scanner (MCP tool: source_sink) - BFS reachability from user-input sources to dangerous sinks - OWASP A03/A07/A10 coverage across 10+ languages - User-extensible catalogs via .gitnexus/security.json - Risk-ranked findings with path visualization 2. Parameter Data Flow (pipeline Phase 3.6b) - Extract function/method parameters from AST (tree-sitter) - Parameter nodes with type annotations and position - PASSES_TO edges mapping call-site arguments to callee parameters - Foundation for future taint tracking New node type: Parameter. New edge types: PASSES_TO, DATA_FLOWS_TO. New security module: src/security/ (catalogs.ts, source-sink-scanner.ts). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@marxo126 is attempting to deploy a commit to the NexusCore Team on Vercel. A member of the Team first needs to authorize it. |
CI Report❌ Some checks failed Pipeline Status
Test Results
❌ 1 failed / 4460 passed 46 test(s) skipped — expand for details
Code CoverageTests
📋 View full run · Generated by CI |
|
Please make sure to include your changes in the |
|
|
Holding this PR from merge — needs improvement before it's ready. After reviewing the Ferrante et al. 1987 PDG paper, the parameter-level data flow here (PASSES_TO edges by positional argument matching) is a simplified approximation of data dependence. It tracks function boundary crossings but not intra-function definition-use chains, which is what a proper Program Dependence Graph provides. What this PR does well:
What needs to happen before merge:
Will revisit after we formalize the PDG roadmap. |
Summary
Two capabilities aligned with the architecture assessment's security analysis roadmap:
source_sinkMCP tool. BFS over existing CALLS graph from source-adjacent to sink-adjacent functions. No new node types needed.Parameternode type withPASSES_TOedges mapping call-site arguments to callee parameters.Source-Sink Scanning
Coverage (13 frameworks)
User-extensible via
.gitnexus/security.json{ "sources": [{ "pattern": "myInput", "category": "user_input", "description": "Custom source" }], "sinks": [{ "pattern": "dangerousOp", "owasp": "A03-injection", "severity": "high", "description": "Custom sink" }] }Parameter Data Flow
Schema changes
Parameternode table:id, name, filePath, paramIndex INT32, declaredType, isRest BOOLPASSES_TOandDATA_FLOWS_TOadded to REL_TYPESsource_sinkMCP tool (tools.ts, local-backend.ts, server.ts)Real-world validation (Next.js + Prisma, 30K nodes)
Known limitations
Source-Sink
Parameter Data Flow
param: Userstores "User" as text, not linked to the User class node.foo(key=value)) matched by position.({ a, b }: Props)creates one node, not individual nodes.Test plan
🤖 Generated with Claude Code