gitnexus-taint-analysis
БесплатноБез исполняемых скриптовНе проверенUse when working on, reviewing, or extending GitNexus's CFG/taint/PDG subsystem (the `--pdg` layers), or when reasoning about source→sink data-flow findings…
от abhigyanpatwari★ 49 018 звёзд на GitHubОб этом скилле
CFG & Taint Analysis with GitNexus
Expert knowledge for the opt-in --pdg program-analysis subsystem: control-flow
graphs, reaching definitions, and intra- + inter-procedural taint. Read this
before touching gitnexus/src/core/ingestion/cfg/** or
gitnexus/src/core/ingestion/taint/**, or when explaining a finding.
When to Use
- "How does the taint engine work / why is this flow (not) reported?"
- Adding a source, sink, or sanitizer to the model.
- Extending or reviewing the CFG / reaching-defs / taint / summary code.
- Understanding the
explainMCP tool's findings (intra- vs inter-procedural). - Debugging a false positive or false negative in
--pdgoutput.
The layered substrate (build order)
Taint runs on the graph, not beside it. Each layer is opt-in behind --pdg
and a default analyze run is byte-identical (the golden parity gate is the
hard floor for every change here).
L1 CFG per-function basic blocks + control-flow edges (M1 #2081)
L2 REACHING_DEF GEN/KILL def→use data dependence (pure solver) (M2 #2082)
L3 Taint (intra) source→sink over RD facts, minus sanitizers (M3 #2083)
L4 Taint (inter) per-function summaries composed over CALLS (M4 #2084)
- Worker-built, main-thread-solved. The parse worker builds each function's
CFG + harvests def/use + call-site facts onto
ParsedFile.cfgSideChannel(plain, structured-clone-safe data — never AST nodes). The main thread runs the pure solvers. NEVER re-parse on the main thread (re-introduces the #1983 OOM). - In-phase emit (KTD1). L1–L4-harvest all run INSIDE the scope-resolution
pdg window (
scope-resolution/pipeline/run.ts, gatedinput.pdg === true), because the disk-backed ParsedFile store is cleared when that phase ends — a standalone post-mrophase would read empty data. The cross-function fixpoint (L4) is the exception: it runs in its OWN registered phase (taintSummaries) AFTER scope-resolution, because it needs the COMPLETE call graph, and consumes small plain summary data threaded out viaScopeResolutionOutput. - Pure-solver contract.
computeReachingDefs,computeTaintFlows,harvestFunctionSummary, andsolveInterprocTaintare pure and deterministic (no graph, no I/O, no logger; sorted outputs). Snapshot tests and content-derived edge ids depend on it.
Intra-procedural taint (L3)
Forward reachability over RD facts from matched sources to matched sinks, killed by sanitizers. Key design points worth internalizing:
- Occurrence-tagged sites. A flat per-arg binding set cannot tell
exec(escape(x))(safe) fromexec(x)(finding); the harvest records nested call structure (SiteRecord.parent/via-tags) so sanitizer interposition is precise. - Kind-set sanitizer model. A taint carries a set of neutralized
SinkKinds; a sink fires unless its kind is in the set. Soescape(req.body)suppressesres.send(xss) but STILL firesdb.query(sql) — a kind-blind kill would be a suppressed live injection (the forbidden FN direction).path.basename(t)neutralizes path-traversal only, not command-injection. - Statement-level finding identity. NOT block-pair (block conflation drops
distinct findings;
exec(req.body, req.query)is two findings). - Persisted as
TAINTEDedges (BasicBlock→BasicBlock); the path rides thereasoncolumn via the shared versioned codec (taint/path-codec.ts).
Interprocedural taint (L4) — the functional/summary method
The production approach (Sharir-Pnueli 1981; the same shape as Meta's Pysa and
Mariana Trench, and FB Infer) — NOT full IFDS tabulation. Each function is
reduced to a compact summary, and summaries are composed over the already-
resolved CALLS graph.
Summary shape (taint/summary-model.ts, whole-parameter granularity):
| Edge | Meaning | Analogue |
|---|---|---|
param→return |
a param flows to the return value | TITO — reserved (the floor already covers its recall; precision pass deferred) |
param→callee-arg |
a param flows into arg j of a call (carries the path's neutralized sink kinds) | TITO into callee |
param→sink |
a param reaches a modelled sink | partial/triggered sink |
source→return |
the function generates+returns a source | generative — composed via the caller's callResults |
source→callee-arg |
a generated source flows into a call | fixpoint SEED |
callResults |
a user-function call's result flows to a sink/return/callee-arg in the caller | composes with callee source→return |
The fixpoint (taint/interproc-solver.ts): the unit is (function, parameter, source). Seed from source→callee-arg, propagate via
param→callee-arg, fire a finding when a tainted param meets param→sink.
- Cycle-safe by monotonicity. The tainted-set is monotone over a finite
lattice (
fn × param × source), so the worklist converges — a recursive call just re-proposes an a
Установить gitnexus-taint-analysis в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл gitnexus-taint-analysis?
Use when working on, reviewing, or extending GitNexus's CFG/taint/PDG subsystem (the `--pdg` layers), or when reasoning about source→sink data-flow findings. Examples: "How does taint analysis work here?", "Why didn't explain find this flow?", "Add a new sink/source", "Review the interprocedural taint code".
Как установить скилл gitnexus-taint-analysis?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл gitnexus-taint-analysis запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic