injection-prevention

injection-prevention is a skill for Claude Code, Codex from HermeticOrmus/LibreSecOps-Claude-Code. It costs 0 tokens per session (2,458 once invoked), scanned A, original, MIT.

A security guide for preventing injection attacks, where untrusted input is mistaken for code or commands by another system.

In plain words
What is it for?
Use it to apply parameterized queries, context-specific encoding, and allowlists against SQL injection, XSS, command injection, path traversal, LDAP, and template injection.
Why use it?
It helps prevent attackers from changing database queries, web pages, shell commands, file paths, or templates through crafted input.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to apply parameterized queries, context-specific encoding, and allowlists against SQL injection, XSS, command injection, path traversal, LDAP, and template injection.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hermeticormus/libresecops-claude-code/injection-prevention
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add HermeticOrmus/LibreSecOps-Claude-Code --skill injection-prevention
Clone the repo
git clone --depth 1 https://github.com/HermeticOrmus/LibreSecOps-Claude-Code

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for injection-prevention

README.md
[![agentmods](https://agentmods.dev/badge/skills/hermeticormus/libresecops-claude-code/injection-prevention/github.svg)](https://agentmods.dev/skills/hermeticormus/libresecops-claude-code/injection-prevention)
Your own site
<a href="https://agentmods.dev/skills/hermeticormus/libresecops-claude-code/injection-prevention"><img src="https://agentmods.dev/badge/skills/hermeticormus/libresecops-claude-code/injection-prevention/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for injection-prevention

Your own site · 80×15
<a href="https://agentmods.dev/skills/hermeticormus/libresecops-claude-code/injection-prevention"><img src="https://agentmods.dev/badge/skills/hermeticormus/libresecops-claude-code/injection-prevention.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,458 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.02458
Opus 5 $0.00000 $0.01229
Sonnet 5 $0.00000 $0.00492
Haiku 4.5 $0.00000 $0.00246

Measured 6d ago against content hash 74cb1b55adb7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

injection-prevention scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

os.system(f"convert {filename} output.png")
plugins/secure-coding-practices/skills/injection-prevention/SKILL.md · 248 lines

How it starts

The opening of the file, as written. The whole thing — 248 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Injection Prevention

Comprehensive injection prevention patterns for SQL, XSS, command injection, path traversal, LDAP, and template injection across all major languages and frameworks.

Knowledge Base

The Fundamental Principle

Injection occurs when untrusted data is interpreted as code or structure by a downstream processor. The universal prevention is to ensure the processor can distinguish data from code. This is achieved through:

  1. Parameterization -- Sending data through a separate channel from code (prepared statements, argument arrays)
  2. Context-aware encoding -- Transforming data so it is inert in the target context (HTML encoding, URL encoding)
  3. Allowlist validation -- Accepting only data that matches a known-safe pattern (enum values, regex matching)

Denylist filtering (blocking known-bad characters) is almost always insufficient because there are too many encoding variations and bypass techniques.

SQL Injection

Root cause: User input concatenated into SQL query strings.

Prevention by language:

# VULNERABLE
cursor.execute(f"SELECT * FROM users WHERE name = '{name}'")

# SECURE - Parameterized query
cursor.execute("SELECT * FROM users WHERE name = %s", (name,))

# SECURE - Django ORM (parameterized by default)
User.objects.filter(name=name)

# VULNERABLE - Django raw with string formatting
User.objects.raw(f"SELECT * FROM users WHERE name = '{name}'")

# SECURE - Django raw with params
User.objects.raw("SELECT * FROM users WHERE name = %s", [name])
// VULNERABLE
db.query(`SELECT * FROM users WHERE name = '${name}'`);

// SECURE - Parameterized (pg library)
db.query('SELECT * FROM users WHERE name = $1', [name]);

// SECURE - Prisma ORM (parameterized by default)
prisma.user.findMany({ where: { name } });

// VULNERABLE - Sequelize literal
sequelize.query(`SELECT * FROM users WHERE name = '${name}'`);

// SECURE - Sequelize parameterized
sequelize.query('SELECT * FROM users WHERE name = :name', {
  replacements: { name }
});

Read the full file on GitHub · 248 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 248 lines · 0 tokens per session scan A 74cb1b55adb7

Subscribe to this mod's changes

injection-prevention is a skill published in the GitHub repository HermeticOrmus/LibreSecOps-Claude-Code (4 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,458 tokens. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

engineer-production-systems

Design, write, refactor, or optimize production code so it is secure, correct, resource-bounded, observable, and maintainable. Use for full-stack features, APIs, databases, AI/RAG/MCP tools, CPU/RAM/latency work, 10k-to-1M-user planning, or authorized kernel, browser, parser, protocol, and defensive…

kingggg5/shipproof · 86 tokens

jwt_tool

Skill "jwt_tool" from tr4m0ryp/shor, covering jwttool — jwt analysis & attacks, when to reach for it, key flags / modes, safe invocation and form field (oidc-style).

tr4m0ryp/shor · 52 tokens

sstimap

SSTImap (Python; pinned git clone, run in place from /opt/shor/tools/SSTImap, e.g. python sstimap.py). Maintained py3 successor to tplmap. Detects the template engine and escalates SSTI to code/command execution where the engine allows. Live → exploitation phase.

tr4m0ryp/shor · 51 tokens

ffuf

Skill "ffuf" from tr4m0ryp/shor, covering ffuf — http fuzzer, when to reach for it, key flags, safe invocation and evidence to capture.

tr4m0ryp/shor · 53 tokens

hunt-api-misconfig

Hunt API security misconfiguration — mass assignment, prototype pollution, HTTP verb tampering. Mass assignment: send {isadmin:true, role:admin, verified:true} on profile/account/reset endpoints — server blindly applies. JWT signature/crypto forging (alg:none, key confusion, kid/jku) is owned by hunt-jwt-crypto; this…

elementalsouls/Claude-BugHunter · 207 tokens

implementing-devsecops-security-scanning

Integrates Static Application Security Testing (SAST), Dynamic Application Security Testing (DAST), and Software Composition Analysis (SCA) into CI/CD pipelines using open-source tools. Covers Semgrep for SAST, Trivy for SCA and container scanning, OWASP ZAP for DAST, and Gitleaks for secrets detection. Activates for…

xalgorix/xalgorix · 109 tokens