- Home
- Skills
- DevOps & Cloud
- Advanced Taint Tracking Python
Works with the AI Agents you already use
Advanced Taint Tracking Python
Detect SQLi, RCE, and SSTI vulnerabilities in Python apps using advanced AST taint tracking and dataflow tracing.
$15
Advanced Taint Tracking Python
Example session with this skill installed
Audit the current project for potential SQL injection and RCE by tracing request inputs to database and shell sinks.
- Read your context and instructions
- Compiled the advanced taint tracking
I have completed the AST taint analysis for the project. I identified one high-severity SQL injection path and one medium-severity RCE risk involving untrusted user input.
Taint Analysis Report
| ID | Source | Intermediate | Sink | Vulnerability |
|---|---|---|---|---|
| T-001 | request.args.get('id') | db_manager.py:get_user_query() | cursor.execute() | SQL Injection (Raw String Formatting) |
| T-002 | request.json['cmd'] | utils.py:run_diagnostic() | subprocess.Popen() | Remote Code Execution (Shell=True) |
Mitigation Code (T-001: SQL Injection)
# Vulnerable code in db_manager.py
# query = f"SELECT * FROM users WHERE id = {user_id}"
# cursor.execute(query)
# Recommended Fix: Use parameterized queries
query = "SELECT * FROM users WHERE id = %s"
cursor.execute(query, (user_id,))
Mitigation Code (T-002: RCE)
# Vulnerable code in utils.py
# subprocess.Popen(user_command, shell=True)
# Recommended Fix: Use list-based arguments and disable shell
# Map user input to a predefined list of allowed commands
allowed_commands = {"status": ["/usr/bin/uptime"], "check": ["/usr/bin/df", "-h"]}
if user_command in allowed_commands:
subprocess.Popen(allowed_commands[user_command], shell=False)
Next steps
- Apply the parameterized query fix in
db_manager.py. - Refactor
utils.pyto use an allow-list for shell commands instead of passing raw strings. - Run the automated evaluation suite to verify the fixes.
Connects securely to your tools. The creator never sees your data.
About this skill
Manual security audits often miss deep dataflow vulnerabilities hidden across multiple files. This skill performs static AST taint analysis to track untrusted user input from entry points to dangerous execution sinks.
What it does
- Source Mapping identifies untrusted data entry points like
request.args,request.json, and HTTP headers. - Propagation Tracing follows data through intermediate functions, variable assignments, and serialization steps.
- Sink Detection flags dangerous functions including
subprocess.Popen,eval, and raw SQLexecutecalls. - Mitigation Generation provides exact code fixes using parameterized queries and safe alternatives.
How it works
- Initialize Analysis by scanning API endpoints and controllers for untrusted input sources.
- Trace Dataflow across project files to see how variables move through the application logic.
- Audit Sinks to determine if sanitization occurs before the data reaches a sensitive function.
- Export Results as an AST taint path graph detailing the vulnerability and the fix.
Frameworks & tools
Built for Python web frameworks including Flask and Django. It utilizes Abstract Syntax Tree (AST) analysis for cross-file dataflow tracing without requiring external binaries.
Why this beats prompting it yourself
Generic prompts often overlook how data is transformed between files, leading to false negatives in security audits. This skill follows a deterministic workflow to ensure every hop from source to sink is mapped and validated against known dangerous patterns.
Use cases
- Detect SQL Injection by tracing user input into raw database cursor executions.
- Identify RCE Risks where unsanitized strings reach
os.systemorsubprocess. - Prevent SSTI by auditing
render_template_stringcalls in Flask applications. - PR Security Reviews to automatically check new endpoints for tainted data paths.
Known limitations
Restricted to pure Python AST analysis within the local workspace. It cannot detect vulnerabilities in external binaries or global system configurations.
Limited to Python AST analysis. Restricted to local workspace files. Cannot analyze external binaries or system-level dependencies.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 4 days ago
Requires
Permissions
Target Use Cases: - Trace untrusted input from HTTP request to database query in Python. - Perform taint analysis on this Django view for SQL injection. - Audit dataflow from user upload to file system sink.