SC

shivasurya/code-pathfinder

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

143 stars 19 forks 质量 67 趋势 4Apache-2.0

Shivasurya/Code-Pathfinder 是一个从 https://github.com/shivasurya/code-pathfinder. 导入的 MCP 服务器候选服务器。

概览

Shivasurya/Code-Pathfinder 是一个从 https://github.com/shivasurya/code-pathfinder. 导入的 MCP 服务器候选服务器。

概述(AI 翻译)

开源SAST引擎,追踪文件和功能间的漏洞

网站 ·文档 ·规则注册表 ·MCP服务器 ·博客


快速启动

安装:

扫描Python项目(规则自动下载):

扫描Docker文件:

没有配置文件,没有API密钥,没有云端账户。结果几秒钟内就能进入你的终端。


什么是Code Pathfinder?

Code Pathfinder 是一款开源静态分析引擎,能够构建代码库的图表,并追踪数据如何通过其流动。它将源代码解析成抽象语法树,构建跨文件调用图,并运行污点分析以发现跨多个文件和函数边界的源代码到汇入漏洞。

v2.0 引入了跨文件数据流分析:通过辅助函数追踪来自一个文件的 HTTP handler 用户输入,再通过另一个文件中的 SQL 查询。这类分析是模式匹配工具完全忽略的。

跨档污点分析

大多数开源SAST工具运行于单个文件上。Code Pathfinder v2.0跨文件边界追踪受污染数据:

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。


Quick Start

Install:

brew install shivasurya/tap/pathfinder

Scan a Python project (rules download automatically):

pathfinder scan --ruleset python/all --project .

Scan Dockerfiles:

pathfinder scan --ruleset docker/all --project .

No config files, no API keys, no cloud accounts. Results in your terminal in seconds.


What is Code Pathfinder?

Code Pathfinder is an open-source static analysis engine that builds a graph of your codebase and traces how data flows through it. It parses source code into Abstract Syntax Trees, constructs call graphs across files, and runs taint analysis to find source-to-sink vulnerabilities that span multiple files and function boundaries.

v2.0 introduces cross-file dataflow analysis: trace user input from an HTTP handler in one file through helper functions and into a SQL query in another file. This is the kind of analysis that pattern-matching tools miss entirely.

Cross-File Taint Analysis

Most open-source SAST tools operate on single files. Code Pathfinder v2.0 tracks tainted data across file boundaries:

app.py:5    user_input = request.get("query")     ← Source: user-controlled input
  ↓ calls
db.py:12    cursor.execute(query)                  ← Sink: SQL execution

The engine builds a Variable Dependency Graph (VDG) per function, then connects them through inter-procedural taint transfer summaries. When user_input flows into a function parameter in another file, the taint propagates through the call graph to the sink.

How It Works

Source Code → Tree-sitter AST → Call Graph → Variable Dependency Graph → Taint Analysis → Findings
在 GitHub 查看完整 README

安装

docker run --rm -v "$(pwd):/src" \
新手?先看 mcpskill.org 教程 →