/everything-copilot-cli:input-validationfrom everything-copilot-cli
Validates and sanitizes user input to prevent SQL injection, XSS, CSRF, and other injection attacks. Use when writing or reviewing code that processes user-supplied data.
Ships in everything-copilot-cli. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Identify everywhere user input enters the application:
# Find route handlers / API endpoints
grep -rn "app\.\(get\|post\|put\|delete\|patch\)\|router\." src/ --include="*.ts"
# Find request body/query/param access
grep -rn "req\.body\|req\.query\|req\.params\|request\.json" src/ --include="*.ts"
# Find file upload handlers
grep -rn "multer\|upload\|formidable\|busboy" src/ --include="*.ts"
Treat permission and access boundaries as the first control and application-level input validation as the second, independent control. Neither is sufficient alone: restricted credentials reduce blast radius when validation fails, and validation still matters even when the backing system is locked down.
# Find raw SQL queries — these are high risk
grep -rn "query\s*(\|execute\s*(\|raw\s*(" src/ --include="*.ts" -A 2
// ❌ VULNERABLE — string concatenation
const result = await db.query(`SELECT * FROM users WHERE id = '${userId}'`);
// ✅ SAFE — parameterized query
const result = await db.query('SELECT * FROM users WHERE id = $1', [userId]);
// ✅ SAFE — ORM with built-in parameterization
const user = await User.findOne({ where: { id: userId } });
# Find direct HTML rendering with user data
grep -rn "innerHTML\|dangerouslySetInnerHTML\|document\.write\|v-html" src/ --include="*.ts" --include="*.tsx" --include="*.vue"
# Find template rendering without escaping
grep -rn "res\.send\|res\.write" src/ --include="*.ts" -A 3
// ❌ VULNERABLE — raw HTML insertion
element.innerHTML = userComment;
// ✅ SAFE — text content (auto-escaped)
element.textContent = userComment;
// ✅ SAFE — sanitize before rendering
import DOMPurify from 'dompurify';
element.innerHTML = DOMPurify.sanitize(userComment);
# Check for CSRF middleware
grep -rn "csrf\|csurf\|csrfToken" src/ --include="*.ts"
# Find state-changing endpoints without protection
grep -rn "app\.post\|app\.put\|app\.delete" src/ --include="*.ts"
// Add CSRF protection middleware
import csrf from 'csurf';
app.use(csrf({ cookie: true }));
// Include token in forms
app.get('/form', (req, res) => {
res.render('form', { csrfToken: req.csrfToken() });
});
Validate all input at the entry point using a schema library:
import { z } from 'zod';
const CreateUserSchema = z.object({
email: z.string().email().max(254),
name: z.string().min(1).max(100).trim(),
age: z.number().int().min(0).max(150),
});
app.post('/users', (req, res) => {
const result = CreateUserSchema.safeParse(req.body);
if (!result.success) {
return res.status(400).json({ errors: result.error.issues });
}
// result.data is now typed and validated
createUser(result.data);
});
// Path traversal prevention
import path from 'path';
function safePath(userInput: string): string {
const resolved = path.resolve('/allowed/base', userInput);
if (!resolved.startsWith('/allowed/base')) {
throw new Error('Path traversal detected');
}
return resolved;
}
// URL validation
function safeUrl(url: string): boolean {
try {
const parsed = new URL(url);
return ['http:', 'https:'].includes(parsed.protocol);
} catch { return false; }
}
# Find unvalidated endpoints — routes without validation middleware
grep -rn "router\.\(post\|put\|patch\)" src/routes/ --include="*.ts" -A 5 | grep -v "validate\|schema\|zod\|joi"
// middleware/validate.ts
import { ZodSchema } from 'zod';
export function validate(schema: ZodSchema) {
return (req, res, next) => {
const result = schema.safeParse(req.body);
if (!result.success) return res.status(400).json({ errors: result.error.issues });
req.body = result.data;
next();
};
}
| Rationalization | Reality |
|---|---|
| "Frontend already validated it" | HTTP requests can be sent directly without going through a browser. |
| "It's an internal API, we can trust it" | Internal services can be compromised too. Apply zero trust principles. |
| "TypeScript ensures type safety" | TypeScript types are compile-time only. Runtime input must be treated as unknown. |
| "We use Zod/joi/yup, so we're covered" | Validation libraries are only as good as the schema. A wrong schema is still wrong. |
JSON.parse() results used without validationparseInt() or parseFloat() results used without NaN checks(a+)+, ([a-zA-Z]+)*)Content-Security-Policy headers to prevent XSS at the browser levelexplore agent to trace how user input flows through the applicationWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub drvoss/everything-copilot-cli --plugin everything-copilot-cli115 skills in this plugin
/actions-debuggingUse when a GitHub Actions workflow fails — diagnose the run log, identify the root cause, and apply a targeted fix/add-to-changelogUse when you've shipped a feature, fix, or breaking change and need to update CHANGELOG.md — follows Keep a Changelog format and syncs version numbers across package manifests./agent-governanceUse when designing or reviewing an AI agent system that needs policy-based access controls, intent classification, tool-level rate limiting, trust scoring for multi-agent workflows, or append-only audit trails.
Other plugins' skills for the same job