Input Validation Injection logo

Input Validation Injection

Organization
RedHatProductSecurity
input-validation-injection

Apply when reviewing or writing code that processes untrusted input, constructs queries or commands, or handles user-supplied data. Covers SQL, LDAP, OS command injection, prototype pollution, and general validation strategy.

Overview

PublisherRedHatProductSecurity
Repositoryprodsec-skills
Skill nameinput-validation-injection
Stars
56
Forks
9
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by RedHatProductSecurity on GitHub. Read the source before you install it.

Installation

Install the Input Validation Injection AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/RedHatProductSecurity/prodsec-skills/tree/main/ge-core/input-validation-injection
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/RedHatProductSecurity/prodsec-skills.git /tmp/prodsec-skills
mkdir -p .claude/skills
cp -r /tmp/prodsec-skills/ge-core/input-validation-injection .claude/skills/input-validation-injection
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Input Validation Injection in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Input Validation Injection on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Input Validation Injection is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Input Validation and Injection Defense

Ensure untrusted input is validated and never interpreted as code. Prevent injection across SQL, LDAP, OS commands, templating, and JavaScript runtime object graphs.

Core Strategy

  • Validate early at trust boundaries with positive (allow-list) validation and canonicalization.
  • Treat all untrusted input as data, never as code. Use safe APIs that separate code from data.
  • Parameterize queries/commands; escape only as last resort and context-specific.

Validation Playbook

  • Syntactic validation: enforce format, type, ranges, and lengths for each field.
  • Semantic validation: enforce business rules (e.g., start <= end date, enum allow-lists).
  • Normalization: canonicalize encodings before validation; validate complete strings (regex anchors ^$); beware ReDoS.
  • Free-form text: define character class allow-lists; normalize Unicode; set length bounds.
  • Files: validate by content type (magic), size caps, and safe extensions; server-generate filenames; scan; store outside web root.

SQL Injection Prevention

  • Use prepared statements and parameterized queries for 100% of data access.
  • Use bind variables for any dynamic SQL within stored procedures -- never concatenate user input into SQL.
  • Prefer least-privilege DB users and views; never grant admin to app accounts.
  • Escaping is fragile and discouraged; parameterization is the primary defense.

Example (Java PreparedStatement):

java
String custname = request.getParameter("customerName");
String query = "SELECT account_balance FROM user_data WHERE user_name = ? ";
PreparedStatement pstmt = connection.prepareStatement(query);
pstmt.setString(1, custname);
ResultSet results = pstmt.executeQuery();

LDAP Injection Prevention

  • Always apply context-appropriate escaping:
    • DN escaping for \ # + < > , ; " = and leading/trailing spaces
    • Filter escaping for * ( ) \ NUL
  • Validate inputs with allow-lists before constructing queries; use libraries that provide DN/filter encoders.
  • Use least-privilege LDAP connections with bind authentication; avoid anonymous binds for application queries.

OS Command Injection Defense

  • Prefer built-in APIs instead of shelling out (e.g., library calls over exec).
  • If unavoidable, use structured execution that separates command and arguments (e.g., ProcessBuilder). Do not invoke shells.
  • Strictly allow-list commands and validate arguments with allow-list regex; exclude metacharacters (& | ; $ > < \ ! ' " ( ) and whitespace when arguments must not contain spaces).
  • Use -- to delimit arguments where supported to prevent option injection.

Example (Java ProcessBuilder):

java
ProcessBuilder pb = new ProcessBuilder("TrustedCmd", "Arg1", "Arg2");
Map<String,String> env = pb.environment();
pb.directory(new File("TrustedDir"));
Process p = pb.start();

Query Parameterization Guidance

  • Use the platform's parameterization features (JDBC PreparedStatement, .NET SqlCommand, Ruby ActiveRecord bind params, PHP PDO, SQLx bind, etc.).
  • For stored procedures, ensure parameters are bound; never build dynamic SQL via string concatenation inside procedures.

Prototype Pollution (JavaScript)

  • Use new Set() or new Map() instead of object literals.
  • When objects are required, create with Object.create(null) or { __proto__: null } to avoid inherited prototypes.
  • Freeze or seal objects that should be immutable; consider Node --disable-proto=delete as defense-in-depth.
  • Avoid unsafe deep merge utilities; validate keys against allow-lists and block __proto__, constructor, prototype.

Caching and Transport

  • Apply Cache-Control: no-store on responses containing sensitive data; enforce HTTPS across data flows.

Implementation Checklist

  • Central validators: types, ranges, lengths, enums; canonicalization before checks
  • 100% parameterization coverage for SQL; dynamic identifiers via allow-lists only
  • LDAP DN/filter escaping in use; inputs validated prior to query
  • No shell invocation for untrusted input; if unavoidable, structured exec + allow-list + regex validation
  • JS object graph hardened: safe constructors, blocked prototype paths, safe merge utilities
  • File uploads validated by content, size, and extension; stored outside web root and scanned

Test Plan

  • Static checks for string concatenation in queries/commands and dangerous DOM/merge sinks.
  • Fuzzing for SQL/LDAP/OS injection vectors; unit tests for validator edge cases.
  • Negative tests exercising blocked prototype keys and deep merge behavior.

Frequently asked questions

What does the Input Validation Injection AI skill do?

Apply when reviewing or writing code that processes untrusted input, constructs queries or commands, or handles user-supplied data. Covers SQL, LDAP, OS command injection, prototype pollution, and general validation strategy.

Why use Input Validation Injection on TypingMind?

Because you install it once and use it with any model. Input Validation Injection is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Input Validation Injection in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/RedHatProductSecurity/prodsec-skills/tree/main/ge-core/input-validation-injection. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Input Validation Injection?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Input Validation Injection?

As many as you like. As long as a model supports skills, you can use Input Validation Injection with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Input Validation Injection AI skill free?

Yes. It is published on GitHub by RedHatProductSecurity under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇