Documentation
¶
Overview ¶
Package taint traces MCP-reachable values to dangerous sinks across files. It tracks names within functions and seeds resolved callees. Unresolved calls remain in the path at reduced confidence.
Index ¶
Constants ¶
const TaintWorkLimit = 25_000_000
TaintWorkLimit is how many syntax nodes the taint walk visits before it stops between symbols. The largest trees in the regression set need about 7.5 million; the limit leaves room above that. Counting work, not time, makes the cut point the same on any machine.
Variables ¶
This section is empty.
Functions ¶
func OperationCategory ¶ added in v1.3.0
func OperationCategory(id language.ID, calleeText string, args []graph.Arg, resolvedInRepo bool, imports []string) (string, bool)
OperationCategory names the sink-catalogue category one call falls in, read from its callee and arguments alone, with no taint: command_injection when it starts a program, path_traversal when it opens, lists, writes or removes a path, ssrf when it requests a URL, sql_injection, eval, deserialization or raw_socket. Other analyzers use it to ask what a server's code can do at all - the transport analyzer weighs what a network caller would reach - not whether caller input reaches the call.
resolvedInRepo is graph.Call.Resolved: a call bound to the project's own function is not matched by its method name alone, and a bare name the project defines is that function, not the global API. imports are the calling file's imports; the get/post receiver check needs an HTTP client among them. The rewrites the taint walk makes from the file's tree (aliases, RegExp receivers, Docker imports) are approximated from the callee text: a receiver-qualified exec in Go or JavaScript is not a process unless the receiver is the child_process module.
Types ¶
type Analyzer ¶
type Analyzer struct{}
Analyzer traces tool/prompt/resource handler arguments, environment variables, file contents and HTTP response bodies to the sinks listed in catalog.go
func (*Analyzer) Analyze ¶
func (*Analyzer) Analyze(ctx context.Context, target model.Target, ac *analyzer.AnalysisContext) model.AnalyzerResult
func (*Analyzer) Describe ¶
func (*Analyzer) Describe() analyzer.Description