gate-protections

Provides reference implementations that fix security-gate findings like injection, missing rate limits, and secret leaks.

Updated Jun 9, 2026
One-click install
npx skills add https://github.com/timikalo7/Execute --skill gate-protections-timikalo7
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gate-protections
Source: https://github.com/timikalo7/Execute/tree/main/.claude/skills/gate-protections
Command: npx skills add https://github.com/timikalo7/Execute --skill gate-protections-timikalo7

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Security scanners can report that code lacks protection against command injection, SQL injection, missing rate limits, token mishandling, hung HTTP requests, disabled TLS verification, eval usage, or hardcoded secrets — but they cannot write the fix. This Skill supplies working, tested reference implementations for each of those findings so the fix is written once, correctly, instead of improvised under deadline. ## Core Features & Use Cases - Injection-safe primitives: shell.mjs runs commands via argument arrays with allow-listed programs (no shell), and sql.mjs is a tagged template producing parameterized { text, values } queries plus allow-listed identifier and ORDER BY helpers. - Abuse and reliability guards: rate-limit.mjs implements a token bucket keyed on verified sessions with a global cost ceiling, and http.mjs provides fetchSafe with owned abort timers, retries, and plaintext refusal. - Credential and eval safety: tokens.mjs enforces httpOnly cookies and a persistence-free in-memory token store, secrets.mjs loads env config with non-enumerable secrets and generates .env.example, and safe-eval.mjs replaces eval with JSON parsing, dispatch tables, and an arithmetic parser. - Use Case: When security-gate blocks a push with sql-interpolation, adapt reference/sql.mjs so user input becomes a bound parameter, then run node reference/self-test.mjs to confirm all 43 assertions pass. ## Quick Start Ask the agent to apply the gate-protections reference implementation for the specific security-gate or system-design-gate rule that fired, then run the self-test to verify the fix.

Frequently Asked Questions about gate-protections

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix a SQL injection finding in Node.js?

Use parameterized queries so values never become SQL syntax. The sql.mjs reference is a tagged template returning { text, values } with $1 placeholders, plus ident() and orderBy() helpers that allow-list identifiers, which cannot be parameterized.

How do I prevent command injection when running shell commands?

Never build a command string; pass the program and an array of arguments with shell disabled so no shell parses them. The shell.mjs reference uses execFile with an allow-list of programs and rejects string arguments.

How should I implement rate limiting for an AI API route?

Key the limiter on something the client cannot forge, like a verified session id, never a request header. The rate-limit.mjs token bucket also enforces a global ceiling across all keys, since per-key limits bound one abuser but only a global ceiling bounds the bill.

Why is storing tokens in localStorage insecure?

localStorage is readable by any JavaScript on the origin, so one XSS vulnerability exposes the token. The tokens.mjs reference prefers httpOnly, Secure, SameSite cookies, or an in-memory access-token store with no persistence method.

Does the rate limiter work across multiple server instances?

No, rate-limit.mjs is in-memory and therefore per-process. Behind more than one instance it needs Redis or the platform's own limiter, though the keying and global-ceiling shape stays the same.

What are the limitations of these security reference modules?

They are references to adapt, not a framework, and sql.mjs emits Postgres-style $1 placeholders requiring a one-line change for MySQL. They do not replace a human security review on a real backend, since a scanner and a reference file cannot reason.