agentleFS
awarexoneawarexone/AXguard/sql-injection/SKILL.md

sql-injection

Skill18 starsChanged 3 months agoMITView on GitHub

Analyze SQL and ORM injection risks in application code — use for string-built queries, raw SQL helpers, and database sinks (CWE-89 / A03:2021).

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After AXguard hits sql.* or suspicious injection.* near DB APIs.

    line 39
  2. Very specific:

    Prefer axguard flow evidence when available (sources_to_sql / unsanitized paths in dataflow.json).

    line 57
  3. Distinctive:

    Check whether identifiers (table/column) are user-controlled — bind parameters cannot fix identifier injection.

    line 61
  4. Distinctive:

    Prefer ORM query APIs without raw string splicing.

    line 82

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

SQL Injection Analysis

Purpose

Encode practitioner reasoning for detecting and validating SQL injection and unsafe raw-query patterns during pre-ship review.

When to Use

  • Reviewing database access code (SQL strings, ORM .raw, query builders).
  • After AXguard hits sql.* or suspicious injection.* near DB APIs.
  • API endpoints that filter/sort/search with user parameters.

When Not to Use

  • Queries that are fully static with zero user influence.
  • NoSQL-specific operator injection (use a dedicated NoSQL skill when available; AXguard nosql.* rules are adjacent).

Security Concepts

SQLi occurs when untrusted input changes SQL syntax/structure, not merely values. Parameter binding sends values separately so structure stays fixed.

Threat Model

Attacker influence over WHERE/ORDER/identifiers can yield data disclosure, authentication bypass, or in some stacks RCE via DB features — assess per engine.

Analysis Workflow

  1. Prefer axguard flow evidence when available (sources_to_sql / unsanitized paths in dataflow.json).
  2. Find sinks: execute, executemany, query, .raw, text(, cursor calls.
  3. Find sources: request params, headers, path, webhook bodies, AI tool args.
  4. Determine if input is concatenated, f-string formatted, or %-formatted into SQL.
  5. Check whether identifiers (table/column) are user-controlled — bind parameters cannot fix identifier injection; need allowlists.
  6. Confirm ORM usage is actually parameterized (some .raw/extra APIs are not).

Evidence Requirements

  • Sink location
  • Source of taint
  • Proof of string composition into SQL
  • Impact class (read / write / auth bypass) as hypothesis until validated

False Positive Controls

  • Bound parameters (?, %s with args tuple, ORM filters)
  • Allowlisted sort columns mapped server-side
  • Static admin scripts with no external input

Remediation

  • Parameterized queries / prepared statements only for values.
  • Allowlist for ORDER BY / column names.
  • Least-privilege DB accounts.
  • Prefer ORM query APIs without raw string splicing.

Verification

Re-run axguard audit, then manually confirm the risky composition path is gone and tests cover malicious input strings as data (not syntax).

Related Skills

api-security, security-triage, security-remediation, command-injection

Framework Mapping

  • CWE-89
  • OWASP A03:2021 Injection

References

Research Provenance

Primary: OWASP Top 10:2021 A03; CWE-89 (2026-09-15).
Secondary: AXGuard rules/sql.json; HF CyberNative DPO / UVID — derived pattern concepts only.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.