cpg-analysis

Identify control-flow, data-flow, and taint-driven security issues via Joern and CodeQL.

705|56|Updated Dec 26, 2025
One-click install
npx skills add https://github.com/alinaqi/maggy --skill cpg-analysis-alinaqi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpg-analysis
Source: https://github.com/alinaqi/maggy/tree/main/skills/cpg-analysis
Command: npx skills add https://github.com/alinaqi/maggy --skill cpg-analysis-alinaqi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It eliminates uncertainty in complex codebases by revealing control-flow paths, data-flow paths, and security-relevant taint propagation that are hard to infer from ASTs alone.

Core Features & Use Cases

  • Deep code property graph analysis: Uses Joern Code Property Graph (AST+CFG+CDG+DDG+PDG) to map execution and dependency relationships across functions and modules.
  • Interprocedural taint and vulnerability detection: Uses CodeQL for security-focused, cross-function taint flows and vulnerability-style query results.
  • Tiered workflow to minimize cost: Scopes with Tier 1 tooling first, then escalates to Joern (Tier 2) for structural/flow queries and CodeQL (Tier 3) for security audits.

Use case example: Before a release, analyze how untrusted input travels through request handlers into authentication or database calls, then produce a targeted report of taint paths and likely vulnerability hotspots.

Quick Start

Use the cpg-analysis skill to run a CodeQL taint query for a suspected injection or unsafe redirect path in your target repository.

Frequently Asked Questions about cpg-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I trace taint propagation across functions in a large codebase?

To trace taint propagation across functions, you can use interprocedural taint queries via CodeQL to map how untrusted input travels through request handlers into sensitive sinks like authentication or database calls.

What is code property graph analysis and when do I need it for security auditing?

Code property graph analysis merges AST, CFG, CDG, DDG, and PDG structures using Joern to map execution and dependency relationships across modules. You need it for deep security audits where basic syntax inspection cannot reveal complex control-flow or data-flow vulnerabilities.

Can I use Joern and CodeQL together for vulnerability detection?

Yes, you can use Joern and CodeQL together in a tiered workflow. Scope with initial tooling first, escalate to Joern for structural and flow queries, then apply CodeQL for security-focused, cross-function taint flows and vulnerability-style query results.

Does this approach work for refactoring impact analysis across large codebases?

Yes, this approach supports complex refactoring impact analysis across large codebases by mapping execution and dependency relationships across functions and modules using the code property graph, revealing structural and flow changes that standard AST inspection misses.

How do I find injection or unsafe redirect paths in my target repository?

To find injection or unsafe redirect paths, run a CodeQL taint query targeting the suspected vulnerability path in your target repository, which will produce a targeted report of taint paths and likely vulnerability hotspots.

What are the limitations of basic syntax inspection for finding security flaws?

Basic syntax inspection cannot identify control-flow paths, data-flow paths, and security-relevant taint propagation that span across functions and modules, making it insufficient for deep audits of authentication, payment, and request-handling code.