Automated summary
Scans application source code for SQL injection vulnerabilities by tracing user input through data flows into query construction, then produces a security report with remediations.
Strengths
- Comprehensive mapping of input surfaces (HTTP params, headers, cookies, uploads, WebSocket messages) with data-flow tracing
- Multi-pattern detection: string concatenation, f-strings, template literals, unparameterized raw ORM queries
- Findings classified with CVSS 3.1 scores, attack type (blind, UNION, second-order) and business impact
- Generates idiomatic remediated code per framework and database, plus defense-in-depth recommendations
Limitations
- Static analysis only: no real exploitation or dynamic validation of findings
- Effectiveness depends on the user having already identified the framework and database type
- Requires write permissions to generate reports in the skill's working directory
Use during a code security audit, before a production release, or when reviewing newly written database queries.
Not suitable for dynamic penetration testing against a running application or for analyzing compiled binaries.
Security analysis
SafeThis is a defensive static-analysis skill that scans local source code for SQL injection patterns and writes a remediation report. Allowed tools are Read/Grep/Glob/Edit/Write plus narrowly scoped Bash prefixes (code-scan:*, security-test:*); there are no destructive commands, no network calls, no secret/token exfiltration, and no obfuscated payloads. Output is confined to a security-reports directory. Residual risk is minimal and limited to edits/writes within the project tree.
No concerns found
How this analysis is madeExamples
Scan the Express app in ./src for SQL injection vulnerabilities, trace the request handlers into the query layer, and write a report with CVSS scores and parameterized fixes.Detect SQLi risks in our Django models and any .raw() or .extra() calls, then show the parameterized equivalent for each finding.Review how user input from HTTP headers and cookies reaches our SQL queries in this repository and flag every path that skips parameter binding.name: detecting-sql-injection-vulnerabilities description: | Detect and analyze SQL injection vulnerabilities in application code and database queries. Use when you need to scan code for SQL injection risks, review query construction, validate input sanitization, or implement secure query patterns. Trigger with phrases like "detect SQL injection", "scan for SQLi vulnerabilities", "review database queries", or "check SQL security".
allowed-tools: Read, Write, Edit, Grep, Glob, Bash(code-scan:), Bash(security-test:) version: 1.0.0 author: Jeremy Longshore jeremy@intentsolutions.io license: MIT compatible-with: claude-code, codex, openclaw tags: [security, database, detecting-sql]
Detecting SQL Injection Vulnerabilities
Overview
Scan application source code for SQL injection vulnerabilities (CWE-89, OWASP A03:2021) by tracing user input from entry points through data flows into database query construction. Detect string concatenation, format string interpolation, and inadequate parameterization across raw SQL, ORM raw query methods, stored procedure calls, and dynamic query builders.
Prerequisites
- Application source code accessible in
${CLAUDE_SKILL_DIR}/ - Database query files, ORM models, and repository/DAO layers available
- Framework and language identified (Django, Rails, Express, Spring, Laravel, ASP.NET, Go, etc.)
- Database type known (MySQL, PostgreSQL, SQLite, MSSQL, Oracle) for syntax-specific detection
- Write permissions for reports in
${CLAUDE_SKILL_DIR}/security-reports/
Instructions
- Discover database interaction code: search for SQL keywords (
SELECT,INSERT,UPDATE,DELETE,EXEC) and ORM raw query methods (raw(),execute(),createNativeQuery(),$wpdb->query()) across all source files. - Identify input surfaces: map all user-controllable data entry points -- HTTP parameters, request bodies, URL path segments, headers, cookies, file uploads, and WebSocket messages.
- Trace data flows: follow each input surface through the code to determine whether user data reaches a SQL query. Flag any path where input is not passed through parameterized query binding.
- Detect vulnerable patterns:
- String concatenation:
"SELECT * FROM users WHERE id=" + userId - f-string/format interpolation: Python f-strings embedding variables directly into SQL strings
- Template literals:
`SELECT * FROM users WHERE id=${req.params.id}` - ORM raw queries without bindings:
Model.objects.raw("SELECT * FROM t WHERE x='" + val + "'")
- String concatenation:
- Classify each finding: assign CVSS 3.1 score, identify attack type (classic injection, blind boolean/time-based, UNION-based exfiltration, second-order/stored injection), and document exploitability (authentication required, network access).
- Assess impact per finding: determine data exposure scope (authentication bypass, data exfiltration, data modification, OS command execution via
xp_cmdshellorLOAD_FILE()). - Generate remediation code: provide parameterized equivalents for each vulnerable query. Use framework-idiomatic patterns --
%splaceholders for Python DB-API,?for Node.js,$1for PostgreSQL, named parameters for Spring JPA. - Recommend defense-in-depth measures: input validation (allowlists over denylists), stored procedures with parameterized calls, least-privilege database accounts, WAF rules, and ORM-only data access policies.
- Produce the vulnerability report at
${CLAUDE_SKILL_DIR}/security-reports/sqli-scan-YYYYMMDD.mdwith per-finding severity, CWE-89 mapping, file path and line number, vulnerable code snippet, attack vector demonstration, and remediated code.
See ${CLAUDE_SKILL_DIR}/references/implementation.md for the detection pattern library. See ${CLAUDE_SKILL_DIR}/references/critical-findings.md for example vulnerability write-ups with attack demonstrations.
Output
- Vulnerability Report:
${CLAUDE_SKILL_DIR}/security-reports/sqli-scan-YYYYMMDD.mdwith all findings classified by severity - Finding Details: per-finding file path, line number, vulnerable code, attack vector, CVSS score, and remediation code
- Remediation Summary: parameterized query replacements grouped by language/framework
- Defense Recommendations: input validation rules, database privilege changes, and WAF configuration
Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| Unknown ORM or database framework | Custom or uncommon data access library | Apply generic SQL injection pattern detection; note limited framework-specific guidance |
| Cannot analyze compiled/minified code | Production bundles or bytecode instead of source | Request unminified source; document reduced detection accuracy |
| False positive on sanitized input | Proper sanitization exists but not recognized | Trace sanitization implementation manually; whitelist verified-safe patterns |
| Complex dynamic query builder logic | Multi-step query construction across modules | Trace full data flow manually; flag for manual security review |
| Cannot analyze stored procedure definitions | SQL source files not available in ${CLAUDE_SKILL_DIR}/ | Request .sql files or database schema exports; focus on application-layer code |
Examples
- "Scan the codebase for SQL injection risks in dynamic query construction, focusing on controllers and API handlers."
- "Review these query snippets and propose parameterized equivalents with unit tests validating the fix."
- "Detect second-order SQL injection in the user profile update flow where stored data is later used in admin queries."
Resources
- OWASP SQL Injection Prevention Cheat Sheet: https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html
- CWE-89 Improper Neutralization of SQL Syntax: https://cwe.mitre.org/data/definitions/89.html
- OWASP A03:2021 Injection: https://owasp.org/Top10/A03_2021-Injection/
- CAPEC-66 SQL Injection: https://capec.mitre.org/data/definitions/66.html
${CLAUDE_SKILL_DIR}/references/critical-findings.md-- example vulnerability write-ups with attack vectors${CLAUDE_SKILL_DIR}/references/errors.md-- full error handling reference${CLAUDE_SKILL_DIR}/references/examples.md-- additional usage examples- https://intentsolutions.io
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/detecting-sql-injection-vulnerabilities-mrwakcy7/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/detecting-sql-injection-vulnerabilities-mrwakcy7' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/detecting-sql-injection-vulnerabilities-mrwakcy7/download' --output '.skill-downloads/detecting-sql-injection-vulnerabilities-mrwakcy7/SKILL.md.part' && mv '.skill-downloads/detecting-sql-injection-vulnerabilities-mrwakcy7/SKILL.md.part' '.skill-downloads/detecting-sql-injection-vulnerabilities-mrwakcy7/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
Tools declared by the author (check availability in your agent): Read, Write, Edit, Grep, Glob, Bash(code-scan:*), Bash(security-test:*)
Original excerpt: Prerequisites
- Application source code accessible in
${CLAUDE_SKILL_DIR}/ - Database query files, ORM models, and repository/DAO layers available
- Framework and language identified (Django, Rails, Express, Spring, Laravel, ASP.NET, Go, etc.)
- Database type known (MySQL, PostgreSQL, SQLite, MSSQL, Oracle) for syntax-specific detection
- Write permissions for reports in
${CLAUDE_SKILL_DIR}/security-reports/
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/detecting-sql-injection-vulnerabilities-mrwakcy7/SKILL.md' && test -s '.skill-downloads/detecting-sql-injection-vulnerabilities-mrwakcy7/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/detecting-sql-injection-vulnerabilities' && cp -R '.skill-downloads/detecting-sql-injection-vulnerabilities-mrwakcy7' '.claude/skills/detecting-sql-injection-vulnerabilities'Codex
test -f '.skill-downloads/detecting-sql-injection-vulnerabilities-mrwakcy7/SKILL.md' && test -s '.skill-downloads/detecting-sql-injection-vulnerabilities-mrwakcy7/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/detecting-sql-injection-vulnerabilities' && cp -R '.skill-downloads/detecting-sql-injection-vulnerabilities-mrwakcy7' '.agents/skills/detecting-sql-injection-vulnerabilities'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/detecting-sql-injection-vulnerabilities-mrwakcy7'openskills read 'detecting-sql-injection-vulnerabilities-mrwakcy7'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/detecting-sql-injection-vulnerabilities-mrwakcy7/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
DeFi AMM Security
Security
Security checklist for Solidity AMM contracts, liquidity pools, and swap flows. Covers reentrancy, donation attacks, oracle manipulation, slippage, and integer math.
Semgrep Rule Creator
Security
Creates custom Semgrep rules for detecting security vulnerabilities, bug patterns, and code patterns. Includes test-first methodology, taint mode support, and validation steps. Helps when building targeted static analysis detections.
Dev Toolbar Review Guide
Security
Safety rules for the dev toolbar, PostHog client, and feature flags. Use when reviewing changes to dev-tools and related files, covering environment guards, override cookies, and SSE stream safety.